简体   繁体   English

按住左键时更改鼠标光标颜色 - Windows

[英]Change mouse cursor color when left button is held down - Windows

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.这应该在 Windows 10 中工作,所以在操作系统级别,而不是在任何特定程序中。 I would like to do this to know when "ClickLock" is enabled.我想知道何时启用“ClickLock”。 Is there anyway to achieve this?有没有办法实现这一目标?

I have tried with Autohotkey but nothing happens我尝试过使用 Autohotkey 但没有任何反应

; 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 

For more info, please refer to: https://autohotkey.com/board/topic/32608-changing-the-system-cursor/更多信息请参考: https : //autohotkey.com/board/topic/32608-changed-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 )
    }
}

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.我在第一次尝试时遇到了一些不同的资源,它们为我指明了注册表项的方向,甚至是一个漂亮的 powershell 脚本来按需设置它们。 Do a little research, bro.做个小调查,兄弟。 Happy coding.快乐编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将鼠标悬停在Windows Phone 8上时更改按钮背景颜色 - Change button background color when mouse over Windows phone 8 在 windows 使用 python 如何检查鼠标中键是否被按住? - In windows using python how do I check if the middle mouse button is held down? 如果按住鼠标左键而不移动光标,则Window.DragMove()会导致窗口暂时冻结。 - Window.DragMove() causes the window to freeze temporarily if holding down the mouse left button without moving the cursor 在Windows上获取鼠标光标位置和按钮状态 - Getting mouse cursor position and button state on Windows 以编程方式更改 windows 中的自定义鼠标 cursor? - Programmatically change custom mouse cursor in windows? 如何在单击鼠标左键时禁用按住Alt键,Control键和Shift键的功能 - How to disable the pressing/holding down of the Alt key, Control Key, and Shift Key when the left mouse button is clicked 如果鼠标悬停在jdatepicker按钮上,如何更改鼠标光标 - How to change mouse cursor if mouse is over jdatepicker button 如何在左右单击系统范围内更改鼠标光标? - How to change mouse cursor on left and right click system wide? 向上发送鼠标左键后检测到鼠标左键向下 - Detect left mouse button down after sending left mouse button up 从 Windows 上的另一个进程更改 window 上的鼠标 cursor - Change the mouse cursor on a window from another process on Windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM