Window Operations * SCW.

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Window Operations > SCW. - Search-Child-Window >

Window Operations * SCW.

"h" - Flag "handle"

Previous Top Next


MiniRobotLanguage (MRL)

 

"h"-Flag "handle"

Search Child Window

 

 

Intention

 

This flag is an exception. In fact it must not search the window, it will just localize the window "by handle". Of course this is a very efficient solution. Therefore if you have already localized your child-window before, keep the handle. You can keep the handle for example in a variable. Or on the stack.And then just feed it back to SCW. when you need that window again, using the "h"-flag.

As the "h"-flag does not search anything but immediately localizes the window, you should not combine it with other search flags, like "p","c","t" or these. It will just take priority and ignore these. You can combine the "h"-flag with the flags like "o","g",V" and "W". For example:

 

SCW.hg|123|notfound

 

Is completely Ok.

 

When using the "h"-flag with a valid child-window handle, there is no need to first use STW. to get a Top-Window. You can immediately locate a child-window. If you then need the Top-Window from that child window, you can use the GCT.-command.

 

 

' Localize by handle

STW.t|TestApp

' We grab the handle in a variable

SCW.t|button 1

HTV.$$MYC

 

' Later we can always get definitely this window,

' without further parameters

' No need to first localize a Top-Window!

SCW.h|$$MYC

MMV.

'

' Work with another window

STW.h|52367

MMV.

 

' jump immediately back to this child-window without

' the need to localize a Top-window first.

SCW.h|$$MYC

MMV.

 

ENR.

 

 

Short Examples:

 

STW.ct|PBWindowClass:0|BCS - Testform

SCW.nct|1|Button|Install

HTV.$$MYC

 

SCW.t|invisi

MMV.

 

SCW.hg|123|notfound

ENR.

 

:notfound

MBX.Notfound!

ENR.

 

 

Example

 

'**********************************************

' SCW-Sample

'**********************************************

' 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

' Keep the child-window handle in $$MYC

: $$MYC=#hwn#

 

' Get the Top-Window

GCT.

' Press another button

SCW.to|button 2|ero

MLE.

 

' Immediately locate the button via "h" again and press it.

SCW.h|$$MYC|ero

MLE.

 

ENR.

 

:ero

MBX.Window not found!

ENR.

 

 

 

Remarks

 

Locating child-windows using the "H"-Flag is not a windows-search, but a direct localization.

 

 

Limitations:

 

 

 

 

See also:

 

    1. STW. - Decription

    SCW - Search-Child-Window

    3.2 Standard-Search Pattern