Jump to content

Detecting any displayed differences on screen?


Recommended Posts

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!

Link to comment
Share on other sites

_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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...