CreateWindowEx

Version 3.0

Syntax

HWND CreateWindowEx(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam)

This function creates an overlapped, pop-up, or child window with an extended style specified in the dwExStyle parameter. Otherwise, this function is identical to the CreateWindow function. See the description of the CreateWindow function for more information on creating a window and for a full descriptions of the other parameters of CreateWindowEx.

Parameter Type/Description  
dwExStyle DWORD Specifies the extended style of the window being created. Table R.5, “Extended Window Styles,” lists the extended window styles.  
lpClassName LPSTR Points to a null-terminated character string that names the window class.  
lpWindowName LPSTR Points to a null-terminated character string that represents the window name.  
dwStyle DWORD Specifies the style of window being created.  
X int Specifies the initial x-position of the window.  
Y int Specifies the initial y-position of the window.  
nWidth int Specifies the width (in device units) of the window.  
nHeight int Specifies the height (in device units) of the window.  
hWndParent HWND Identifies the parent or owner window of the window being created.  
hMenu HMENU Identifies a menu or a child-window identifier. The meaning depends on the window style.  
hInstance HANDLE Identifies the instance of the module to be associated with the window.  
lpParam LPSTR Points to a value that is passed to the window through the CREATESTRUCT data structure referenced by the lParam parameter of the WM_CREATE message.  

Return Value

The return value identifies the new window. It is NULL if the window is not created.

Comments

Table R.5 lists the extended window styles.

Table R.5 Extended Window Styles

Style Meaning
WS_EX_DLGMODALFRAME Designates a window with a double border that may optionally be created with a title bar by specifying the WS_CAPTION style flag in the dwStyle parameter.
WS_EX_NOPARENTNOTIFY Specifies that a child window created with this style will not send the WM_PARENTNOTIFY message to its parent window when the child window is created or destroyed.
WS_EX_TOPMOST Specifies that the window is a topmost window. A topmost window is always ordered above windows without this style, even when the topmost inactive. The SetWindowPos function enables and disables this feature.

Table R.2, “Control Classes,” lists the window control classes. Table R.3, “Window Styles,” lists the window styles. Table R.4, “Control Styles,” lists the control styles. See the description of the CreateWindow function for these tables.