[377] | 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
|
---|
[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"
|
---|
[2] | 27 |
|
---|
[377] | 28 | static PSZ pszSrcFile = __FILE__;
|
---|
| 29 |
|
---|
[551] | 30 | MRESULT EXPENTRY ObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
[413] | 31 | {
|
---|
[2] | 32 | DIRCNRDATA *dcd;
|
---|
| 33 |
|
---|
[551] | 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);
|
---|
[2] | 45 | }
|
---|
| 46 | }
|
---|
[551] | 47 | return WinDefWindowProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 48 | }
|
---|
| 49 |
|
---|
[551] | 50 | VOID MakeObjWin(VOID * args)
|
---|
[413] | 51 | {
|
---|
[551] | 52 | HWND ObjectHwnd;
|
---|
| 53 | HAB hab2;
|
---|
| 54 | HMQ hmq2;
|
---|
| 55 | QMSG qmsg2;
|
---|
[2] | 56 |
|
---|
| 57 | hab2 = WinInitialize(0);
|
---|
[551] | 58 | if (hab2) {
|
---|
| 59 | hmq2 = WinCreateMsgQueue(hab2, 512);
|
---|
| 60 | if (hmq2) {
|
---|
[2] | 61 | DosError(FERR_DISABLEHARDERR);
|
---|
| 62 | WinRegisterClass(hab2,
|
---|
[593] | 63 | WC_OBJECTWINDOW,
|
---|
[551] | 64 | ObjectWndProc, 0, sizeof(PVOID));
|
---|
[2] | 65 | ObjectHwnd = WinCreateWindow(HWND_OBJECT,
|
---|
[593] | 66 | WC_OBJECTWINDOW,
|
---|
[551] | 67 | (PSZ) NULL,
|
---|
| 68 | 0,
|
---|
| 69 | 0L,
|
---|
| 70 | 0L,
|
---|
| 71 | 0L,
|
---|
| 72 | 0L, 0L, HWND_TOP, OBJ_FRAME, NULL, NULL);
|
---|
[377] | 73 | if (!ObjectHwnd)
|
---|
[551] | 74 | Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
|
---|
| 75 | IDS_WINCREATEWINDOW);
|
---|
[377] | 76 | else {
|
---|
[551] | 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);
|
---|
[2] | 85 | }
|
---|
| 86 | WinDestroyMsgQueue(hmq2);
|
---|
| 87 | }
|
---|
| 88 | WinTerminate(hab2);
|
---|
| 89 | }
|
---|
| 90 | }
|
---|
[793] | 91 |
|
---|
| 92 | #pragma alloc_text(OBJWIN,ObjectWndProc,MakeObjWin)
|
---|