The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.
WM_NCCREATE lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
If an application processes this message, it should return TRUE to continue creation of the window. If the application returns FALSE, the CreateWindow or CreateWindowEx function will return a NULL handle.
CreateWindow, CreateWindowEx, DefWindowProc, CREATESTRUCT, WM_CREATE