home *** CD-ROM | disk | FTP | other *** search
- PROGRAM PMMdi;
-
-
- {***************************************************************************
- * *
- * Speed-Pascal/2 Sample program "PMMdi" *
- * *
- * (C) 1993,94 Rene Nürnberger. All rights reserved. *
- * *
- * *
- * This sample program can be used as a template for your own MDI *
- * Applications ! *
- * *
- * *
- ****************************************************************************}
-
-
- USES Api,PmObject,Crt,PmTypes; {bind Units used}
-
-
- RESOURCE PMMDI; {bind external Resources}
-
- TYPE
- TMyApplication=OBJECT(TMDIApplication)
- CONSTRUCTOR Init;
- DESTRUCTOR Done;
- FUNCTION HandleEvent(Win:HWND;Msg:ULONG;
- Para1,Para2:POINTER;
- VAR Handled:BOOLEAN):
-
- ULONG;VIRTUAL;
- END;
-
- CONST
- CM_NEWCHILD=500;
-
- VAR MyApp:TMyApplication;
-
-
- {define Methods}
-
- CONSTRUCTOR TMyApplication.Init;
- BEGIN
-
- Inherited.Init;
- InsertResources(TRUE,FALSE,TRUE); {Application has menu and icon}
- END;
-
-
- DESTRUCTOR TMyApplication.Done;
- BEGIN
- END;
-
- {Virtual Method HandleEvent. All Messages come here first}
- FUNCTION TMyApplication.HandleEvent(Win:HWND;Msg:ULONG;Para1,Para2:POINTER;
- VAR Handled:BOOLEAN):ULONG;
- VAR r:LONGWORD;
- H:BOOLEAN;
- Command:WORD;
- fr:ULONG;
- Frame:HWND;
- BEGIN
- H:=TRUE;
- r:=Inherited.HandleEvent(Win,Msg,Para1,Para2,Handled);
- CASE Msg OF
- WM_COMMAND:
- BEGIN
- Command:=WORD(Para1);
- CASE Command OF
- CM_NEWCHILD:
- BEGIN
- fr:=FCF_ICON; {MDI window has an icon}
- Frame:=CreateMDIChild(1001,'MDI Child',NIL,fr,
- CLR_BLACK,CLR_CYAN);
- END;
- END; {case}
- END;
- ELSE IF not handled THEN H:=FALSE;
- END; {Case}
- Handled:=H;
- HandleEvent:=r;
- END;
-
- BEGIN {Main}
- MyApp.Init;
- MyApp.Run(1000,'PMMDI Sample Application',CLR_DARKGRAY,CLR_WHITE);
- MyApp.Done;
- END.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-