Window Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Window Operations >

Window Operations

SWS. - Set Window State

Previous Top Next


MiniRobotLanguage (MRL)

 

SWS. Command

Set Window State

 

 

Intention

 

Make a window invisible. Or enable or disable a button.

Minimze a window, or restore it, if it was minimized or maximized before.

 

These and more such things can be done using SWS.

 

SWS. changes the State of the actual Top- or Child-window. If you give multiple prototypes they will apply in the order from left to right.

 

Example:

SWS.evna

 

Example, this will make a localized window invisible:

SWS.i

 

Example, this will make a localized window visible again:

SWS.v

 

Normally all of the SWS. Options can be changed back to their originasl state. Unlike c and x. These are two special Options that can remove the Window-Caption or give a Window a Caption. However these two Options should be used with care, as they can damage a running application-window in a way that you may need to restart the application.

Therefore test first if you can use them in your special case,.

 

SWS.x

 

graphic

 

This is how a window may look after you have removed the Caption using SWS.x.

This may not work with any window. Its for those cases, where you do not want the User to be able to move windows on the desktop around. Also there is no close Gadget anymore.

 

 

SWS.c

 

graphic

 

Here the Caption is back, using SWS.c

Note that the window can not be totaly restored like it was before.

While there is a caption, the window may still have a different behavior when being resized.

Here is the window as it looked before.

As you can see it looks a bit different.

 

graphic

 

 

 

Syntax

 

 

SWS.[P1][|P2]

 

 

Parameter Explanation

 

P1   - Prototype(s)

 

' a - activates the window after setting the state.

' e - enabled

' d - disabled

' v - visible

' i - invisble

' m - minimzed

' n - normal (not minimized)

' z - zoomed (maximized)

' u - unzoomed

' t - use actual Top-Window instead of actual window

' c - add Caption to Window (c<>x)

' x - remove caption from Window (c<>x)

 

Multiple states can be given. In that case they are connected with AND.

 

If no parameters are specified, "evn" is the default parameter.

 

P2 - (NUM/VAR) optional parameters, window-handle. When given, this window is used instead of the actual localized window.

 

 

 

 

 

Example

 

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

' SWS.-Sample 1

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

STW.t|Sample

MMV.

SWS.evna

 

STW.t|Sample

HTV.$$HWN

 

STW.t|anotherwindows

MMV.

' Note that the first window is going to be tested.

SWS.eva|$$HWN

END.

 

 

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

' SWS.-Sample 2

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

 

'#EXE:?pfad\

'#SPI:ForceWrite

'

' Start an Application only, if that Application is not yet running.

'

STW.wtgX|0|BCS - Testform|found

EXE.?exepfad\Sample Apps\BSC-Testform.exe

:found

STW.wt|0|BCS - Testform

' Nextwe make the thing invisible

SWS.i

' Wait 5 seconds

PAU.5

' Locate it using "all"

STW.wta|0|BCS - Testform

' Locate the Button using "all"

SCW.anctb|1|Button|Next|0

 

' Click the button, while its invisible!

MLE.

' Get the Top-Handle

GCT.

' Make it visible again

SWS.

ENR.

 

 

 

 

Remarks

 

You can disable buttons, immediately after they appear using the SWS.d -command. This way you can prevent the user from clicking buttons, he should not click.

 

You can check (child-)window-states with IWS. / NWS. - If Window State.

 

 

Limitations:

 

-

 

 

 

See also:

 

    IWS. / NWS. - If Window State

    IWE. / NWE. - If Window Enabled

    IWI. / NWI. - If Window Iconized

    IWV. / NWV. - If Window Visible

    IWZ. / NWZ. - If Window Zoomed