1 out of 1 rated this helpful Rate this topic

WM_SHOWWINDOW message

Sent to a window when the window is about to be hidden or shown.

A window receives this message through its WindowProc function.

#define WM_SHOWWINDOW                   0x0018

Parameters

wParam

Indicates whether a window is being shown. If wParam is TRUE, the window is being shown. If wParam is FALSE, the window is being hidden.

lParam

The status of the window being shown. If lParam is zero, the message was sent because of a call to the ShowWindow function; otherwise, lParam is one of the following values.

ValueMeaning
SW_OTHERUNZOOM
4

The window is being uncovered because a maximize window was restored or minimized.

SW_OTHERZOOM
2

The window is being covered by another window that has been maximized.

SW_PARENTCLOSING
1

The window's owner window is being minimized.

SW_PARENTOPENING
3

The window's owner window is being restored.

 

Return value

If an application processes this message, it should return zero.

Remarks

The DefWindowProc function hides or shows the window, as specified by the message. If a window has the WS_VISIBLE style when it is created, the window receives this message after it is created, but before it is displayed. A window also receives this message when its visibility state is changed by the ShowWindow or ShowOwnedPopups function.

The WM_SHOWWINDOW message is not sent under the following circumstances:

  • When a top-level, overlapped window is created with the WS_MAXIMIZE or WS_MINIMIZE style.
  • When the SW_SHOWNORMAL flag is specified in the call to the ShowWindow function.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
DefWindowProc
ShowOwnedPopups
ShowWindow
Conceptual
Windows

 

 

Send comments about this topic to Microsoft

Build date: 9/11/2011

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Use WM_WINDOWPOSCHANGED to react to window state changes
Raymond Chen has suggested the use of WM_WINDOWPOSCHANGED as an alternative to WM_SHOWWINDOW under the title "Use WM_WINDOWPOSCHANGED to react to window state changes" (http://blogs.msdn.com/oldnewthing/archive/2008/01/15/7113860.aspx).
Value
WM_SHOWWINDOW = &H18
Const SW_OTHERUNZOOM As Int32 = 4
Const SW_OTHERZOOM As Int32 = 2
Const SW_PARENTCLOSING As Int32 = 1
Const SW_PARENTOPENING As Int32 = 3