Changing the Color of the Cursor in Windows 10

Get help with using AutoHotkey and its commands and hotkeys
rapp
Posts: 1
Joined: 22 May 2019, 23:19

Changing the Color of the Cursor in Windows 10

10 Jan 2020, 18:24

Using this page I was able to change the cursor, but I cannot figure out how to change the color of the cursor, i.e., change the color while leaving the cursor the same. Any suggestions?

https://autohotkey.com/board/topic/32608-changing-the-system-cursor/page-1

Here is the code that if found for changing the cursor:

Code: Select all

#SingleInstance Force

~MButton::SetSystemCursor() 
~MButton Up::RestoreCursors()


IDC_ARROW := 32512
IDC_IBEAM := 32513
IDC_WAIT := 32514
IDC_CROSS := 32515 ; Plus Sign

IDC_UPARROW := 32516
IDC_SIZE := 32640
IDC_ICON := 32641
IDC_SIZENWSE := 32642
IDC_SIZENESW := 32643
IDC_SIZEWE := 32644
IDC_SIZENS := 32645
IDC_SIZEALL := 32646
IDC_NO := 32648
IDC_HAND := 32649
IDC_APPSTARTING := 32650
IDC_HELP := 32651

SetSystemCursor()
{
	IDC_SIZEALL := 32646
	CursorHandle := DllCall( "LoadCursor", Uint,0, Int,  32515)
	Cursors = 32512,32513,32514,32515,32516,32640,32641,32642,32643,32644,32645,32646,32648,32649,32650,32651
	Loop, Parse, Cursors, `,
	{
		DllCall( "SetSystemCursor", Uint,CursorHandle, Int,A_Loopfield )
	}
}

RestoreCursors() 
{
	SPI_SETCURSORS := 0x57
	DllCall( "SystemParametersInfo", UInt,SPI_SETCURSORS, UInt,0, UInt,0, UInt,0 )
}
[Mod edit: [code][/code] tags added]
User avatar
TheDewd
Posts: 1390
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Changing the Color of the Cursor in Windows 10

14 Jan 2020, 08:57

I think you will need to create a custom cursor file using some kind of icon editor application, and then choose that file instead of the default installed cursors.

Otherwise, you can probably use a transparent Gui or Gdip function to draw your own simulated cursor on the screen while hiding the real cursor.

There's several ways you could achieve this...

I do not think you will be able to use any functions to change the color of the default cursors.
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, Bral, chenj209, eblanc, F4Jonatas, Gavnar, Gigadroid, Google [Bot], KiddoV, SilasDeVis, wyatterp, Xtra and 117 guests