ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Window functions
  • Parameters passed to the window to open
  • Window opening mode
  • Position of parent window
  • Opening the same window several times
  • Limitation
  • Closing a window
  • Title of the window to be opened
  • Opening the window of a component
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Opens a non-modal child window.
The following events are run when OpenChild is called:
  • "Global declarations" event of the child window,
  • "Initialization" events of controls in the child window (in any order),
  • events after the call to OpenChild in the code of the parent window,
  • the child window is displayed.
Remarks:
  • By default, the child window retains focus once it is opened.
  • OpenChild can also be used to define the position and pass parameters to the child window.
    • In standard syntax, these parameters are passed directly.
    • New in SaaS
      When you use a variable of type to open a window, you can use the property to define the characteristics of the window, and the property to pass parameters.
      Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 4.
      For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
WEBDEV - Server codeWindowsLinux This function is available only to simplify the Webification of WINDEV projects. In a WEBDEV website, this function has the same behavior as PageDisplay.
// Open the child window named "WIN_EditWindow"
// without positioning and without passing parameters
OpenChild(WIN_EditWindow)
// Open the child window named "WIN_EditWindow".
// The value of the "EDT_EditCustomer" control is passed as parameter to the event 
// "Global declarations" of "WIN_EditWindow".
OpenChild(WIN_EditWindow, EDT_EditCustomer)
// -- Event "Global declarations" of "WIN_EditWindow"
// Retrieve the parameters
PROCEDURE WIN_EditWindow(Customer)
HReadSeek(Customer, CustomerName, Customer)
IF HFound() = True THEN
	FileToScreen()
ELSE
	Error("No customer matches")
END
Syntax

Opening a child window (standard syntax) Hide the details

OpenChild(<Window> [, <Parameter 1> [... [, <Parameter N>]]])
<Window>: String or window name
  • Name of child window to open.
  • Name and full path of child window (".WDW" file) to open.
    AndroidJava You cannot specify the full name of the file to open (".WDW" file).
WINDEV To avoid giving focus to the opened window, use the following notation: <Window name> + NoFocus. The focus gain process of the child window will not be run. Caution: in this case, the window name must be enclosed in quotes.
<Parameter 1>: Type of value sent to the window (optional)
First parameter to be passed to the "Global declarations" event of the window to open. This parameter is passed by value and is considered a variable global to the window.
This parameter cannot be a variable of type array (arrays can only be passed by reference).
<Parameter N>: Type of value sent to the window (optional)
Nth parameter to be passed to the "Global declarations" event of the window to open. This parameter is passed by value and is considered a variable global to the window.
This parameter cannot be a variable of type array (arrays can only be passed by reference).

Opening a child window by defining its position and level (standard syntax) Hide the details

OpenChild(<Window name [ + <Level>]> [, <Parameter 1> [... [, <Parameter N>]]])
<Window name [ + <Level>]>: String + Integer constant
Used to specify:
  • the window to open (<Window name>). This parameter can correspond to:
    • Name of child window to open.
    • Name and full path of child window (".WDW" file) to open.
      AndroidJava You cannot specify the full name of the file to open (".WDW" file).
    By default, the window is displayed according to the position defined in the editor. You can define the display position of the window. The window name is completed by the window display coordinates when opened. This parameter has the following format:
    "[<Alias>] = <Window Name> [, <Y>, <X>]"

    where:
    • <Alias>: Window alias if the same window is opened several times.
    • <Window name>: Name of the child window to be opened.
      WINDEV To avoid giving focus to the opened window, use the following notation: <Window name> + NoFocus. The event "Gain of focus" of the child window will not be run. Caution: in this case, the window name must be enclosed in quotes.
    • <Y>: Y-coordinate of the window (in pixels), relative to the upper-left corner of the screen or parent window.
    • <X>: X-coordinate of the window (in pixels), relative to the upper-left corner of the screen or parent window.
    Note: The coordinates are ignored if the window is defined as centered in the editor. It is recommended to use WinSize to change the position of a window.
  • the window display level (<Level>):
    AboveWindow opened above all its sibling windows.
    AboveAllWindow opened above all the other windows (including the windows of other applications).
    AndroidJava Constant not available.

    If one of these constants is used, the name of the window must be enclosed in quotes.
    Note: If two windows are opened with the same constant (Above or AboveAll), the second window will be opened above the first one.
    It is recommended to use WinStatus to change the display level of a window.
