when i execute my script, I'm trying to minimize all windows that may be open so that they don't interfere with the running of my script.
Does anybody have a function/sub that when called will enumerate all currently opened or maximized windows and minimize all windows on the desktop?
I was able to create this using some Win API's in Visual Test but I'm having trouble recreating this function in Robot.
thanks in advance
Don't really know if it will work, but for me looks like the only way to it is to try to get all currently opened windows with SQAGetChildren function - these windows being children of desktop, as far as I can guess. Then you're scanning through this list of children searching for windows, then - just minimize found windows using
Window WMinimize, "", ""
The problem here is to define whom these windows belong, i.e. whose children they are. Once you do it - I can share a piece of code which reads all children of some object (HTML window) and scrolls through all found children objects (for me - objects on Web page), searching for objects of certain types and with certain properties. Just let me know if you need this.
Robot can use window names when you are recording. This may eliminate the problem that you may have when other windows are open. Go to Tools-> GUI Record Options and in the generals tab select Contents and Text. As a general rule robot looks for applications that have been recorded when playing back. If the application you are working with opens multiple windows then I would recommend you set up your tests to playback from a neutral point. This way you ensure that the test you are running starts and ends at the same point.