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