Sign in to follow this  
Followers 0
WarheadsOnForeheads

Detecting any displayed differences on screen?

4 posts in this topic

I have a script that successfully runs through a CSV list and adds some records into an old legacy application. Periodically, the application will put up any one of several dialog windows that could say any number of things, (record not found, record already exists, etc.). It is at this point I want to stop the script from executing any further sendkey commands.

The dialog windows are all within the application itself and I can't seem to be able to detect through normal means of iterating through all applications or windows.

I was thinking I could use a reference screenshot and "subtract" that screenshot from a screen shot taken at the end of every record operation. If there was significant difference in result (byte count), there is probably some prompt on the screen or the result is something other than expected and I know to halt the script. But, how to do this?

Does anybody know of something like a image difference engine I could use in this case? Or, if you know of a previous post related to this same objective that I some how missed while searching, please let me know.

Thanks!

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

_WinAPI_GetWindow($yourwindow, $GW_ENABLEDPOPUP)

This will get you any popup, use wingettext/wingettitle to see which window it is.

'yourwindow' is the parent application's handle

oh, $GW_ENABLEDPOPUP = 6, which is not defined in the constants.au3, so you need to define it...and if there is no enabled popup at the moment, it returns 0x0000000

Oh, and this require the winapi install...do a forum search for it, or someone may post a link

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Awesome. Thank you. Giving it a try now.

Share this post


Link to post
Share on other sites

Oh, and probably 99% of the time, pixel searching is not the way to go, and people might skip your posts (assumed game automation :) )


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

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