<< Click to Display Table of Contents >> Navigation: 3. Script Language > Window Operations > STW. - Search Top Window > Window Operations * STW. |
MiniRobotLanguage (MRL)
"v" - Flag "visible"
Search Top Window
Intention
To ignore invisible windows is one of the default settings of the STW. command. Therefore you will not need to specify the "v"-Flag often.
It can however make sense, to override the default behavior by using the "u"-flag which will make STW. to visible windows and just look for invisible windows.
If you want to catch both, the "a"-flag is what you need.
However the "a"->Flag will automatically also switch on the search for disabled windows. If you do not want that, just add a prototype "e" after the "a". As the prototype on the right has a higher priority, you get exactly what you want this way.
In the same way, you can use the "v" - flag together with the "a" to search only windows that are visible. No matter if they are enabled or not.
Lets take a look, on how to do this. This will search only for visible windows.
STW.cv|WindowClass
MMV.
Since this is a default behavior of STW., we have wasted the "v" at this place. Its not needed.
Now we would like to search for windows which are visible, as well for invisibble windows. We can do that in two ways.The first way is like this:
STW.cuv|WindowClass
MMV.
The robot understands that we want visible and invisible windows. If we just give all two prototypes. But there is another way to do it. We can do this:
STW.cae|WindowClass
MMV.
The "a" Flag says "search all windows", enabled, disabled, visible and invisible. Now we just need to tell the robot that we do not want to get the disabled windows. We do this by adding the "e"-Flag after the "a". In this case the "e"-Flag will override the "a"-Flag. And tell the robot "we just want visible windows.".
Example
CAW.PBWindowClass:0|BCS - Testform
'
' Start an Application only,
' if that Application is not yet running.
'
STW.wtUX|0|BCS - Testform|found
EXE.?exepfad\Sample Apps\BSC-Testform.exe
:found
STW.p|#pid#
' Next we make the window invisible
SWS.i
' Wait half of a second
PAU.2.5
' We locate it even though its invisible
STW.wtu|1|BCS - Testform
' and make it visible again
SWS.v
ENR.
Remarks
Limitations:
See also:
• 1.8. Selecting the Application (Topwindow)