source: trunk/dll/objwin.c@ 793

Last change on this file since 793 was 793, checked in by Gregg Young, 18 years ago

Move #pragma alloc_text to end for OpenWatcom compat

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
RevLine 
[377]1
2/***********************************************************************
3
4 $Id: objwin.c 793 2007-08-21 02:53:38Z 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
20#define INCL_GPI
[377]21#include <os2.h>
[2]22
23#include <stdarg.h>
24#include <stdio.h>
25#include <stdlib.h>
26#include <string.h>
27#include <ctype.h>
28#include <stddef.h>
[377]29
[2]30#include "fm3dll.h"
31#include "fm3dlg.h"
32#include "fm3str.h"
33
[377]34static PSZ pszSrcFile = __FILE__;
35
[551]36MRESULT EXPENTRY ObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
[413]37{
[2]38 DIRCNRDATA *dcd;
39
[551]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);
[2]51 }
52 }
[551]53 return WinDefWindowProc(hwnd, msg, mp1, mp2);
[2]54}
55
[551]56VOID MakeObjWin(VOID * args)
[413]57{
[551]58 HWND ObjectHwnd;
59 HAB hab2;
60 HMQ hmq2;
61 QMSG qmsg2;
[2]62
63 hab2 = WinInitialize(0);
[551]64 if (hab2) {
65 hmq2 = WinCreateMsgQueue(hab2, 512);
66 if (hmq2) {
[2]67 DosError(FERR_DISABLEHARDERR);
68 WinRegisterClass(hab2,
[593]69 WC_OBJECTWINDOW,
[551]70 ObjectWndProc, 0, sizeof(PVOID));
[2]71 ObjectHwnd = WinCreateWindow(HWND_OBJECT,
[593]72 WC_OBJECTWINDOW,
[551]73 (PSZ) NULL,
74 0,
75 0L,
76 0L,
77 0L,
78 0L, 0L, HWND_TOP, OBJ_FRAME, NULL, NULL);
[377]79 if (!ObjectHwnd)
[551]80 Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
81 IDS_WINCREATEWINDOW);
[377]82 else {
[551]83 WinSetWindowPtr(ObjectHwnd, QWL_USER, args);
84 /* initially populate container */
85 WinSendMsg(ObjectHwnd, UM_SETUP, MPVOID, MPVOID);
86 PostMsg(ObjectHwnd, UM_RESCAN, MPVOID, MPVOID);
87 priority_normal();
88 while (WinGetMsg(hab2, &qmsg2, (HWND) 0, 0, 0))
89 WinDispatchMsg(hab2, &qmsg2);
90 WinDestroyWindow(ObjectHwnd);
[2]91 }
92 WinDestroyMsgQueue(hmq2);
93 }
94 WinTerminate(hab2);
95 }
96}
[793]97
98#pragma alloc_text(OBJWIN,ObjectWndProc,MakeObjWin)
Note: See TracBrowser for help on using the repository browser.