1 |
|
---|
2 | /***********************************************************************
|
---|
3 |
|
---|
4 | $Id: objwin.c 907 2008-01-06 07:26:17Z stevenhl $
|
---|
5 |
|
---|
6 | Object windows
|
---|
7 |
|
---|
8 | Copyright (c) 1993-98 M. Kimes
|
---|
9 | Copyright (c) 2006 Steven H.Levine
|
---|
10 |
|
---|
11 | 26 Jul 06 SHL Check more run time errors
|
---|
12 | 02 Nov 06 SHL Comments
|
---|
13 | 30 Mar 07 GKY Remove GetPString for window class names
|
---|
14 | 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
|
---|
15 |
|
---|
16 | ***********************************************************************/
|
---|
17 |
|
---|
18 | #define INCL_DOS
|
---|
19 | #define INCL_WIN
|
---|
20 | #define INCL_LONGLONG // dircnrs.h
|
---|
21 |
|
---|
22 | #include "fm3dlg.h"
|
---|
23 | #include "fm3str.h"
|
---|
24 | #include "arccnrs.h" // ArcObjWndProc
|
---|
25 | #include "errutil.h" // Win_Error
|
---|
26 | #include "fm3dll.h"
|
---|
27 |
|
---|
28 | static PSZ pszSrcFile = __FILE__;
|
---|
29 |
|
---|
30 | MRESULT EXPENTRY ObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
31 | {
|
---|
32 | DIRCNRDATA *dcd;
|
---|
33 |
|
---|
34 | dcd = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
35 | if (dcd) {
|
---|
36 | switch (dcd->type) {
|
---|
37 | case DIR_FRAME:
|
---|
38 | return DirObjWndProc(hwnd, msg, mp1, mp2);
|
---|
39 | case TREE_FRAME:
|
---|
40 | return TreeObjWndProc(hwnd, msg, mp1, mp2);
|
---|
41 | case COLLECTOR_FRAME:
|
---|
42 | return CollectorObjWndProc(hwnd, msg, mp1, mp2);
|
---|
43 | case ARC_FRAME:
|
---|
44 | return ArcObjWndProc(hwnd, msg, mp1, mp2);
|
---|
45 | }
|
---|
46 | }
|
---|
47 | return WinDefWindowProc(hwnd, msg, mp1, mp2);
|
---|
48 | }
|
---|
49 |
|
---|
50 | VOID MakeObjWin(VOID * args)
|
---|
51 | {
|
---|
52 | HWND ObjectHwnd;
|
---|
53 | HAB hab2;
|
---|
54 | HMQ hmq2;
|
---|
55 | QMSG qmsg2;
|
---|
56 |
|
---|
57 | hab2 = WinInitialize(0);
|
---|
58 | if (hab2) {
|
---|
59 | hmq2 = WinCreateMsgQueue(hab2, 512);
|
---|
60 | if (hmq2) {
|
---|
61 | DosError(FERR_DISABLEHARDERR);
|
---|
62 | WinRegisterClass(hab2,
|
---|
63 | WC_OBJECTWINDOW,
|
---|
64 | ObjectWndProc, 0, sizeof(PVOID));
|
---|
65 | ObjectHwnd = WinCreateWindow(HWND_OBJECT,
|
---|
66 | WC_OBJECTWINDOW,
|
---|
67 | (PSZ) NULL,
|
---|
68 | 0,
|
---|
69 | 0L,
|
---|
70 | 0L,
|
---|
71 | 0L,
|
---|
72 | 0L, 0L, HWND_TOP, OBJ_FRAME, NULL, NULL);
|
---|
73 | if (!ObjectHwnd)
|
---|
74 | Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
|
---|
75 | IDS_WINCREATEWINDOW);
|
---|
76 | else {
|
---|
77 | WinSetWindowPtr(ObjectHwnd, QWL_USER, args);
|
---|
78 | /* initially populate container */
|
---|
79 | WinSendMsg(ObjectHwnd, UM_SETUP, MPVOID, MPVOID);
|
---|
80 | PostMsg(ObjectHwnd, UM_RESCAN, MPVOID, MPVOID);
|
---|
81 | priority_normal();
|
---|
82 | while (WinGetMsg(hab2, &qmsg2, (HWND) 0, 0, 0))
|
---|
83 | WinDispatchMsg(hab2, &qmsg2);
|
---|
84 | WinDestroyWindow(ObjectHwnd);
|
---|
85 | }
|
---|
86 | WinDestroyMsgQueue(hmq2);
|
---|
87 | }
|
---|
88 | WinTerminate(hab2);
|
---|
89 | }
|
---|
90 | }
|
---|
91 |
|
---|
92 | #pragma alloc_text(OBJWIN,ObjectWndProc,MakeObjWin)
|
---|