<< Click to Display Table of Contents >> Navigation: 3. Script Language > Window Operations > SCW. - Search-Child-Window > Window Operations * SCW. |
MiniRobotLanguage (MRL)
"a" - Flag "all child-windows"
Search Child Window
Intention
In most cases, we want to act on visible and enabled child-window (buttons, controls ...) only. Therefore the SCW. command ignores by default child-windows, if they are disabled or invisible.
The "a" flag changes this behavior. Using the "a"-Flag, the SCW. command will locate "all child-windows". This includes child-windows which are invisible or disabled, or both.
Using the Flag "a" all child-windows will be found if they meet the search criteria.
Example
'**********************************************
' SCW-Sample 1
'**********************************************
DBM.1
' Start TestApp only, if it's is not yet running.
'
STW.wtUXg|0|TestApp|found
EXE.?exepfad\Sample Apps\TestApp_01.exe
:found
STW.Act|PBWindowClass:0|TestApp
SCW.ct|Button|Button 1
HTV.$$MYC
' Make button invisible
SWS.i
' Show handle of the childwindow
DBP.$$MYC
' Locate Topwindow again with previous parameters
GCT.
' Locate Button even though its invisible
SCW.wcta|0|Button|Button 1
FOR.$$CNT|1|10
' Press that button 10 times using direct engine
MLE.
NEX.
PAU..5
' Make the button visible again
SCW.h
SWS.v
ENR.
'**********************************************
' SCW-Sample 2
'**********************************************
' Start TestApp only, if it's is not yet running.
'
STW.wtUXg|0|TestApp|found
EXE.?exepfad\Sample Apps\TestApp_01.exe
:found
STW.t|testapp
SCW.to|button 1|ero
SWS.i
GCT.
SCW.tuo|button 1|ero
SWS.vd
GCT.
SCW.tfo|button 1|ero
SWS.id
GCT.
SCW.tufo|button 1|ero
SWS.
ENR.
:ero
MBX.Window not found!
ENR.
Remarks
If you definitely know that the child-window is invisible, you can use the "u"-Flag. which will only search for invisible child- windows and ignore visible child-windows.
The same applies for disabled windows, and the "f"-Flag.
Limitations:
See also: