Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Hiding the mouse cursor


  • Please log in to reply
21 replies to this topic
antonyb
  • Members
  • 61 posts
  • Last active: Mar 07 2006 09:24 AM
  • Joined: 26 May 2004
Hey Lazlo,

I can't get your scripts to work properly. They work the first time round, but thats it. For instance, change the beginning of your latest script to:
SystemCursor(0)
MsgBox INVISIBLE CURSOR

SystemCursor(1)
MsgBox VISIBLE AGAIN

SystemCursor(0)
MsgBox INVISIBLE CURSOR

SystemCursor(1)
MsgBox VISIBLE AGAIN
Here, the cursor disappears for the first INVISIBLE CURSOR msgbox, reappears for the first VISIBLE AGAIN msgbox, but then stays visible for the next two msgboxes.

Can you confirm that on your system the cursor disappears both times?

Thanks,

Ant.

[p.s. Great work both of you, by the way!]

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
You are right, it only worked once:

The system destroys hcur by calling the DestroyCursor function. Therefore, hcur cannot be a cursor loaded using the LoadCursor function. To specify a cursor loaded from a resource, copy the cursor using the CopyCursor function, then pass the copy to SetSystemCursor.

I updated the last script, to make first a copy of the cursor and let that be destroyed. Also, we need enough room for the copy, but I don't know for sure, how much. I assume 32*32 words, 32*32*4 = 4096 bytes, plus change. (For some reason CopyCursor did not work, so I used CopyImage, as Shimanov.)

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
This is such a great script that its long overdue to be included in the documentation. I've added it to the DllCall page and also mentioned it on the MouseMove page.

Thanks to both of you.

user
  • Members
  • 476 posts
  • Last active: Dec 23 2011 07:18 PM
  • Joined: 05 Oct 2006
can you tell me please if I can change the appearance of I-Beam cursor when it is over a specific control?

and what are the available appearances

I want to do this because I-Beam hides characters when I type sometimes..

thanks

Hoobas
  • Guests
  • Last active:
  • Joined: --
Sorry guys,
How can I write a script to toggle between cursor to hourglass?

Z_Gecko
  • Guests
  • Last active:
  • Joined: --
http://www.autohotke...topic35600.html

Masonjar13
  • Members
  • 1517 posts
  • Last active:
  • Joined: 16 Sep 2012

Revive! Sorry about that, but there's no other threads about this, so this is all I've got. Using Laszlo's function seems to work fine, but not with animated cursors. Upon making them visible again, the animated cursors become static and I have to open the cursors info pane and click "Ok" to fix them. Can this be modified to handle animated cursors correctly? I'm not very familiar with DllCall.


OS: Windows 7 Ultimate / Windows 8.1 Pro | Editor: Notepad++