Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>createwindow()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CreateWindow()
Create a new overlapped, pop-up, or child window
------------------------------------------------------------------------------

Syntax
CreateWindow( <cClass>, <cTitle>, <nStyle>, <nX>, <nY>,
              <nWidth>, <nHeight>, <hWndParent>, <hMenu>,
              [ <hInst> ] , [ <cParam> ] )   -->   hWnd

Arguments
<cClass> is the window class name.  It should be the name of a
class registered with RegisterClass(), or one of the pre-
defined control-class names (button, combobox, edit, listbox,
scrollbar, or static).

<cTitle> is the text to put in the title bar of the window.

<nStyle> is the window style to use (a combination of the WS_*
values from WINDOWS.CH).  For the pre-defined window classes,
the BS_*, CBS_*, ES_*, LBS_*, SBS_*, and SS_* styles can be
used.

<nX>, <nY> specify the position of the top left-hand corner of
the window in pixels.  You can get defaults by specifying
CW_USEDEFAULT or NIL.

<nWidth>, <nHeight> specify the size of the window in pixels.
You can get defaults for overlapped windows by specifying
CW_USEDEFAULT or NIL.

<hWndParent> identifies the parent (owner) window of the new
window.  For the top-level window of an application this can
be NIL or zero.  For other windows you will generally use the
application's top-level window handle.

<hMenu> should be NIL or zero.

<hInst> optionally identifies the instance of the application
(the default is the current application instance).  It should
be obtained from _GetInstance().

<cParam> optionally specifies initialisation data (e.g. for MDI).

Returns
If successful, a handle to the new window is returned (a non-
zero numeric).  Otherwise, zero is returned.

Description
The window is created with the characteristics specified, and
the handle returned to the application.  Note that there are
many meaningless combinations of styles, etc., which generally
result in an error return (zero).

Example
hInst = _GetInstance()
     .
     .    // use RegisterClass() if needed
     .
hWnd = CreateWindow( "SampleApp", "Sample App Window Title",   ;
                     WS_OVERLAPPEDWINDOW,                      ;
                     NIL, NIL, NIL, NIL,                       ;
                     NIL, NIL, hInst )


See Also: DestroyWindow() FindWindow() GetWindow() IsWindow() IsWindowEnabled() MoveWindow()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson