1 | #define INCL_DOS
|
---|
2 | #define INCL_WIN
|
---|
3 | #define INCL_GPI
|
---|
4 |
|
---|
5 | #include <os2.h>
|
---|
6 | #include <stdarg.h>
|
---|
7 | #include <stdio.h>
|
---|
8 | #include <stdlib.h>
|
---|
9 | #include <string.h>
|
---|
10 | #include <ctype.h>
|
---|
11 | #include <stddef.h>
|
---|
12 | #include "fm3dll.h"
|
---|
13 | #include "fm3dlg.h"
|
---|
14 | #include "fm3str.h"
|
---|
15 |
|
---|
16 | #pragma alloc_text(OBJWIN,ObjectWndProc,MakeObjWin)
|
---|
17 |
|
---|
18 |
|
---|
19 | MRESULT EXPENTRY ObjectWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
|
---|
20 |
|
---|
21 | DIRCNRDATA *dcd;
|
---|
22 |
|
---|
23 | dcd = WinQueryWindowPtr(hwnd,0);
|
---|
24 | if(dcd) {
|
---|
25 | switch(dcd->type) {
|
---|
26 | case DIR_FRAME:
|
---|
27 | return DirObjWndProc(hwnd,msg,mp1,mp2);
|
---|
28 | case TREE_FRAME:
|
---|
29 | return TreeObjWndProc(hwnd,msg,mp1,mp2);
|
---|
30 | case COLLECTOR_FRAME:
|
---|
31 | return CollectorObjWndProc(hwnd,msg,mp1,mp2);
|
---|
32 | case ARC_FRAME:
|
---|
33 | return ArcObjWndProc(hwnd,msg,mp1,mp2);
|
---|
34 | }
|
---|
35 | }
|
---|
36 | return WinDefWindowProc(hwnd,msg,mp1,mp2);
|
---|
37 | }
|
---|
38 |
|
---|
39 |
|
---|
40 | VOID MakeObjWin (VOID *args) {
|
---|
41 |
|
---|
42 | HWND ObjectHwnd;
|
---|
43 | HAB hab2;
|
---|
44 | HMQ hmq2;
|
---|
45 | QMSG qmsg2;
|
---|
46 |
|
---|
47 | hab2 = WinInitialize(0);
|
---|
48 | if(hab2) {
|
---|
49 | hmq2 = WinCreateMsgQueue(hab2,512);
|
---|
50 | if(hmq2) {
|
---|
51 | DosError(FERR_DISABLEHARDERR);
|
---|
52 | WinRegisterClass(hab2,
|
---|
53 | GetPString(IDS_WCOBJECTWINDOW),
|
---|
54 | ObjectWndProc,
|
---|
55 | 0,
|
---|
56 | sizeof(PVOID));
|
---|
57 | ObjectHwnd = WinCreateWindow(HWND_OBJECT,
|
---|
58 | GetPString(IDS_WCOBJECTWINDOW),
|
---|
59 | (PSZ)NULL,
|
---|
60 | 0,
|
---|
61 | 0L,
|
---|
62 | 0L,
|
---|
63 | 0L,
|
---|
64 | 0L,
|
---|
65 | 0L,
|
---|
66 | HWND_TOP,
|
---|
67 | OBJ_FRAME,
|
---|
68 | NULL,
|
---|
69 | NULL);
|
---|
70 | if(ObjectHwnd) {
|
---|
71 | WinSetWindowPtr(ObjectHwnd,0,args);
|
---|
72 | /* initially populate container */
|
---|
73 | WinSendMsg(ObjectHwnd,UM_SETUP,MPVOID,MPVOID);
|
---|
74 | PostMsg(ObjectHwnd,UM_RESCAN,MPVOID,MPVOID);
|
---|
75 | priority_normal();
|
---|
76 | while(WinGetMsg(hab2,&qmsg2,(HWND)0,0,0))
|
---|
77 | WinDispatchMsg(hab2,&qmsg2);
|
---|
78 | WinDestroyWindow(ObjectHwnd);
|
---|
79 | }
|
---|
80 | WinDestroyMsgQueue(hmq2);
|
---|
81 | }
|
---|
82 | WinTerminate(hab2);
|
---|
83 | }
|
---|
84 | }
|
---|
85 |
|
---|