Jump to content

Windows 11 Mouse Color Change - (Moved)


Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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 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.
  :)

Link to comment
Share on other sites

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.

When the words fail... music speaks.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

😭😭😭

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...