Search the Community
Showing results for tags '_WinAPI_DrawRect'.
-
Hello all.. I am working on a client server application, and part of the client application is to create color borders on the screen, while the script is performing various tasks. So far, I am using the following method: #include <WinAPI.au3> Border(0xFFFF00) sleep(10000) func border($color) _WinAPI_DrawRect(0,0, @DesktopWidth, @DesktopHeight, $color) _WinAPI_DrawRect(1,1, @DesktopWidth -1, @DesktopHeight -1, $color) _WinAPI_DrawRect(2,2, @DesktopWidth -2, @DesktopHeight -2, $color) _WinAPI_DrawRect(3,3, @DesktopWidth -3, @DesktopHeight -3, $color) endfunc Func _WinAPI_DrawRect($start_x, $start_y, $iWidth, $iHeight, $iColor) 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) ; clear resources _WinAPI_DeleteObject($hBrush) _WinAPI_ReleaseDC(0, $hDC) EndFunc ;==>_WinAPI_DrawRect The above code should turn your screen border yellow (0xFFFF00) for about 10 seconds.. The first issue is, it doesn't turn yellow, it turns Cyan... The second problem is, Windows redraws the screen frequently, so if anything is drawn over the border, it goes away, unless I either AdlibRegister to call the draw every few seconds, OR just have it call during the while loop. Is there a simple way I can create a good screen border, maybe as a transparent GUI that still lets users click on areas of the screen without the gui being in the way? Or is there a simple method to make that border on the screen (which will change color depending on the current state of the script) that is not effected by the windows screen redraw? thanks in advance!!