argumentum Posted July 19, 2023 Share Posted July 19, 2023 (edited) 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. Edited December 4, 2023 by argumentum better code Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now