1 {****************************************************************************
5 Copyright (c
) 1999-2000 by Florian Klaempfl
7 ****************************************************************************}
9 { Sample program
for FPC under OS
/2 }
10 { Classic Hello world
in PM
version }
14 (* PMDEMO1
.RES has to be compiled from PMDEMO1
.RC using
"rc -r PMDEMO1.RC". *)
22 frame
,client
: cardinal
;
28 frameflags
: longint
= FCF_TITLEBAR
+FCF_SYSMENU
+FCF_SIZEBORDER
+
29 FCF_MINBUTTON
+FCF_MAXBUTTON
+FCF_SHELLPOSITION
+
30 FCF_TASKLIST
+FCF_MENU
;
32 function
clientwndproc(window
: cardinal
;msg
: longint
;mp1
,mp2
: pointer
) :
33 pointer
; cdecl
; export
;
36 text
= 'Hello world by OS/2 and FPC';
43 {clientwndproc
:=nil; }
45 { WM_CREATE
: DosBeep(200,500);}
47 ps
:=WinBeginPaint(window
,0,nil);
48 WinQueryWindowRect(window
,@rcl);
49 WinDrawText(ps
,-1,text
,@rcl,0,7,$8500);
52 WM_COMMAND
: case lo(longint(mp1
)) of
53 {101 : DosBeep(4500,1000);}
54 109 : WinPostMsg(0,WM_QUIT
,nil,nil);
55 201 : WinMessageBox(cardinal(1),cardinal(1),
57 'About',0,MB_ICONEXCLAMATION
+MB_MOVEABLE
);
60 clientwndproc
:=WinDefWindowProc(window
,msg
,mp1
,mp2
);
66 mq
:=WinCreateMsgQueue(ab
,0);
67 WinRegisterClass(ab
,'HELLOPM',proc(@clientwndproc),4,0);
68 frame
:=WinCreateStdWindow(cardinal(1),WS_VISIBLE
,@frameflags,'HELLOPM',
69 'PMDemo 1',WS_VISIBLE
,0,1,@client);
70 while WinGetMsg(ab
,@msg,0,0,0) do
71 WinDispatchMsg(ab
,@msg);
72 WinDestroyWindow(frame
);
73 WinDestroyMsgQueue(mq
);
78 Revision
1.1 2002/02/19 08:26:08 sasu
81 Revision
1.1 2000/07/13 06:31:08 michael
84 Revision
1.1 2000/07/09 10:37:50 peter
85 * renamed to lowercase names
87 Revision
1.6 2000/07/09 07:49:34 hajny
90 Revision
1.5 2000/06/18 18:37:17 hajny
93 Revision
1.4 2000/01/07 16:41:50 daniel
96 Revision
1.3 2000/01/07 16:32:34 daniel
97 * copyright
2000 added
99 Revision
1.2 1999/08/10 14:33:51 hajny
102 Revision
1.1 1999/06/02 16:01:35 hajny
103 * changes by Ramon Bosque