ShowWindow

2.x

  BOOL ShowWindow(hwnd, nCmdShow)    
  HWND hwnd; /* handle of window, */  
  int nCmdShow; /* window visibility flag */

The ShowWindow function sets the given window's visibility state.

Parameters

hwnd

Identifies the window.

nCmdShow

Specifies how the window is to be shown. This parameter can be one of the following values:

Value Meaning

SW_HIDE Hides the window and passes activation to another window.
SW_MINIMIZE Minimizes the specified window and activates the top-level window in the system's list.
SW_RESTORE Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position (same as SW_SHOWNORMAL).
SW_SHOW Activates a window and displays it in its current size and position.
SW_SHOWMAXIMIZED Activates a window and displays it as a maximized window.
SW_SHOWMINIMIZED Activates a window and displays it as an icon.
SW_SHOWMINNOACTIVE Displays a window as an icon. The window that is currently active remains active.
SW_SHOWNA Displays a window in its current state. The window that is currently active remains active.
SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The window that is currently active remains active.
SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position (same as SW_RESTORE).

Return Value

The return value is nonzero if the window was previously visible. It is zero if the window was previously hidden.

Comments

The ShowWindow function must be called only once per application using the nCmdShow parameter from the WinMain function. Subsequent calls to ShowWindow must use one of the values listed in the preceding list, instead of the one specified by the nCmdShow parameter from WinMain.

See Also

IsWindowVisible, ShowOwnedPopups