CreateWindow (your_wind_id [, mode [, properties]])

Result Type:  a windowRef

Definition:  Instantiates a modeless window using the UI form with identifier your_wind_id (i.e. the name you gave the form in the script editor). The window will have a close box to close it.

The return value of CreateWindow will be a window handle. You can use this to do further setup of controls in the window, and/or you can write a Before handler named Before:your_wind_id(windowRef) in which you can set up the state of the window's controls.

If you pass fWindowMode_Floating for the optional mode parameter, the window will be a floating window (it will stay above all other windows; you can use this for a tool palette).

Windows automatically remember their last size and location (this information is written into a file named script_id.properties. You can set the values of the properties your_wind_id_left, your_wind_id_top, your_wind_id_right, and your_wind_id_bottom before instantiating the window to override the size and location.

In v9 and later, you can provide an optional properties associative array which will be used to initialise the properties of the window (that you would otherwise set and get with SetWindowProperty and GetWindowProperty. This removes the need to use global properties to pass parameters to window handlers. Note that to provide properties this way you must also provide a modes parameter (use 0 if you don't need special modes).

Availability:  available within MWScript handlers.

See Also:

ModalJobsheetEntryWindow: Run a modal Jobsheet entry modify/create window

ModalListWindow: Instantiate a modal custom database table list window

ModalTransactionWindow: Run a modal transaction modify/create window

ModalWindow: Instantiate a modal custom window