Announcement

Collapse
No announcement yet.

Hide the cursor using User32.dll

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • kachok
    replied
    Thanks, I will check this sample project ))

    Leave a comment:


  • Ulrich
    replied
    Build and run the attached sample project, and check the result. Note that the cursor remains hidden only while inside the application window, if you move it away from the application window, it will reappear.

    Ulrich
    Attached Files

    Leave a comment:


  • kachok
    replied
    Unfortunately, it doesn't work... ((

    Leave a comment:


  • Ulrich
    replied
    Use this instead:

    Code:
    -- hide cursor
    DLL.CallFunction(_SystemFolder.."\\User32.dll", "ShowCursor", "0", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
    
    -- show cursor
    DLL.CallFunction(_SystemFolder.."\\User32.dll", "ShowCursor", "1", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
    Ulrich

    Leave a comment:


  • kachok
    started a topic Hide the cursor using User32.dll

    Hide the cursor using User32.dll

    Hi there,
    I am trying to hide/show the cursor using User32.dll.
    My OS is Windows 10 Pro x64.

    I use this script to hide the cursor:
    DLL.CallFunction(_SystemFolder.."\\User32.dll", "ShowCursor", "0", DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL);

    And this one to show it:
    DLL.CallFunction(_SystemFolder.."\\User32.dll", "ShowCursor", "1", DLL_RETURN_TYPE_INTEGER, DLL_CALL_CDECL);

    But my app crashes executing these scripts.
    What could be the reason?
Working...
X
😀
🥰
🤢
😎
😡
👍
👎