Vielleicht hilft ja das hier:
Starten, und mit der Shift-Taste malen ;)
Code:
#cs
GDI+ Example - Draw on Transparent & Click-Through GUI
by SEuBo, 24.12.2010
http://www.elitepvpers.com/forum/autoit/903693-autoit-auf-den-bildschirm-malen.html
#ce
#include <Misc.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
;Variablen deklarieren
Local $hGUI, $hGraphics, $hBitmap, $hBackBuffer, $hPen
Local $hDLL, $aMPos, $aMPos_New
;GDI+ initialisieren, DLL für _IsPressed öffnen und ESC als HotKey festlegen
_GDIPlus_Startup()
$hDLL = DllOpen("user32.dll")
HotKeySet("{ESC}","_Exit")
;Transparente GUI erstellen
$hDummy = GUICreate("") ; Dummy GUI, damit richtiges nicht in Taskleiste auftaucht.
$hGUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST,$WS_EX_TRANSPARENT),$hDummy)
GUISetBkColor(0xABCDEF, $hGUI)
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 255)
;Graphic-Objekt, Pinsel und Backbuffer erstellen und GUI anzeigen
$hPen = _GDIPlus_PenCreate(0xFFFF0000,4) ; Roten Pinsel mit Breite von 4 px.
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics(@DesktopWidth, @DesktopHeight, $hGraphics)
$hBackBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
GUISetState()
While Sleep(10)
$aMPos = MouseGetPos()
While _IsPressed(10, $hDLL)
$aMPos_New = MouseGetPos()
;~ If Not IsArray($aMPos) Then $aMPos = $aMPos_New
If $aMPos[0] <> $aMPos_New[0] Or $aMPos[1] <> $aMPos_New[1] Then
_GDIPlus_GraphicsDrawLine($hBackBuffer, $aMPos[0], $aMPos[1], $aMPos_New[0], $aMPos_New[1],$hPen)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
$aMPos = $aMPos_New
EndIf
WEnd
WEnd
Func _Exit()
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_PenDispose($hPen)
GUIDelete($hGUI)
Exit
EndFunc