ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Window functions
  • Modal opening/Non-modal opening
  • Differences between the Invisible and OutsideScreen constants
  • Inactive or invisible window
  • Closing the window
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Identifies or modifies the window status.
Remark: WinStatus can also be used to check the existence of a window.
Example
// 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:
ActiveActive window (window in edit, even if it does not have the focus).
DisplayOnlyInactive window (this window is not in edit).
GrayedThe window controls are grayed.
InvisibleWindow invisible on the screen and inactive.
NotFoundWindow closed or not found.
OutsideScreenActive window displayed outside the visible screen area.
Universal Windows 10 AppAndroidiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
<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:
ActiveActive window (window in edit).
DisplayOnlyInactive window (this window is not in edit).
GrayedThe window controls are grayed.
InvisibleWindow invisible on the screen and inactive.
AndroidiPhone/iPadIOS WidgetApple WatchMac Catalyst No window can be made invisible.
NotFoundWindow closed or not found.
OutsideScreenActive window displayed outside the visible screen area.
Universal Windows 10 AppAndroidiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
<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.
AboveThe window moves to the foreground in relation to the other application windows.
Universal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
AboveAllThe 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.

LinuxUniversal Windows 10 AppAndroidiPhone/iPadIOS WidgetMac CatalystJava This constant is not available.
ActiveThe window becomes active (window in edit).
DisplayOnlyThe window becomes inactive (no input is allowed in the window controls).
GrayedThe window controls are grayed.
InvisibleThe window becomes invisible and inactive.
AndroidiPhone/iPadIOS WidgetApple WatchMac Catalyst No window can be made invisible.
NormalA 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.
Universal Windows 10 App This constant is not available.
NotFoundThe window is closed. A WLanguage error occurs if this window does not exist.
OutsideScreenThe window remains active but is positioned outside the visible screen area.
Universal Windows 10 App This constant is not available.
TopActiveThe 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.
Universal Windows 10 AppiPhone/iPadIOS WidgetApple WatchMac Catalyst This constant is not available.
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.
AndroidiPhone/iPadIOS WidgetApple WatchMac Catalyst No window can be made invisible.

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.
AndroidiPhone/iPadIOS WidgetApple WatchMac Catalyst No window can be made invisible.

Closing the window

The following code is used to close the window:
WinStatus(<Window name>, NotFound)
This code is equivalent to Close.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo WinStatus/OpenChild/SetFocus|
Exemplo WinStatus/OpenChild/SetFocus|

IF WinStatus(WIN_tela_exemplo)=NotFound THEN
OpenChild(WIN_tela_exemplo)
ELSE
Restore(WIN_tela_exemplo)
SetFocus(WIN_tela_exemplo)
END

// Blog com Video e exemplo

http://windevdesenvolvimento.blogspot.com.br/2016/11/aula-977-windev-window-janela-6.html

https://www.youtube.com/watch?v=gofWLY8rEAI

De matos
04 Dec. 2016

Last update: 05/26/2022

Send a report | Local help