Sign in to follow this  
Followers 0
asmodehn

GUIGetCursorInfo() on active window ?

4 posts in this topic

Hi all,

I am trying to compute a pixel Checksum on controls in some of my scripts.

I need that because for some ActiveX controls, we may know nothing about them, but still want to detect some change in the control display or compare it with a reference checksum...

So I tried to make a script which will behave in the same way that the "AutoIT window info" program to get a control, then use a hotkey (F1) to compute the checksum.

The script is attached, just have a look : I am using GUIGetCursorInfo() to get the control under the mousecursor... AND my foreground window need to remain the one I create, to be able to see the info.

My problem is that works perfectly when the active windowm is the foreground window, but I get nothing when the active window is not the foreground one...

Can someone let me know how I can have the same behaviour regarding active - foreground window than in "AutoIT window info", and get the controlPos in them ?

Thank you very much :)

controlPixelCKSUM.au3

Share this post


Link to post
Share on other sites



To have valid info the GuiGetCursorInfo returns info just on active windows related with the GUI you create.

It is impossible to get info on non active window. Perhaps with a specific logic you can activate with WinActivate the window you are looking for.

Thanks for pointing out the problem, I will update the doc to have everybody aware of this active thing. :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thank you for that answer,

I tried to activate the window with winactivate("title"). This works ( I get the focus as if I click on it ) but I am still unable to access the controls in it with GUIGetCursorInfo.

Actually the window I am looking for is not related in any way to the GUI I created, so I guess that is the reason.

I just wanted the same behaviour as AutoIT window info has with selecting a window to make it active, and get the control coords in it, while the GUI I actually created remain on the foreground...

So I guess this is not possible using an AutoIT script :-/

Anyway Thanks for the hint :)

Edited by asmodehn

Share this post


Link to post
Share on other sites

Thank you for that answer,

I tried to activate the window with winactivate("title"). This works ( I get the focus as if I click on it ) but I am still unable to access the controls in it with GUIGetCursorInfo.

Actually the window I am looking for is not related in any way to the GUI I created, so I guess that is the reason.

I just wanted the same behaviour as AutoIT window info has with selecting a window to make it active, and get the control coords in it, while the GUI I actually created remain on the foreground...

So I guess this is not possible using an AutoIT script :-/

Anyway Thanks for the hint :)

<{POST_SNAPBACK}>

as I say the GUI windows have to be created by GUICreate. Perhaps I was not so clear. I update the doc in this direction

THanks :evil:

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