Create method


Create Proto lpszWindowName:LPSTR, hWndParent:HWND, lMode:LONG, lParam:LPARAM


Invoke Create, lpszWindowName, hWndParent, lMode, lParam


Creates and displays a window object for the specified name.



Pointer to the effective address of a null-terminated string that names the window object. This parameter must be a name referring to any of the window objects added to project at design time (case sensitive). The name for an object is that specified by its Name property.


Handle to the parent. It can be NULL for no parent.


Specifies whether the created window will be modal or modeless.


Specifies a value which will be passed to a DialogBox object in the lParam parameter of the WM_INITDIALOG message (only for DialogBox objects).

Return value

For modeless windows, Eax returns the handle to the new reated window, while for modal windows it returns the value passed as the second argument to the EndModal method.

REMARKS: The lMode parameter specifies whether the new created window will be modal or modeless. Only DialogBox and non MDI child Window objects can be modal windows (see the
MDIChild property), so this parameter is ignored for MDIWindow and MDI child Window objects. The lMode parameter must be 0 (ecModeless) or 1 (ecModal). Note that any other value than 0 will mean a modal window. On the other hand, the lParam parameter is only valid for DialogBox objects and may be NULL if not needed. For any other object not being a DialogBox, the lParam parameter is ignored.

IMPORTANT: If you specify a window object whose name does not exist in the project, the window will not be created and the return value will be NULL.