CWindowImpl::Create

HWND Create( HWND hWndParent, RECT& rcPos, LPCTSTR szWindowName = NULL, DWORD dwStyle = WS_CHILD | WS_VISIBLE, DWORD dwExStyle = 0, UINT nID = 0 );

Return Value

If successful, the handle to the newly created window. Otherwise, NULL.

Parameters

hWndParent

[in] The handle to the parent or owner window.

rcPos

[in] A RECT structure specifying the position of the window.

szWindowName

[in] Specifies the name of the window. The default value is NULL.

dwStyle

[in] The style of the window. The default value is WS_CHILD | WS_VISIBLE. For a list of possible values, see CreateWindow in the Platform SDK.

dwExStyle

[in] The extended window style. The default value is 0, meaning no extended style. For a list of possible values, see CreateWindowEx in the Platform SDK.

nID

[in] For a child window, the window identifier. For a top-level window, an HWND cast to a UINT. The default value is 0.

Remarks

Creates a window based on a new window class. Create first registers the window class if it has not yet been registered. The newly created window is automatically attached to the CWindowImpl object.

To use a window class that is based on an existing window class, derive your class from CWindowImpl and include the DECLARE_WND_SUPERCLASS macro. The existing window class’s window procedure is saved in m_pfnSuperWindowProc. For more information, see the CWindowImpl overview.

Note   Do not call Create if you have already called SubclassWindow.

CWindowImpl OverviewClass Members

See Also

CWindowImpl::GetWndClassInfo, CWndClassInfo::Register, CWindow::m_hWnd