source: trunk/dll/objwin.c@ 1034

Last change on this file since 1034 was 1032, checked in by Gregg Young, 17 years ago

Fortify updates including a leave scope wrapper which frees and in some cases reloads commands, archivers, association, etc.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1
2/***********************************************************************
3
4 $Id: objwin.c 1032 2008-06-30 02:55:36Z 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
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#include "fortify.h"
28
29static PSZ pszSrcFile = __FILE__;
30
31MRESULT EXPENTRY ObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
32{
33 DIRCNRDATA *dcd;
34
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);
46 }
47 }
48 return WinDefWindowProc(hwnd, msg, mp1, mp2);
49}
50
51VOID MakeObjWin(VOID * args)
52{
53 HWND ObjectHwnd;
54 HAB hab2;
55 HMQ hmq2;
56 QMSG qmsg2;
57
58 hab2 = WinInitialize(0);
59 if (hab2) {
60 hmq2 = WinCreateMsgQueue(hab2, 512);
61 if (hmq2) {
62 DosError(FERR_DISABLEHARDERR);
63 WinRegisterClass(hab2,
64 WC_OBJECTWINDOW,
65 ObjectWndProc, 0, sizeof(PVOID));
66 ObjectHwnd = WinCreateWindow(HWND_OBJECT,
67 WC_OBJECTWINDOW,
68 (PSZ) NULL,
69 0,
70 0L,
71 0L,
72 0L,
73 0L, 0L, HWND_TOP, OBJ_FRAME, NULL, NULL);
74 if (!ObjectHwnd)
75 Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
76 IDS_WINCREATEWINDOW);
77 else {
78# ifdef FORTIFY
79 Fortify_EnterScope();
80# endif
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);
89 }
90 WinDestroyMsgQueue(hmq2);
91 }
92# ifdef FORTIFY
93 xFortify_LeaveScope(pszSrcFile, __LINE__);
94# endif
95 WinTerminate(hab2);
96 }
97}
98
99#pragma alloc_text(OBJWIN,ObjectWndProc,MakeObjWin)
Note: See TracBrowser for help on using the repository browser.