WinStatus (Function) In french: FenEtat Identifies or modifies the window status. Remark: WinStatus can also be used to check the existence of a window.
// Identify the status of current window ResWinStatus = WinStatus()
// Modify the state of a window SWITCH WinStatus(WIN_WindowName) CASE Active WinStatus(WIN_WindowName, Grayed) CASE NotFound Open(WIN_WindowName) END
Syntax
Identifying the window status Hide the details
<Result> = WinStatus([<Window used>])
<Result>: Constant Current status of window: | | Active | Active window (window in edit, even if it does not have the focus). | DisplayOnly | Inactive window (this window is not in edit). | Grayed | The window controls are grayed. | Invisible | Window invisible on the screen and inactive. | NotFound | Window closed or not found. | OutsideScreen | Active window displayed outside the visible screen area. |
<Window used>: Optional window name or optional string Name or alias of the window to be used. If this parameter is not specified or if it corresponds to an empty string (""), the status of current window is returned.
Modifying the window status Hide the details
<Result> = WinStatus(<Window used> , <Window status>)
<Result>: Constant Status after modification: | | Active | Active window (window in edit). | DisplayOnly | Inactive window (this window is not in edit). | Grayed | The window controls are grayed. | Invisible | Window invisible on the screen and inactive. | NotFound | Window closed or not found. | OutsideScreen | Active window displayed outside the visible screen area. |
<Window used>: Window name or string Name or alias of the window to be used. If this parameter corresponds to an empty string (""), the status of the current window is modified. <Window status>: Constant Specifies the new status and new positioning of the specified window. If this parameter corresponds to an empty string (""), the change of position (Above, AboveAll, Normal constant) for a window is canceled. | | Above | The window moves to the foreground in relation to the other application windows. | AboveAll | The window moves to the foreground in relation to all other windows, even to the ones of the other applications. This constant is ignored for the MDI child windows displayed from a MDI parent window.
| Active | The window becomes active (window in edit). | DisplayOnly | The window becomes inactive (no input is allowed in the window controls). | Grayed | The window controls are grayed. | Invisible | The window becomes invisible and inactive. | Normal | A window in AboveAll mode switches to the normal mode (the windows of other applications can be displayed in the foreground). In the other cases, this constant has no effect. | NotFound | The window is closed. A WLanguage error occurs if this window does not exist. | OutsideScreen | The window remains active but is positioned outside the visible screen area. | TopActive | The window becomes active (window in edit) and it is displayed in the foreground. This constant corresponds to the result of a click performed in the title bar of window. |
Remarks Modal opening/Non-modal opening In modal opening (MDI parent window and MDI child window), WinStatus cannot be used: - to make a parent window active.
- to display a child window "above" with the Above or AboveAll constant from an MDI parent window.
In modal opening, if a parent window is made invisible, the child window is also made invisible. In non-modal opening, if a parent window with at least one child window is made invisible, the child windows are not made invisible. Differences between the Invisible and OutsideScreen constants - If the type of a parent window is:
- OutsideScreen, this window is displayed in the list of Windows applications (accessible via Alt Tab).
- Invisible, this window is not displayed in the list of Windows applications (accessible via Alt + Tab).
- The coordinates of an OutsideScreen window are negative.
- Switching from:
- Invisible to Active triggers the execution of processes for focus gain and focus loss in an incoherent way.
- OutsideScreen to Active triggers the proper execution of processes for focus gain and focus loss.
Tip: You should use the OutsideScreen status rather than the Invisible status. - If an OutsideScreen window is redisplayed by WinStatus with the Active constant, WinStatus does not set the focus to the window.
- If the OutsideScreen window did not have focus, it does not have focus after the call to WinStatus.
Inactive or invisible window If the current window becomes inactive or invisible, the "loss of focus" process of the window will be run before the change of status. Closing the window The following code is used to close the window:
WinStatus(<Window name>, NotFound)
This code is equivalent to Close.
This page is also available for…
|
|
|
|