I created a script that can run on multiple windows and forms, and use the data driven input to control the form entry. Currently I have the config info for the window being tested specified in the ddi file, but wondered if it was possible to ask a user to "click the window you want to test" and then return the window that was clicked as the window under test.
Popup a dialog box that tells the user to click on the window that they want to test to bring it to the foreground, then click OK in the dialog box. - This may be a little confusing if the window they click then covers the dialog box they need to OK.
Then, in code after the OK click, use the Window Set Context method and use the CurrentWindow parameter to set context to the current window.
From there get the window recognition string to use (maybe popup another dialog box with the recstring in it to confirm with the user it is the right one).
- Or -
From a dialog box tell the user to minimize all windows EXCEPT the one they want to use, then click OK.
From there, follow the same last two procedures above.
- One more thought -
Use a For loop to get the recstrings and title of each window available. Then popup a dialog box that has a radiobutton or droplist of the choices to the user. The user can then pick the one they want in the list and click OK.
Just a couple of ideas that may get you going in the right direction.
I thought about that last idea too, but was a off put by the way Inspector brings back info on every single process, even the hidden memory resident processes. I don't want them to have a ridiculous list to have to choose from.
Tho I suppose I could filter out only the ones that have a "Window Caption=" title. I'll have to see how it implements.