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 

CursorCheck()

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Sakurako



Joined: 10 May 2007
Posts: 194
Location: China/ Canada

PostPosted: Fri Jan 25, 2008 9:26 am    Post subject: CursorCheck() Reply with quote

Code:
^t::MsgBox, 64, Cursor Check, % "Cursor: " CursorCheck() A_Space "(" A_Cursor ")"

CursorCheck()
{
; Credit: shimanov, http://www.autohotkey.com/forum/post-47747.html#47747
 VarSetCapacity(ci, 20, 0)
 ci := Chr(20)
 ErrorLevel := DllCall("GetCursorInfo", "uint", &ci)
 ErrorLevel := mod(ErrorLevel + 1, 2)
 h_cursor := *(&ci+8)+(*(&ci+9) << 8)+(*(&ci+10) << 16)+(*(&ci+11) << 24)
 return h_cursor
}

_________________
Sakurako ^_^
Back to top
View user's profile Send private message Visit poster's website
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Fri Jan 25, 2008 10:51 am    Post subject: Reply with quote

Thank for sharing, but how is it more useful than just using A_Cursor?
Back to top
View user's profile Send private message
Sakurako



Joined: 10 May 2007
Posts: 194
Location: China/ Canada

PostPosted: Fri Jan 25, 2008 12:26 pm    Post subject: Reply with quote

Some program(s), esp. game(s) probably not using standard system cursor, and A_Cursor might be Unknown ~
_________________
Sakurako ^_^
Back to top
View user's profile Send private message Visit poster's website
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Fri Jan 25, 2008 5:22 pm    Post subject: Reply with quote

In MS Word, Wordpad, MultiEdit, IE7... the msgbox always says the cursor is 65555. What does it mean? Is it the code of IBeam? (XP SP2)
Back to top
View user's profile Send private message
Sakurako



Joined: 10 May 2007
Posts: 194
Location: China/ Canada

PostPosted: Fri Jan 25, 2008 8:51 pm    Post subject: Reply with quote

The function should be used for comparing cursor, but probably difficult to get what cursor would look like. However, if just trying to find the name of displayed standard system cursor, A_Cursor would be recommended instead ~
_________________
Sakurako ^_^
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
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