hostarch.blogg.se

Monitor on screen crosshair
Monitor on screen crosshair











monitor on screen crosshair monitor on screen crosshair

Employs the _MouseCursorFuncs UDF as well Author: Ascend4nt = #NoTrayIcon AutoItSetOption ( "TrayAutoPause", 0 ) = GLOBAL VARIABLES = Global $bHKPressed = False, $bPropertyHKPressed = False, $iResolutionchangeMsg = 0 = HOTKEY FUNCTIONS = ESC Key Pressed: Func _HotKeyPressed ( ) $bHKPressed = True EndFunc ALT-P Pressed: Func _ChangeXHairProperties ( ) 'Grow' the crosshairs and set them to Red, or alternately shrink them and set them to whitish If Not $bPropertyHKPressed Then _XHairSetDisplayProps ( 25, 25, 0xFF0000 ) Else _XHairSetDisplayProps ( 8, 8, 0xF0F0F0 ) EndIf $bPropertyHKPressed = Not $bPropertyHKPressed EndFunc = WINDOWS MESSAGE HANDLER FUNCTIONS = Func _Resolutionchanged($hWnd,$iMsg,$wParam,$lParam) Note this registers multiple-monitor settings changes too, but will only report on the primary monitor's resolution This is why we would need to call _WinAPI_GetSystemMetrics() to get the Virtual width/height = Func _Resolutionchanged ( $hWnd, $iMsg, $wParam, $lParam ) $iResolutionchangeMsg += 1 Return 'GUI_RUNDEFMSG' From Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG' EndFunc = START MAIN CODE = Dim $aNewMousePos Create the crosshairs (but don't make them visible yet) _XHairInit ( 11, 11 ) HotKeySet ( "", "_HotKeyPressed" ) Alt-p switches between two alternate CrossHair properties HotKeySet ( "!p", "_ChangeXHairProperties" ) -| Register Display-Mode changes to our function. Expand collapse popup #include #include = Simple test of _Crosshairs UDF.













Monitor on screen crosshair