Microsoft Foundation Classes (mfc.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
CWnd::CreateEx
◄CWnd► ◄Up► ◄Contents► ◄Index► ◄Back►
──Microsoft Foundation Classes──────────────────────────────────────────────
Protected: BOOL CreateEx( DWORD dwExStyle, const char FAR* lpClassName,
const char FAR* lpWindowName, DWORD dwStyle,
int x, int y, int nWidth, int nHeight,
HWND hwndParent, HMENU nIDorHMenu );
Parameter Description
<dwExStyle> Specifies the extended style of the CWnd being created.
It may be one of the following values:
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 <dwStyle>.
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 a window created
with this style should be placed
above all nontopmost windows and
stay above them even when CWnd is
deactivated. An application can
use the ◄SetWindowPos► member
function to add or remove this
attribute.
<lpClassName> Points to a null-terminated character string that names
the Windows class (a WNDCLASS struct). The class name can
be any name registered with the ◄AfxRegisterWndClass►
function or any of the predefined control-class names. It
must not be NULL.
<lpWindowName> Points to a null-terminated character string that
contains the window name.
<dwStyle> Specifies the Windows style of CWnd.
<x> Specifies the initial x-position of the CWnd window.
<y> Specifies the initial top position of the CWnd window.
<nWidth> Specifies the width (in device units) of the CWnd
window.
<nHeight> Specifies the height (in device units) of the CWnd
window.
<hwndParent> Identifies the parent or owner window of the CWnd window
being created. Use NULL for top-level windows.
<nIDorHMenu> Identifies a menu or a child-window identifier. The
meaning depends on the style of the window.
Remarks
Creates an overlapped, pop-up, or child window with the extended style
specified in <dwExStyle>.
The CreateEx parameters specify the WNDCLASS, window title, window
style, and (optionally) initial position and size of the window.
CreateEx also specifies the window's parent (if any) and ID.
When CreateEx executes, Windows sends the ◄WM_GETMINMAXINFO►,
◄WM_NCCREATE►, ◄WM_NCCALCSIZE►, and ◄WM_CREATE► messages to the window.
To extend the default message handling, derive a class from CWnd, add a
message map to the new class, and provide member functions for the above
messages. Override OnCreate, for example, to perform needed
initialization for a new class.
Override further On<Message> message handlers to add further
functionality to your derived class.
The <dwStyle> parameter can be any combination of ◄window styles►:
Return Value
TRUE if the CWnd window is created; otherwise FALSE.
See Also
◄::CreateWindowEx►
-♦-