AutoHotkey Community

It is currently May 25th, 2012, 11:06 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: CursorCheck()
PostPosted: January 25th, 2008, 10:26 am 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
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 ^_^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2008, 11:51 am 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
Thank for sharing, but how is it more useful than just using A_Cursor?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2008, 1:26 pm 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
Some program(s), esp. game(s) probably not using standard system cursor, and A_Cursor might be Unknown ~

_________________
Sakurako ^_^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2008, 6:22 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2008, 9:51 pm 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
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 ^_^


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, tic and 8 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group