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

Syntax
#include "windows.ch"
#include "topclass.ch"   --or--   #define  NO_C4WCLASS
#include "commands.ch"
CREATE APPLICATION <oApp>  WINDOW <oWnd>
     [ MDI ]  [ CLASS <class> ]
     [ NO 3D ]  [ BWCC | BORLAND ]
     [ ON CLOSE <CloseFunc> ]
     [ ON EXIT <ExitFunc> ]
     [ <Clauses> ]

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

WINDOW <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
<oApp>.  The default is WApp (non-MDI) or WMDIApp (for an MDI
application).

NO 3D specifies that the 3-D appearance produced by CTL3D.DLL
is not wanted.

BWCC | BORLAND specifies that Borland custom controls or API
functions (from BWCC.DLL) may be used.

ON CLOSE <CloseFunc> specifies a code block to be evaluated or
a function to be called when a window receives a close event
(WM_CLOSE / EVENT_CLOSE).

ON EXIT <ExitFunc> specifies a code block to be evaluated or a
function to be called when the application receives a quit
event (WM_QUIT / EVENT_QUIT).

<Clauses> are optional clauses for the CREATE WINDOW command
(which is used by the CREATE APPLICATION command).

Description
This command can be used to create either a non-OO application
(by defining NO_C4WCLASS) or an OO application.  Some of the
clauses depend on which kind of application is being created -
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 APPLICATION oApp  WINDOW oWnd               ;
    TITLE "Clip-4-Win Makes Windows Apps E-A-S-Y!" ;
    ON INIT MenuSetup(oWnd)

// From source\cmd\draw.prg:
CREATE APPLICATION oApp                            ;
     WINDOW hWnd                                   ;
     TITLE "Join the dots"                         ;
     CURSOR LoadCursor(0, IDC_CROSS)               ;
     ON WM_LBUTTONDOWN   OnLBtnDown()             ;
     ON WM_LBUTTONUP     OnLBtnUp()               ;
     ON WM_MOUSEMOVE     OnMouseMove()            ;
     ON WM_PAINT         OnPaint()


See Also: CREATE WINDOW

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