jacky998877 Posted February 21, 2023 Posted February 21, 2023 (edited) #include <WindowsConstants.au3> #include <WinAPI.au3> #Include <GDIPlus.au3> _GDIPlus_Startup () $hDC = _WinAPI_GetWindowDC(0) $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hDC) $Color = 0xFF000000 $hPen = _GDIPlus_PenCreate($Color,2) For $y = 0 to 30 For $x = 0 to @DesktopWidth Step 5 _GDIPlus_GraphicsDrawLine($hGraphic, @DesktopWidth/2, 0, $x, @DesktopHeight, $hPen) $Color += Hex(2) _GDIPlus_PenSetColor($hPen, $Color) Next Next _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE+$RDW_ALLCHILDREN) _WinAPI_ReleaseDC(0, $hDC) _GDIPlus_Shutdown() Edited February 21, 2023 by jacky998877
Solution mistersquirrle Posted February 21, 2023 Solution Posted February 21, 2023 Just modifying that code? #include <WindowsConstants.au3> #include <WinAPI.au3> #Include <GDIPlus.au3> _GDIPlus_Startup () $hDC = _WinAPI_GetWindowDC(0) $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hDC) $Color = 0xFF000000 $hPen = _GDIPlus_PenCreate($Color,2) _GDIPlus_GraphicsDrawLine($hGraphic, 0, @DesktopHeight/2, @DesktopWidth, @DesktopHeight/2, $hPen) _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE+$RDW_ALLCHILDREN) _WinAPI_ReleaseDC(0, $hDC) _GDIPlus_Shutdown() However there's some issues with it, such that anything that updates on the screen will remove your painted line. If you want to create a presistent overlay, check out this thread/post from Melba: jacky998877 1 We ought not to misbehave, but we should look as though we could.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now