Jump to content

Hidding Mouse Cursor


APPLEEATER
 Share

Recommended Posts

Did you even read the helpfile? GuiSetCursor().

For a list of valid cursor IDs see MouseGetCursor.

CursorId = 16 will hide the mouse cursor.

Link to comment
Share on other sites

This works. To exit, press the WINDOWS key, and click the exit button the tray item.

$H = GUICreate("", @DesktopWidth+20, @DesktopHeight+20)
WinSetTrans($h, "", 1)
GUISetState()
GUISetCursor(16)
While 1
    WEnd

Or, if you wanted to do this, real, that would take some work, you could get the explorer window handle, and use GUISetCursor().

Edited by Alienware
Link to comment
Share on other sites

You could alos use

Function Reference

_WinAPI_ShowCursor

--------------------------------------------------------------------------------

Displays or hides the cursor

#Include <WinAPI.au3>

_WinAPI_ShowCursor($fShow)

Parameters $fShow If True, the curor is shown, otherwise it is hidden

Return Value Success: The new display counter

Remarks

This function sets an internal display counter that determines whether the cursor should be displayed. The

cursor is displayed only if the display count is greater than or equal to 0. If a mouse is installed, the

initial display count is 0. If no mouse is installed, the display count is -1.

See Also

Search ShowCursor in MSDN Library

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Hi

I would like to know how . . . to hide, and show the mouse cursor,

Surprisingly, no one has mentioned the _MouseTrap() function that's part of the Misc.au3 UDF. Search the Help file and you'll see _MouseTrap() is all you'll need to hide and show the mouse. Use screen coordinates verses window or client for best results. And for screen position you could use any position outside of your current screen resolution.

_MouseTrap

-------------------

Confine the Mouse Cursor to specified coords.

#Include <Misc.au3>
_MouseTrap([$iLeft = 0[, $iTop = 0[, $iRight = 0[, $iBottom = 0]]]])
Link to comment
Share on other sites

Surprisingly, no one has mentioned the _MouseTrap() function that's part of the Misc.au3 UDF. Search the Help file and you'll see _MouseTrap() is all you'll need to hide and show the mouse. Use screen coordinates verses window or client for best results. And for screen position you could use any position outside of your current screen resolution.

I have used that function before,

but i still want to be able to move the mouse,

so that doesn't help me at all

Link to comment
Share on other sites

I have used that function before,

but i still want to be able to move the mouse,

so that doesn't help me at all

Sorry for the stupid question, but with a "hidden mouse" how would you know its where you want it? If you're wanting to use MouseMove() or MouseMove() to click screen coord and not see the mouse trail, you could use 0 for the speed. Then again you could also use the ControlClick() or ControlCommand().

Maybe a little more insight could help us help you with your end goal.

Link to comment
Share on other sites

Sorry for the stupid question, but with a "hidden mouse" how would you know its where you want it? If you're wanting to use MouseMove() or MouseMove() to click screen coord and not see the mouse trail, you could use 0 for the speed. Then again you could also use the ControlClick() or ControlCommand().

Maybe a little more insight could help us help you with your end goal.

If you have seen my C Pong game in Example Scripts,

i am looking to use it for that,

If i add it I might use a UDF to disable the mouse click until the game is ended.

The main thing is,

i want the mouse movable,

but not seen,

I could make a mouse trap the height of the screen with params -5, 0, 1, @DesktopHeight

That i think will be the best solution :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...