windows_programming_notes.nbk: Home | Index | Next Page: SIZE | Previous Page: SHGetFolderPath


 ShowWindow

The ShowWindow function sets the specified window's show state.

Syntax

    BOOL ShowWindow(HWND hWnd, int nCmdShow);

Parameters

Return Value

If the window was previously visible, the return value is nonzero.

If the window was previously hidden, the return value is zero.

Remarks

To perform certain special effects when showing or hiding a window, use AnimateWindow.

The first time an application calls ShowWindow, it should use the WinMain function's nCmdShow parameter as its nCmdShow parameter. Subsequent calls to ShowWindow must use one of the values in the given list, instead of the one specified by the WinMain function's nCmdShow parameter.

As noted in the discussion of the nCmdShow parameter, the nCmdShow value is ignored in the first call to ShowWindow if the program that launched the application specifies startup information in the structure. In this case, ShowWindow uses the information specified in the STARTUPINFO structure to show the window. On subsequent calls, the application must call ShowWindow with nCmdShow set to SW_SHOWDEFAULT to use the startup information provided by the program that launched the application. This behavior is designed for the following situations:

Function Information


windows_programming_notes.nbk: Home | Index | Next Page: SIZE | Previous Page: SHGetFolderPath


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time