Jump to content

I want DC of entire Handle


Go to solution Solved by MrTP,

Recommended Posts

Func _MarkMatch($Coordinates, $iColor = 0x0000FF)
    Local $start_x = $Coordinates[0], $start_y = $Coordinates[1], $iWidth = $Coordinates[2], $iHeight = $Coordinates[3]
    Local $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop)
    Local $tRect = DllStructCreate($tagRECT)
    DllStructSetData($tRect, 1, $start_x)
    DllStructSetData($tRect, 2, $start_y)
    DllStructSetData($tRect, 3, $iWidth)
    DllStructSetData($tRect, 4, $iHeight)
    Local $hBrush = _WinAPI_CreateSolidBrush($iColor)
    _WinAPI_FrameRect($hDC, DllStructGetPtr($tRect), $hBrush)
    _WinAPI_DeleteObject($hBrush)
    _WinAPI_ReleaseDC(0, $hDC)
EndFunc   ;==>_MarkMatch

 

Link to comment
Share on other sites

  • Solution
i can do it
Func _MarkMatch($Handle,$Coordinates, $iColor = 0x0000FF)
    Local $gameHD = $Handle
    Local $start_x = $Coordinates[0], $start_y = $Coordinates[1], $iWidth = $Coordinates[2], $iHeight = $Coordinates[3]
    Local $hDC = _WinAPI_GetWindowDC($gameHD) ; DC of entire screen (desktop)
    Local $tRect = DllStructCreate($tagRECT)
    DllStructSetData($tRect, 1, $start_x)
    DllStructSetData($tRect, 2, $start_y)
    DllStructSetData($tRect, 3, $iWidth)
    DllStructSetData($tRect, 4, $iHeight)
    Local $hBrush = _WinAPI_CreateSolidBrush($iColor)
    _WinAPI_FrameRect($hDC, DllStructGetPtr($tRect), $hBrush)
    _WinAPI_DeleteObject($hBrush)
    _WinAPI_ReleaseDC(0, $hDC)
EndFunc   ;==>_MarkMatch

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...