| 1 | 
 | 
|---|
| 2 | /***********************************************************************
 | 
|---|
| 3 | 
 | 
|---|
| 4 |   $Id: objwin.c 516 2006-11-02 08:51:22Z root $
 | 
|---|
| 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 | 
 | 
|---|
| 14 | ***********************************************************************/
 | 
|---|
| 15 | 
 | 
|---|
| 16 | #define INCL_DOS
 | 
|---|
| 17 | #define INCL_WIN
 | 
|---|
| 18 | #define INCL_GPI
 | 
|---|
| 19 | #include <os2.h>
 | 
|---|
| 20 | 
 | 
|---|
| 21 | #include <stdarg.h>
 | 
|---|
| 22 | #include <stdio.h>
 | 
|---|
| 23 | #include <stdlib.h>
 | 
|---|
| 24 | #include <string.h>
 | 
|---|
| 25 | #include <ctype.h>
 | 
|---|
| 26 | #include <stddef.h>
 | 
|---|
| 27 | 
 | 
|---|
| 28 | #include "fm3dll.h"
 | 
|---|
| 29 | #include "fm3dlg.h"
 | 
|---|
| 30 | #include "fm3str.h"
 | 
|---|
| 31 | 
 | 
|---|
| 32 | static PSZ pszSrcFile = __FILE__;
 | 
|---|
| 33 | 
 | 
|---|
| 34 | #pragma alloc_text(OBJWIN,ObjectWndProc,MakeObjWin)
 | 
|---|
| 35 | 
 | 
|---|
| 36 | MRESULT EXPENTRY ObjectWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
 | 
|---|
| 37 | {
 | 
|---|
| 38 |   DIRCNRDATA *dcd;
 | 
|---|
| 39 | 
 | 
|---|
| 40 |   dcd = WinQueryWindowPtr(hwnd,QWL_USER);
 | 
|---|
| 41 |   if(dcd) {
 | 
|---|
| 42 |     switch(dcd->type) {
 | 
|---|
| 43 |       case DIR_FRAME:
 | 
|---|
| 44 |         return DirObjWndProc(hwnd,msg,mp1,mp2);
 | 
|---|
| 45 |       case TREE_FRAME:
 | 
|---|
| 46 |         return TreeObjWndProc(hwnd,msg,mp1,mp2);
 | 
|---|
| 47 |       case COLLECTOR_FRAME:
 | 
|---|
| 48 |         return CollectorObjWndProc(hwnd,msg,mp1,mp2);
 | 
|---|
| 49 |       case ARC_FRAME:
 | 
|---|
| 50 |         return ArcObjWndProc(hwnd,msg,mp1,mp2);
 | 
|---|
| 51 |     }
 | 
|---|
| 52 |   }
 | 
|---|
| 53 |   return WinDefWindowProc(hwnd,msg,mp1,mp2);
 | 
|---|
| 54 | }
 | 
|---|
| 55 | 
 | 
|---|
| 56 | 
 | 
|---|
| 57 | VOID MakeObjWin (VOID *args)
 | 
|---|
| 58 | {
 | 
|---|
| 59 |   HWND        ObjectHwnd;
 | 
|---|
| 60 |   HAB         hab2;
 | 
|---|
| 61 |   HMQ         hmq2;
 | 
|---|
| 62 |   QMSG        qmsg2;
 | 
|---|
| 63 | 
 | 
|---|
| 64 |   hab2 = WinInitialize(0);
 | 
|---|
| 65 |   if(hab2) {
 | 
|---|
| 66 |     hmq2 = WinCreateMsgQueue(hab2,512);
 | 
|---|
| 67 |     if(hmq2) {
 | 
|---|
| 68 |       DosError(FERR_DISABLEHARDERR);
 | 
|---|
| 69 |       WinRegisterClass(hab2,
 | 
|---|
| 70 |                        GetPString(IDS_WCOBJECTWINDOW),
 | 
|---|
| 71 |                        ObjectWndProc,
 | 
|---|
| 72 |                        0,
 | 
|---|
| 73 |                        sizeof(PVOID));
 | 
|---|
| 74 |       ObjectHwnd = WinCreateWindow(HWND_OBJECT,
 | 
|---|
| 75 |                                    GetPString(IDS_WCOBJECTWINDOW),
 | 
|---|
| 76 |                                    (PSZ)NULL,
 | 
|---|
| 77 |                                    0,
 | 
|---|
| 78 |                                    0L,
 | 
|---|
| 79 |                                    0L,
 | 
|---|
| 80 |                                    0L,
 | 
|---|
| 81 |                                    0L,
 | 
|---|
| 82 |                                    0L,
 | 
|---|
| 83 |                                    HWND_TOP,
 | 
|---|
| 84 |                                    OBJ_FRAME,
 | 
|---|
| 85 |                                    NULL,
 | 
|---|
| 86 |                                    NULL);
 | 
|---|
| 87 |       if (!ObjectHwnd)
 | 
|---|
| 88 |         Win_Error2(HWND_OBJECT,HWND_DESKTOP,pszSrcFile,__LINE__,IDS_WINCREATEWINDOW);
 | 
|---|
| 89 |       else {
 | 
|---|
| 90 |         WinSetWindowPtr(ObjectHwnd,QWL_USER,args);
 | 
|---|
| 91 |         /* initially populate container */
 | 
|---|
| 92 |         WinSendMsg(ObjectHwnd,UM_SETUP,MPVOID,MPVOID);
 | 
|---|
| 93 |         PostMsg(ObjectHwnd,UM_RESCAN,MPVOID,MPVOID);
 | 
|---|
| 94 |         priority_normal();
 | 
|---|
| 95 |         while(WinGetMsg(hab2,&qmsg2,(HWND)0,0,0))
 | 
|---|
| 96 |           WinDispatchMsg(hab2,&qmsg2);
 | 
|---|
| 97 |         WinDestroyWindow(ObjectHwnd);
 | 
|---|
| 98 |       }
 | 
|---|
| 99 |       WinDestroyMsgQueue(hmq2);
 | 
|---|
| 100 |     }
 | 
|---|
| 101 |     WinTerminate(hab2);
 | 
|---|
| 102 |   }
 | 
|---|
| 103 | }
 | 
|---|
| 104 | 
 | 
|---|