The CREATESTRUCT structure defines the initialization parameters passed to the window procedure of an application.
typedef struct tagCREATESTRUCT { // cs
LPVOID lpCreateParams;
HINSTANCE hInstance;
HMENU hMenu;
HWND hwndParent;
int cy;
int cx;
int y;
int x;
LONG style;
LPCTSTR lpszName;
LPCTSTR lpszClass;
DWORD dwExStyle;
} CREATESTRUCT;
If the window being created is an MDI window, this member contains a pointer to an MDICREATESTRUCT structure.
Windows NT: If the window is being created from a dialog template, this member is the address of a SHORT value that specifies the size, in bytes, of the window creation data. The value is immediately followed by the creation data. For more information, see the following Remarks section.
Windows NT: You should access the data represented by the lpCreateParams member using a pointer that has been declared using the UNALIGNED type, because the pointer may not be DWORD aligned. This is demonstrated in the following example:
typedef struct tagMyData
{
// Define creation data here.
} MYDATA;
typedef struct tagMyDlgData
{
SHORT cbExtra;
MYDATA myData;
} MYDLGDATA, UNALIGNED *PMYDLGDATA;
PMYDLGDATA pMyDlgdata =
(PMYDLGDATA) (((LPCREATESTRUCT) lParam)->lpCreateParams);
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Unicode: Defined as Unicode and ANSI structures.
Windows Overview, Window Structures, CreateWindow, CreateWindowEx, MDICREATESTRUCT