WM_CREATE message
Applies to: desktop apps only
Sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.
A window receives this message through its WindowProc function.
#define WM_CREATE 0x0001
Parameters
- wParam
-
This parameter is not used.
- lParam
-
A pointer to a CREATESTRUCT structure that contains information about the window being created.
Return value
Type: LRESULT
If an application processes this message, it should return zero to continue creation of the window. If the application returns –1, the window is destroyed and the CreateWindowEx or CreateWindow function returns a NULL handle.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
See also
- Reference
- CreateWindow
- CreateWindowEx
- CREATESTRUCT
- WM_NCCREATE
- Conceptual
- Windows
Send comments about this topic to Microsoft
Build date: 2/3/2012
- 1/17/2012
- ArnoudMulder
- 1/17/2012
- ArnoudMulder
WM_CREATE message is sent before CreateWindow or CreateWindowEx returns, it might not be the first message that is received by the window procedure. On my machine, for instance, I received a WM_GETMINMAXINFO message, a WM_NCCREATE message, and a WM_NCCALCSIZE message before receiving the WM_CREATE message.
- 5/28/2011
- Daniel Trebbien
If you are using the macro HANDLE_MSG defined in windowsx.h, your code to process the message must not return 0 to continue creation of the window. This is because the macro change the return value. 0 into -1 and any other value into 0.