1
votes

I am trying to change cursor color when the mouse left button is in the 'hold down state'. This is supposed to work in Windows 10, so something at the OS level, not in any specific program. I would like to do this to know when "ClickLock" is enabled. Is there anyway to achieve this?

I have tried with Autohotkey but nothing happens

; Cursor types
IDC_APPSTARTING :=  32650

~LButton::
while GetKeyState("LButton", "P")
     {
        ; this is the code to the Dll call, but I am not sure how to integrate it
         hCursor:=DllCall("LoadCursor", "UInt", NULL,"Int", IDC_APPSTARTING, "UInt")
         DllCall("SetCursor","UInt",hCursor)
     }
return 
2

2 Answers

1
votes

For more info, please refer to: https://autohotkey.com/board/topic/32608-changing-the-system-cursor/

IDC_APPSTARTING :=  32650

~LButton::
    changeCursor(IDC_APPSTARTING)
Return

~LButton Up::
    changeCursor()
Return

changeCursor(cursor := 0) {
    if (cursor) {
        CursorHandle := DllCall("LoadCursor", Uint, 0, Int, cursor)
        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 )

    } else {
        DllCall("SystemParametersInfo", UInt, 0x57, UInt, 0, UInt, 0, UInt, 0 )
    }
}
-1
votes

Have you tried anything yet? I would say probably start googling. I came across a few different resources on the first try that pointed me in the direction of the registry keys, and even a nifty powershell script to set them on demand. Do a little research, bro. Happy coding.