AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Hiding the mouse cursor
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
antonyb



Joined: 26 May 2004
Posts: 61

PostPosted: Wed Nov 02, 2005 11:01 am    Post subject: Reply with quote

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:
Code:
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!]
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3877
Location: Pittsburgh

PostPosted: Wed Nov 02, 2005 8:18 pm    Post subject: Reply with quote

You are right, it only worked once:
MSDN for SetSystemCursor wrote:
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.)
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Fri Sep 29, 2006 5:02 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
user



Joined: 05 Oct 2006
Posts: 423

PostPosted: Tue Sep 11, 2007 11:26 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group