LAttilaD Posted January 31, 2024 Posted January 31, 2024 There is a registry entry which contains the color of the mouse pointer on Windows 11. But if I run regwrite('HKEY_CURRENT_USER\Software\Microsoft\Accessibility', 'CursorColor', 'REG_DWORD', 0xff8000) then check it in Regedit, I see this value written there. Correct. Just… the mouse pointer doesn’t change color. What shall I do to actually change the pointer color? Changing in the Accessibility settings works well, no problem, but I would like to do it from a script. Láng Attila D., LAttilaD.org
Developers Jos Posted January 31, 2024 Developers Posted January 31, 2024 (edited) Moved to the appropriate forum. Please post in the proper support forum from here on as this is not the first time we need to move your Threads. Moderation Team Edited January 31, 2024 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
LAttilaD Posted January 31, 2024 Author Posted January 31, 2024 (edited) Sorry, I’m rarely using Autoit forum and don’t really know how it is built. Thank you for moving it. Edited January 31, 2024 by Jos removed the quote box and moved your answer outside of it Láng Attila D., LAttilaD.org
Andreik Posted January 31, 2024 Posted January 31, 2024 You have to change CursorType as well and since you are working with registry probably you have to reload explorer to see the effect. I don't know if there is a WinAPI for this.
LAttilaD Posted January 31, 2024 Author Posted January 31, 2024 42 minutes ago, Andreik said: You have to change CursorType as well and since you are working with registry probably you have to reload explorer to see the effect. I don't know if there is a WinAPI for this. Thank you. Now the code is looking like as follows, but – it doesn’t change the color. $color=0xffffff regwrite('HKEY_CURRENT_USER\Software\Microsoft\Accessibility', 'CursorColor', 'REG_DWORD', $color) $c=MouseGetCursor() GUISetCursor($c-1) GUISetCursor($c) #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Local $sExplorer = "explorer.exe" While ProcessExists($sExplorer) ProcessClose($sExplorer) WEnd Run($sExplorer) Láng Attila D., LAttilaD.org
argumentum Posted February 1, 2024 Posted February 1, 2024 (edited) 7 hours ago, LAttilaD said: I see this value written there. Correct. Just… _WinAPI_SystemParametersInfo($SPI_SETCURSORS, 0, 0, 0) ; <<< that failed. Thought it would reload from registry but it does not That should ( haven't tried ) update the pointer. Let us know if that worked. Tried and failed. It may take a reboot Edited February 1, 2024 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Werty Posted February 1, 2024 Posted February 1, 2024 3 hours ago, argumentum said: _WinAPI_SystemParametersInfo($SPI_SETCURSORS, 0, 0, 0) Shouldnt the last parameter be $SPIF_SENDCHANGE, just guessing here. Some guy's script + some other guy's script = my script!
argumentum Posted February 1, 2024 Posted February 1, 2024 Tried ,0) all the way to ,3) to no avail. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
LAttilaD Posted February 1, 2024 Author Posted February 1, 2024 😭😭😭 Rebooting just for a mouse color change is nonsense. I can do it, of course, by „Run, invoke the appropriate dialog box, click here, click there”, but hoped there is a nicer solution. Anyway, thank you guys for trying. Láng Attila D., LAttilaD.org
LAttilaD Posted February 1, 2024 Author Posted February 1, 2024 Here’s what I could manage. Note that the MouseClick coordinates should be calibrated according to the screen settings. It’s not reliable, though. Sometimes it runs completely without changing the color, then being run again, it works. $color = 'ff8000' $clip = ClipGet() Send('{lwin}') Sleep(100) ClipPut('mouse pointer and touch') Send('^v') Sleep(1000) Send('{enter}') WinWait('Settings') WinActivate('Settings') Sleep(1000) MouseClick('left', 380, 480, 1, 0) MouseClick('left', 420, 480, 1, 0) ClipPut($color) Send('{tab 4}{end}{bs 6}^v{tab}{enter}') Sleep(500) Send('!{f4}') ClipPut($clip) Láng Attila D., LAttilaD.org
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