GetCursorType>resultvar

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Mar 17, 2008 7:43 pm

Hi Marcus,

Thanks for that link... I notice it says...
  • GetCursor Function
    The GetCursor function retrieves a handle to the current cursor.
From what I had seen above, I had thought the number coming back was an actual "Cursor Type"... but now I see its "a handle to the current cursor". I suppose for a regular app, a standard set of "system cursors" must exist and there is a different handle to each one of them. So with regular apps, the GetCursor LinFunc> call is returning these different handles and that's enough to tell us the cursor has changed.

Since this isn't working for us in IE (the number coming back is always the same) I assume that IE must define/use its own cursor/icon resource and that handle never changes.

Perhaps the following Win32 API function would allow us to get the required info...
  • GetCursorInfo Function
    The GetCursorInfo function retrieves information about the global cursor.

    Syntax

    BOOL GetCursorInfo( PCURSORINFO pci
    );
Then again, perhaps LibFunc (in its current form) will not work with this function because its a Boolean?

Ahh well, if anyone has more info on this or knows of a DLL that can pull the current cursor type being used inside a browser (IE, Firefox, etc.), please share... and thanks in advance.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Mar 17, 2008 8:01 pm

Handles are assigned at run time. Just like window handles. The handle itself won't tell you anything about a cursor - it just identifies a cursor.

Booleans are actually integers - 1 or 0. So LibFunc can return booleans. But the pointer to the cursor info is another matter.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Snickers
Macro Veteran
Posts: 151
Joined: Thu Dec 09, 2004 3:01 pm
Location: Somewhere in TX

Post by Snickers » Mon Mar 17, 2008 8:36 pm

What is the reason why a screenshot does not capture a cursor?

If we could possibly capture a screenshot of just the cursor, the screenshot of the cursor could be used to assign each cursortype to a variable. Then using imagerecognition we could compare

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Mar 18, 2008 12:00 am

jpuziano wrote:Since this isn't working for us in IE (the number coming back is always the same) I assume that IE must define/use its own cursor/icon resource and that handle never changes.
It's much more complex (worse) than you suggest, the cursor type can be defined in the code in the viewed webpage, see here for some examples. Add in the possibility of the user having a cutsie cursor utility like the dreaded comet cursor and this whole idea looks to have a poor chance of success.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Tue Mar 18, 2008 2:54 am

Hi Me_again,

Thanks for that useful link... but barring a custom cursor on the odd web page, I think the great majority of web pages will just be using one or more of the "predefined cursor types under CSS2 specification" as the info at the link you provided says.

Again, I don't know how hard this would be... but if a DDL can be created to let us know when a web page in IE has finished loading, then I'm pretty sure one could be created to tell us which of the "predefined cursor types" is currently being used within a web page in IE.

Then again, Snickers asked... "What is the reason why a screenshot does not capture a cursor?

I know of image capture programs that capture the cursor right along with the image... so obviously its possible. If the ScreenCapture> command had an option to let it capture the mouse pointer as part of the captured image... then maybe this could be tackled with image recognition.

I can see that being useful beyond webpages too... just for the ability to capture the mouse pointer in the image, what form it took (pointer, hand, crosshair, etc.), where it was on the screen when the ScreenCapture was taken, etc. Any possibility of adding that Marcus?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 18, 2008 12:57 pm

Again, I don't know how hard this would be... but if a DDL can be created to let us know when a web page in IE has finished loading, then I'm pretty sure one could be created to tell us which of the "predefined cursor types" is currently being used within a web page in IE.
LOL! IE has an ActiveX interface. One of it's most basic properties is one called Busy. So all one needs to do is query that property. You can do it yourself in a few lines of simple VBScript. See:
http://www.mjtnet.com/forum/viewtopic.php?t=1511

Anyone can create a DLL for use with Macro Scheduler. So if you know how to achieve something which will benefit you then go right ahead.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts