WinRestore (statement)

Syntax

WinRestore [window_name$ | window_object]

Description

Restores the specified window to its restore state.

Comments

Restoring a minimized window restores that window to its screen position before it was minimized. Restoring a maximized window resizes the window to its size previous to maximizing.

The WinRestore statement requires the following parameters:

 

Parameter

Description

 

window_name$

String containing the name that appears on the desired application's title bar. Optionally, a partial name can be used, such as "Word" for "Microsoft Word."

A hierarchy of windows can be specified by separating each window name with a vertical bar (|), as in the following example:

  WinActivate "Notepad|Find"

In this example, the top-level windows are searched for a window whose title contains the word "Notepad". If found, the windows owned by the top level window are searched for one whose title contains the string "Find".

 

window_object

HWND object specifying the exact window to activate. This can be used in place of the window_name$ parameter to indicate a specific window to activate.

 

If window_name$ and window_object are omitted, then the window with the focus is restored.

This command differs from the AppRestore command in that this command operates on the current window rather than the current top-level window.

Example

This example minimizes all top-level windows except for Program Manager.

Sub Main()

  Dim a() As HWND

  WinList a

  For i = 0 To UBound(a)

    WinMinimize a(i)

  Next I

  WinRestore "Program Manager"

End Sub

See Also

WinMaximize (statement); WinMinimize (statement)

Note

Under Windows, the current window can be an MDI child window, a pop-up window, or a top-level window.

More information

W