Sign in to follow this  
Followers 0
APPLEEATER

Hidding Mouse Cursor

13 posts in this topic

Hi

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

if there is any simple ways like

_MouseHide

and

_MouseShow

that would be best :)

Thanks

Share this post


Link to post
Share on other sites



Did you even read the helpfile? GuiSetCursor().

For a list of valid cursor IDs see MouseGetCursor.

CursorId = 16 will hide the mouse cursor.

Share this post


Link to post
Share on other sites

Did you even read the helpfile? GuiSetCursor().

Yes i did read the help file...

that is only for while the mouse is on-top of the GUI,

i want it to be hidden for the whole screen.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Create a GUI the size of the screen and make it 1 Transparentcy using WinSetTrans.

Edited by Alienware

Share this post


Link to post
Share on other sites

Create a GUI the size of the screen and make it 0 Transparentcy using WinSetTrans.

OK Thats for your help :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


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

Share this post


Link to post
Share on other sites

Never even thought of API. Heh sweet!

Share this post


Link to post
Share on other sites

For more options you can use this.


When the words fail... music speaks

Share this post


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

Share this post


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

Share this post


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

Share this post


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

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
Sign in to follow this  
Followers 0