Search the Community
Showing results for tags 'pointer size'.
-
A way to set, or reset to your whishes, the mouse pointer size: #include <WinAPISys.au3> Example() Func Example() Local $iOriginal = _System_MouseCursor_GetSize() ConsoleWrite(_System_MouseCursor_SetSize(15) & @CRLF) Sleep(1000) ConsoleWrite(_System_MouseCursor_SetSize($iOriginal) & @CRLF) EndFunc ;==>Example Func _System_MouseCursor_SetSize($iSize = 1) If $iSize < 1 Then $iSize = 1 ; https://stackoverflow.com/questions/60104778/ If $iSize > 15 Then $iSize = 15 Return _WinAPI_SystemParametersInfo(0x2029, 0, 16 * ($iSize + 1), 0x01) EndFunc ;==>_System_MouseCursor_SetSize Func _System_MouseCursor_GetSize() Local $iVal = RegRead("HKCU\Control Panel\Cursors", "CursorBaseSize") If @error Then Return SetError(@error, @extended, 1) Return SetError(@error, @extended, ($iVal / 16) - 1) EndFunc ;==>_System_MouseCursor_GetSize ..because in my case, it changes by itself after I jumped around my more than 1 monitor and resolutions and scale or RDPs and what not. This way I can click-click a solution PS: I have not tried this but is an idea. Maybe I don't need to click anything if I catch it changing, it can fix itself: GUIRegisterMsg($WM_SETTINGCHANGE,"MY_WM_SETTINGCHANGE") Func MY_WM_SETTINGCHANGE($hWnd, $Msg, $wParam, $lParam) If $wParam = 0x00002029 Then AdlibRegister("putItBackYouYouCrazySystem") EndFunc Func putItBackYouYouCrazySystem() AdlibUnRegister("putItBackYouYouCrazySystem") _System_MouseCursor_SetSize($iMySize_but_needs_to_be_declared) EndFunc ..anyways, hope it helps someone. PS: I actually solved the problem with this code. What I have to do now is change the code in the script that's messing up the mouse pointer.