Benutz ma google, hier:
ist von BugFix
von autoit.de
PHP Code:
[PHP]#include <WindowsConstants.au3>
#include <WinAPI.au3>
Global $hDC, $hPen, $obj_orig
Global $active, $lastActive = 0
HotKeySet("!e", '_ende')
_SetCrossToActive()
While 1
Sleep(100)
WEnd
Func _SetCrossToActive()
$active = WinGetHandle('[ACTIVE]')
If $lastActive = $active Then Return
$lastActive = $active
$hDC = _WinAPI_GetWindowDC($active)
ShowCross($hDC, @DesktopWidth / 2, @DesktopHeight / 2, 20, 2, 0xFF)
EndFunc
Func ShowCross($hDC, $start_x, $start_y, $length, $width, $color)
$hPen = _WinAPI_CreatePen($PS_SOLID, $width, $color)
$obj_orig = _WinAPI_SelectObject($hDC, $hPen)
_WinAPI_DrawLine($hDC, $start_x - $length, $start_y, $start_x - 5, $start_y) ; horizontal left
_WinAPI_DrawLine($hDC, $start_x + $length, $start_y, $start_x + 5, $start_y) ; horizontal right
_WinAPI_DrawLine($hDC, $start_x, $start_y - $length, $start_x, $start_y - 5) ; vertical up
; _WinAPI_DrawLine($hDC, $start_x, $start_y + $length, $start_x, $start_y + 5) ; vertical down
_WinAPI_MoveTo($hDC, $start_x, $start_y + $length)
_WinAPI_LineTo($hDC, $start_x, $start_y + 5)
EndFunc ;==>ShowCross
Func _ende()
_WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, BitOR($RDW_INVALIDATE,$RDW_ALLCHILDREN))
_WinAPI_SelectObject($hDC, $obj_orig)
_WinAPI_DeleteObject($hPen)
_WinAPI_ReleaseDC(0, $hDC)
Exit
EndFunc
[/PHP]