Jump to content

Hide the mouse cursor


 Share

Recommended Posts

Hey, I am wondering how you hide the mouse cursor.

Ive seen the function GUISetCursor(16) which will hide the mouse cursor in a window (16 is the value for a blank cursor). However, I don't want it to just be inside a GUI and would like it to be whenever. It would be like the "Hide cursor while typing" only it hides the cursor at all times. I have also seen MouseGetCursor() which will get the value of the cursor, but I didn't see a MouseSetCursor()

Thanks,

GT

Link to comment
Share on other sites

This should get you started

HotKeySet('{Esc}', 'End')


Global Const $USER32 = DllOpen("user32.dll")
Global Const $cDir = 'C:\Windows\Cursors' ; Cursor Dir for vista
;
Global Const $Cursor = $cDir & '\wagtail.ani' ;Cursor that it will change to
Global Const $CursorBack = $cDir & '\aero_arrow_l.cur'

MouseSetCursor($Cursor) ;Set Cursor

While 1
    Sleep(10)
WEnd

Func MouseSetCursor($nCursor)
    ;Load
    $cDll = DllCall($USER32, "hwnd", "LoadCursorFromFile", "str", $nCursor)
    If @error <> 0 Then Return
    ;Change
    DllCall($USER32, "int", "SetSystemCursor", "int", $cDll[0], "int", 32512)
    If @error <> 0 Then Return
EndFunc   ;==>MouseSetCursor

Func End()
    MouseSetCursor($CursorBack)
    Exit
EndFunc   ;==>End

Edit: Bad Local

I would just find a blank cursor

Edited by lordicast
[Cheeky]Comment[/Cheeky]
Link to comment
Share on other sites

  • 6 months later...
  • 10 months later...

Hello!

I use your script, but my problem is: when i replaced a cursor with an other one (blank), i cant change again, to the original one. So: i can change back one cursor, but it's not the original. I want to change back the cursor, what the user use, when he start my software. I can change it back, if the user use a profile for it. You can read a registry value, from this root: "HKEY_CURRENT_USER\Control Panel\Cursors". Its a REG_EXPAND_SZ value, called Arrow. But you cant read it, if its empty. I was looking for the windows default cursor, but i didn't find it in the Cursors root, in the Windows folder. Can you help me? Have you same idea for me? Whats the method for it?

*** I'm sorry, i know, my english is bad, but i hope, you understand everything! ***

Anzelm

Link to comment
Share on other sites

  • 4 years later...

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