Window Operations * SCW.

<< Click to Display Table of Contents >>

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

Window Operations * SCW.

"i" - Flag "child-window ID"

Previous Top Next


MiniRobotLanguage (MRL)

 

"i"-Flag "child-window ID"

Search Child Window

 

 

Intention

 

The child-window ID is traditionally a internal number, that the programmer assigns a window control at design-time. Therefore it can be used to locate  a window in many cases. But be careful, not all child-windows ID's are really consistent.

 

You can see the window ID in the windows-Inspector.

 

graphic

 

In this case the button "Install" has a ID of 1012. Such an ID looks good and the chances are good that you can use it for the localization of the button. Therefore it must be permanent, means, that if you start the program many times, the ID must be always the same.

 

This is not always the case. Watch out if:

    the child-window ID is higher then 32000

    the child-window ID is zero or -1

    the child-window has a class name that starts with "t" like "tnewcheckmark" or "tnewlistbox".

 

In all these cases, the chances are that the id is not the same between multiple starts of the application, and therefore unusable  for a safe window localisation.

 

How do you localize a window using the ID?

 

' First get the Top-Window:

STW.t|testap

' then get the child-window

SCW.i|1012

' now you can click it!

MLC.

 

Normally there should not be multiple child-windows with the same ID in the same dialog. Therefore if you have a valid child-window ID, you do not need to specify a "c"-class or "t"-text to locate the window. The ID is enough.

Unless you want. A "t"- with text can improve readability of your script.

 

While it should not be needed, the "i" is a normal search flag and can be combined with all other search flags .

 

 

Short Examples:

 

-

 

 

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

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

 

Normally there should not be multiple child-windows with the same ID in the same dialog. Therefore if you have a valid child-window ID, you do not need to specify a "c"-class or "t"-text to locate the window. The ID is enough.

 

While it should not be needed, the "i" is a normal search flag and can be combined with all other search flags, including "c" or "t".

 

 

 

Limitations:

 

 

 

 

See also:

 

    1. STW. - Decription

    SCW - Search-Child-Window

    3.2 Standard-Search Pattern