WarheadsOnForeheads Posted March 21, 2013 Share Posted March 21, 2013 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 More sharing options...
jdelaney Posted March 21, 2013 Share Posted March 21, 2013 (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 handleoh, $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 0x0000000Oh, and this require the winapi install...do a forum search for it, or someone may post a link Edited March 21, 2013 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 More sharing options...
WarheadsOnForeheads Posted March 21, 2013 Author Share Posted March 21, 2013 Awesome. Thank you. Giving it a try now. Link to comment Share on other sites More sharing options...
jdelaney Posted March 21, 2013 Share Posted March 21, 2013 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now