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>create window</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CREATE WINDOW
Create and set-up a window
------------------------------------------------------------------------------

Syntax
#include "windows.ch"
#include "topclass.ch"   --or--   #define  NO_C4WCLASS
#include "commands.ch"
CREATE WINDOW <oWnd>
     [ MDI ]  [ CLASS <class> ]
     [ TITLE <cTitle> ]
     [ MENU <cnMenuId> | <hMenu> ]
     [ AT | FROM <x>, <y> ]
     [ SIZE <w>, <h> ]
     [ IN  [ APPLICATION | DIALOG | WINDOW ] <oParent> ]
     [ STYLE <nStyle> ]
     [ ID <nId> ]
     [ ICON <hIcon> ]
     [ CURSOR <hCurs> ]
     [ BRUSH <hBrush> ]
     [ INSTANCE <hInst> ]
     [ ON INIT <InitFunc> ]
     [ ON <msg>  <MsgFunc> ] . . .

Arguments
<oWnd> specifies the variable to receive either the window
object (if OO) or a handle (if NO_C4WCLASS is defined).

MDI specifies that the application follows the Multiple
Document Interface conventions.

CLASS <class> can be used to specify the class used for
<oWnd>.  For a non-OO application, this is the window class
name (default "C4W").  For an OO application, <class>
specifies the OO class (which determines the window class
name).  The default is WSDIWindow (non-MDI) or WMDIFrame (for
an MDI application).

TITLE <cTitle>  specifies the text for the window (or its
title/caption, if it has one).

MENU <cnMenuId> | <hMenu>  specifies a menu resource ID or a
menu handle.

AT | FROM <x>, <y>  specify the starting co-ordinates in
pixels.

SIZE <w>, <h>  specify the width and height in pixels.

IN [ APPLICATION | DIALOG | WINDOW ] <oParent>  specifies the
parent (owner) of the window to be created.

STYLE <nStyle>  specifies the window style (using the WS_*
values defined in WINDOWS.CH).

ID <nId>  is the window's id.

ICON <hIcon>  is an icon handle, e.g. from LoadIcon().

CURSOR <hCurs> is a cursor handle, e.g. from LoadCursor().

BRUSH <hBrush> is a brush handle, e.g. from CreateSolidBrush().

INSTANCE <hInst>  is a module (an application or DLL) handle.

ON INIT <InitFunc> specifies a code block to be evaluated or a
function to be called when the window has been created.

ON <msg>  <MsgFunc> specifies a a Windows message (one of the
WM_*) and a code block to be evaluated or a function to be
called if the window receives that message.  This clause can
be specified more than once, to allow several messages to be
handled.

Description
This command can be used to create a window in either a non-OO
application (by defining NO_C4WCLASS) or an OO application.
Usually, you leave out nearly all the clauses.  Some depend on
whether OO is being used - refer to COMMANDS.CH for details.
A number of clauses may be ignored, to make it easier to
convert from non-OO to OO.

Example
CREATE WINDOW oWnd                                     ;
    TITLE "Clip-4-Win Makes Windows Apps E-A-S-Y!"


See Also: CREATE APPLICATION CREATE DIALOG

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