<Parameter 1>: Type of value sent to the window (optional)
First parameter to be passed to the "Global declarations" event of the window to open. This parameter is passed by value and is considered a variable global to the window.
This parameter cannot be a variable of type array (arrays can only be passed by reference).
<Parameter N>: Type of value sent to the window (optional)
Nth parameter to be passed to the "Global declarations" event of the window to open. This parameter is passed by value and is considered a variable global to the window.
This parameter cannot be a variable of type array (arrays can only be passed by reference).
New in SaaS
Java This syntax is only available for Java applications

Opening a child window (with a Window variable) Hide the details

OpenChild(<Window to open> [, <Parameter 1> [... [, <Parameter N>]]])
<Window to open>: Window variable
Name of the Window variable corresponding to the window to be opened.
  • The window opening options must have been defined using the OpeningOptions property.
  • The value of the parameters expected by the window must have been defined using the OpeningParameters property.
<Parameter 1>: Type of value sent to the window (optional)
First parameter to be passed to the "Global declarations" event of the window to open. This parameter is passed by value and is considered a variable global to the window.
This parameter cannot be a variable of type array (arrays can only be passed by reference).
Note: Parameter values can also be defined using the OpeningParameters property, which can be used in conjunction with a variable of type Window.
<Parameter N>: Type of value sent to the window (optional)
Nth parameter to be passed to the "Global declarations" event of the window to open. This parameter is passed by value and is considered a variable global to the window.
This parameter cannot be a variable of type array (arrays can only be passed by reference).
Note: Parameter values can also be defined using the OpeningParameters property, which can be used in conjunction with a variable of type Window.
Note: This feature is only available from WINDEV Suite SaaS 2025 - Update 4.
For more details, see Using new features exclusive to WINDEV Suite SaaS 2025.
Remarks

Parameters passed to the window to open

The parameters are retrieved in the "Global declarations" event associated with the window. The first line of code of this event must correspond to the following line:
PROCEDURE <Window> (<Parameter 1> [, ... [, <Parameter N>]])
where:
  • <Window > must correspond to the name of the window.
  • <Parameter N> must correspond to the parameters expected. Note: These parameters are passed by value, not by reference.
For more details, see Window with parameters.

Window opening mode

The window is opened in non-modal mode:
  • the child window becomes the current window.
  • once the child window is opened, the processes following the call to OpenChild in the parent window are run.
  • the user will have the ability to click one of the parent windows of opened window.
    AndroidiPhone/iPadApple Watch The controls found in the parent windows cannot be accessed by the user as long as a child window is opened.
WINDEV Note: OpenChild gives focus to the child window. The code for gaining focus is run in the child window and the code for losing focus is run in the parent window. In order for the parent window to keep focus, use the NoFocus constant in the <Window name> parameter.
To manage MDI, use MDIOpen.

Position of parent window

The parent window always remains below the child window, even if the parent window is in edit.
If this situation is not suitable, the child window must be opened by OpenSister (providing that the parent window is a non-modal window).
WINDEVReports and QueriesUser code (UMC)

Opening the same window several times

  • If the same window is opened several time, we recommend that you use an alias. This alias is used to differentiate between each window.
  • The position of the calling window (relative to the screen or to the parent window) is chosen when the window is described in the editor. If the same window is opened several times (with an alias), the display positions must be modified at each opening (otherwise the windows will be stacked).
  • The number of windows that can be opened simultaneously depends on the available memory.

Limitation

OpenChild must not be called in the project initialization code.
WINDEV To display a "splash screen" window at the start of the application, use the "Splash screen" option when creating the executable.

Closing a window

A window opened with OpenChild can be closed with Close (without parameters) from any event:
  • of the window,
  • of a window control.
If a parent window is closed, its child windows are also closed.

Title of the window to be opened

By default, the window title is the one defined in the editor (in the "General" tab of the description window).
To change the window title:

Opening the window of a component

To open the window of a component, simply use the name of the component window (component included in the project). For example:
OpenChild(ComponentWindow)
If a conflict occurs with a project element, the element name must be prefixed by the component name. For example:
OpenChild(MyComponent.Window)
To use the name of the window in a variable, the name of the component must be specified. For example:
sWindow is string ="MyComponent.MyWindow"
OpenChild(sWindow)
Business / UI classification: UI Code
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/23/2025

Send a report | Local help