Sign in to follow this  
Followers 0
Bhrawn

MouseGetCursor Values

6 posts in this topic

I'd just like to know if when calling this function, it *only* returns the values it recognizes, ie. 0-16, or if it actually sees a value, doesn't recognize it, and defaults to returning 0?

If there is a value it's evaluating, is there anyway to get it to just show whatever value it has, even if it's not recognized?

I'm trying to write some conditional statements based on a change in the cursor. I really don't care what the value is, just that it changed but I can't get it to show me anything other than 0 for unknown.

Even if it recognizes that it has a different value than it used to, that'd work for me, no matter what value is or was.

Thanks

Share this post


Link to post
Share on other sites



Hey Bhrawn!!

Im actually not getting what u r asking/saying

Can u be a little more clear or can u plzz post the Code!!!

Regards

PhoenixXL


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I'd just like to know if when calling this function, it *only* returns the values it recognizes, ie. 0-16, or if it actually sees a value, doesn't recognize it, and defaults to returning 0?

In answer to your first question I think it will always see a value but only supports ID numbers listed 1-16. It will return 0 for any other type. There may be other methods you could use, but I'm afraid I am not certain how to go about it.

Edited by czardas

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Sorry if I wasn't very clear. Let me see if I can explain better:

If I'm running an app that generates it's own cursor icons, when you execute MouseGetCursor(), it will *only* return a value between 0 and 16, 0 being an unrecognized cursor type.

Inside custom apps, they rarely use any of the 16 recognized cursor types, and I want to see what the cursor value is, even though it's not 'recognized'.

For example, inside a custom app with custom cursor icons, this fuction:

Func ShowCursorType()
   $mousecursortype = MouseGetCursor()
   $mouseposition = MouseGetPos()
   $mousex = $mouseposition[0]
   $mousey = $mouseposition[1]
   ToolTip('Mouse Position: ' & $mousecursortype & ' : ' & $mousex & ',' & $mousey, 0, 0)
EndFunc
will display "Mouse Position: 0 : 428,127" on a ToolTip label.

Because the app I'm running is using a custom cursor icon, it always returns 0.

Here's what I'm trying to get at...

When you call MouseGetCursor(), AutoIt must been looking at some value somewhere so see what the value is, then returning a 0-16 integer if that value matches one of the 16 default Windows cursor types.

I'd like to access the actual value this fuction is looking at, regardless of whether AutoIt recognizes the cursor icon value or not.

Even if AutoIt doesn't recognize what value it is, there must be some value and that value would change if that app changed its cursor. AutoIt might see a value of 2984375 for one cursor and when the cursor changes, it might see 6123948. I'm assuming these values would be the same for each time a particular cursor icon is being used.

I want to be able to evaluate this change. Certainly AutoIt can not know for sure what the icon looks like, but the change in the cursor value would be recognized and I want to be able to test off that and run code based on the change from one value to another.

if($mousecursorvalue = 2984375)
   keep running this code
else
   run this code now
Edited by Bhrawn

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

SOLVED!!!!

Ok, I kept diving further and further into some related posts and found a great thread that captures the cursor icon and converts it to a .bmp.

In his code he used:

_WinAPI_GetCursorInfo()

so I looked into that, and *voila*...

The 3rd element in the returned array is EXACTLY what I was looking for!

$MouseCursor = _WinAPI_GetCursorInfo()
$MouseCursorIcon = $MouseCursor[2]

In this code, $MouseCursorIcon gives me the value of the mouse cursor icon!

Thanks to those that tried to help, as well as 'ofLight' for unknowingly posting what lead me to the answer!

/cheers

Edited by Bhrawn

Share this post


Link to post
Share on other sites

Well It feels good ....... U got the Answer


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

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