ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
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
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Identifies or modifies the window status.
Note The function WinStatus function can also be used to test the existence of a window.
Example
// Identification de l'état de la fenêtre en cours
ResFenEtat = WinStatus()
// Modification de l'état d'une fenêtre
SWITCH WinStatus(FEN_NomFenêtre)
	CASE Active
		WinStatus(FEN_NomFenêtre, Grayed)
	CASE NotFound
		Open(FEN_NomFenêtre)
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 editable).
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.
AndroidiPhone/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 is 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 (editable window).
DisplayOnlyInactive window (this window is not editable).
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.
AndroidiPhone/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.
iPhone/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 an MDI parent window.

LinuxAndroidiPhone/iPadIOS WidgetMac CatalystJava This constant is not available.
ActiveThe window becomes active (editable window).
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.
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.
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.
iPhone/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 Prefer the OffScreen state to the Invisible.
  • 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: wd300obj.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: 03/28/2025

Send a report | Local help