6
function ClientWindowProc (Window, Msg: cardinal; MP1, MP2: pointer): pointer;
15
ClientWindowProc := nil;
18
PS := WinBeginPaint (Window, 0, @R);
19
WinFillRect (PS, @R, SYSCLR_WINDOW);
22
else ClientWindowProc := WinDefWindowProc (Window, Msg, MP1, MP2);
27
idClientWindow = 11000;
28
WinFlags: cardinal = fcf_TitleBar + fcf_SysMenu + fcf_SizeBorder +
29
fcf_MinMax + fcf_TaskList + fcf_NoByteAlign;
33
Anchor, MsgQue: cardinal;
35
Frame, Client: cardinal;
37
Anchor := WinInitialize(0);
38
{ It might be beneficial to set the second parameter of the following }
39
{ call to something large, such as 1000. The OS/2 documentation does }
40
{ not recommend this, however } MsgQue := WinCreateMsgQueue (Anchor, 0);
41
if MsgQue = 0 then Halt (254);
43
WinMessageBox (HWND_DESKTOP, HWND_DESKTOP, 'FPC test', 'BASIC PM', 0,
44
MB_OK or MB_INFORMATION);
46
WinRegisterClass (Anchor, ClassName, proc (@ClientWindowProc), cs_SizeRedraw,
48
Frame := WinCreateStdWindow (hwnd_Desktop, 0, WinFlags, ClassName,
49
'BASIC PM', 0, 0, idClientWindow, Client);
52
WinSetWindowPos (Frame, 0, 0, WinQuerySysValue (hwnd_Desktop,
53
sv_CyScreen) - 200, 200, 200, swp_Move + swp_Size + swp_Activate +
55
while WinGetMsg (Anchor, Message, 0, 0, 0) do
56
WinDispatchMsg (Anchor, Message);
58
WinDestroyWindow (Frame);
60
WinDestroyMsgQueue (MsgQue);
61
WinTerminate (Anchor);