source: trunk/fm3.c@ 1164

Last change on this file since 1164 was 1164, checked in by John Small, 17 years ago

Ticket 187: Draft 1: Functions only

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1
2/***********************************************************************
3
4 $Id: fm3.c 1164 2008-09-05 21:44:14Z jbs $
5
6 fm/2 starter
7
8 Copyright (c) 1993-98 M. Kimes
9 Copyright (c) 2008 Steven H.Levine
10
11 05 Jan 08 SHL Sync
12 18 Jul 08 SHL Add Fortify support
13
14***********************************************************************/
15
16#include <string.h>
17
18#define INCL_DOS
19#define INCL_WIN
20#define INCL_LONGLONG
21
22#include "dll\tools.h"
23#include "dll\version.h"
24#include "dll\errutil.h"
25#include "dll\fortify.h"
26#include "dll\init.h" // StartFM3
27#include "dll\fm3dll.h"
28
29int main(int argc, char *argv[])
30{
31 HAB hab;
32 HMQ hmq;
33 QMSG qmsg;
34 HWND hwndFrame;
35
36 strcpy(appname, "FM/3");
37 DosError(FERR_DISABLEHARDERR);
38 hab = WinInitialize(0);
39 if (hab) {
40 hmq = WinCreateMsgQueue(hab, 2048);
41 if (hmq) {
42 if (InitFM3DLL(hab, argc, argv)) {
43 if (CheckVersion(VERMAJOR, VERMINOR)) {
44# ifdef FORTIFY
45 Fortify_EnterScope();
46# endif
47 hwndFrame = StartFM3(hab, argc, argv);
48 if (hwndFrame != (HWND) 0) {
49 for (;;) {
50 if (!WinGetMsg(hab, &qmsg, (HWND) 0, 0, 0)) {
51 if (qmsg.hwnd)
52 qmsg.msg = WM_CLOSE;
53 else
54 break;
55 }
56 if (hwndBubble &&
57 ((qmsg.msg > (WM_BUTTON1DOWN - 1) &&
58 qmsg.msg < (WM_BUTTON3DBLCLK + 1)) ||
59 (qmsg.msg > (WM_CHORD - 1) &&
60 qmsg.msg < (WM_BUTTON3CLICK + 1))) &&
61 WinIsWindowVisible(hwndBubble))
62 WinShowWindow(hwndBubble, FALSE);
63 WinDispatchMsg(hab, &qmsg);
64 }
65 if (WinIsWindow(hab, WinWindowFromID(hwndFrame, FID_CLIENT)))
66 WinSendMsg(WinWindowFromID(hwndFrame, FID_CLIENT), WM_CLOSE,
67 MPVOID, MPVOID);
68 }
69# ifdef FORTIFY
70 for (;;) {
71 UCHAR scope = Fortify_LeaveScope();
72 if ((CHAR)scope == 0)
73 break;
74 Runtime_Error(__FILE__, __LINE__, "Attempting to exit thread with scope non-zero (%u)", scope);
75 if ((CHAR)scope < 0)
76 break;
77 }
78# endif
79 }
80 }
81 DosSleep(250L);
82 WinDestroyMsgQueue(hmq);
83 }
84 WinTerminate(hab);
85 }
86 return 0;
87}
Note: See TracBrowser for help on using the repository browser.