windows_programming_notes.nbk: Home | Index | Next Page: WM_CTLCOLOR | Previous Page: WM_COPYDATA


 WM_CREATE

The WM_CREATE message is 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.

Parameters

Return Value

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.


Prototype for Message Handler

int on_create(HWND hwnd, LPCREATESTRUCT create_struct_pointer)
{

}

This should return 0 for success, and -1 in case of a failure.

If you use the HANDLE_WM_CREATE macro, this function should return TRUE for success, and FALSE for failure.


windows_programming_notes.nbk: Home | Index | Next Page: WM_CTLCOLOR | Previous Page: WM_COPYDATA


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