DIALOG SHOW STATE statement

Purpose

Change the visible state of a dialog.

Syntax

DIALOG SHOW STATE hDlg, showstate& [TO lResult&]

Remarks

DIALOG SHOW STATE changes the visible state of the dialog identified by hDlg.

showstate& can be one of the following values:

%SW_HIDE 

Hide the dialog.

%SW_MAXIMIZE

Maximize the specified dialog.

%SW_MINIMIZE

Minimize the specified dialog.

%SW_RESTORE

Activate and display the dialog. If the dialog is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized dialog.

%SW_SHOW

Activate the dialog and displays it in its current size and position.

%SW_SHOWMAXIMIZED

Synonym of %SW_MAXIMIZE.

%SW_SHOWMINIMIZED

Activate the dialog and minimize it.

%SW_SHOWNA

Display the dialog in its current state without activating it. The currently active window remains active.

%SW_SHOWNOACTIVATE

Display the dialog in its most recent size and position without activating it. The currently active window remains active.

%SW_SHOWNORMAL

Activate and display the dialog. If the dialog is minimized or maximized, Windows restores it to its original size and position.

If the optional lResult& parameter is used, it will contain the previous visibility state. If lResult& is set to TRUE (non-zero), the dialog was visible. If the dialog was previously hidden, lResult& is set to FALSE (zero).

Restrictions

In previous versions of PowerBASIC, the DIALOG SHOW STATE was not permitted to be executed before a DIALOG SHOW MODAL or DIALOG SHOW MODELESS statement had been executed for that specific dialog. Starting with this version of PowerBASIC, DIALOG SHOW STATE may be executed before or after the dialog is activated with DIALOG SHOW MODAL or DIALOG SHOW MODELESS statement.

When utilized prior to dialog activation, the attributes %SW_HIDE, %SW_MAXIMIZE, and %SW_MINIMIZE are remembered for use when activated. All other possible attributes are translated to the standard %SW_SHOW. Generally speaking, it is unwise to use %SW_HIDE with a modal dialog.

DIALOG SHOW STATE can be used to show a dialog before the message pump for a modeless dialog begins operating (i.e., after the DIALOG SHOW MODELESS statement, etc). However, until the message pump begins its operation, the dialog may not be drawn or displayed completely.

For more information on message pumps, see DIALOG DOEVENTS and DIALOG SHOW MODELESS.

See also

Dynamic Dialog Tools, CONTROL SHOW STATE, DIALOG DOEVENTS, DIALOG SHOW MODAL, DIALOG SHOW MODELESS