Jump to content

Hide the mouse cursor

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()



Share this post

Link to post
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

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

Func End()
EndFunc   ;==>End

Edit: Bad Local

I would just find a blank cursor

Edited by lordicast


Share this post

Link to post
Share on other sites


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! ***


Share this post

Link to post
Share on other sites

Try this

#Include <WinAPI.au3>




Share this post

Link to post
Share on other sites

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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.