Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GuiConstantsEx.au3>
- #include <GDIPlus.au3>
- #include <WindowsConstants.au3>
- #include <WinAPI.au3>
- Global $hGUI, $hGraphic, $hPen, $hPenBg
- Global Const $targetFps = 60
- HotKeySet("{F7}", "Terminate")
- Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client
- Opt('MustDeclareVars', 1)
- _Main()
- Func _Main()
- Local Const $WS_EX_NOACTIVATE = 0x08000000 ; A top-level window created with this style does not become the foreground window when the user clicks it
- $hGUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED, $WS_EX_TRANSPARENT, $WS_EX_NOACTIVATE))
- _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF)
- _GDIPlus_Startup()
- $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
- $hPen = _GDIPlus_PenCreate(0xFFFF0000, 2)
- $hPenBg = _GDIPlus_PenCreate(0xFFABCDEF, 2)
- GUISetState()
- _GDIPlus_GraphicsClear($hGraphic, 0xFFABCDEF)
- Local $oldPos = MouseGetPos()
- While 1
- Local $pos = MouseGetPos()
- _GDIPlus_GraphicsDrawLine($hGraphic, @DesktopWidth / 2, @DesktopHeight / 2 , $oldPos[0], $oldPos[1], $hPenBg)
- _GDIPlus_GraphicsDrawLine($hGraphic, @DesktopWidth / 2, @DesktopHeight / 2 , $pos[0], $pos[1], $hPen)
- $oldPos = $pos
- Sleep(1000 / $targetFps)
- WEnd
- Terminate()
- EndFunc ;==>_Main
- Func Terminate()
- _GDIPlus_PenDispose($hPen)
- _GDIPlus_PenDispose($hPenBg)
- _GDIPlus_GraphicsDispose($hGraphic)
- _GDIPlus_Shutdown()
- Exit
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement