[907] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: fm3.c 1077 2008-07-18 18:11:54Z stevenhl $
|
---|
| 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
|
---|
[1077] | 12 | 18 Jul 08 SHL Add Fortify support
|
---|
[907] | 13 |
|
---|
| 14 | ***********************************************************************/
|
---|
| 15 |
|
---|
| 16 | #include <string.h>
|
---|
| 17 |
|
---|
[2] | 18 | #define INCL_DOS
|
---|
| 19 | #define INCL_WIN
|
---|
[907] | 20 | #define INCL_LONGLONG
|
---|
[2] | 21 |
|
---|
| 22 | #include "dll\tools.h"
|
---|
| 23 | #include "dll\version.h"
|
---|
[1077] | 24 | #include "dll\fortify.h"
|
---|
[907] | 25 | #include "dll\fm3dll.h"
|
---|
[2] | 26 |
|
---|
[551] | 27 | int main(int argc, char *argv[])
|
---|
| 28 | {
|
---|
| 29 | HAB hab;
|
---|
| 30 | HMQ hmq;
|
---|
| 31 | QMSG qmsg;
|
---|
| 32 | HWND hwndFrame;
|
---|
[2] | 33 |
|
---|
[551] | 34 | strcpy(appname, "FM/3");
|
---|
[2] | 35 | DosError(FERR_DISABLEHARDERR);
|
---|
| 36 | hab = WinInitialize(0);
|
---|
[551] | 37 | if (hab) {
|
---|
| 38 | hmq = WinCreateMsgQueue(hab, 2048);
|
---|
| 39 | if (hmq) {
|
---|
| 40 | if (InitFM3DLL(hab, argc, argv)) {
|
---|
| 41 | if (CheckVersion(VERMAJOR, VERMINOR)) {
|
---|
[1077] | 42 | # ifdef FORTIFY
|
---|
| 43 | Fortify_EnterScope();
|
---|
| 44 | # endif
|
---|
[551] | 45 | hwndFrame = StartFM3(hab, argc, argv);
|
---|
| 46 | if (hwndFrame != (HWND) 0) {
|
---|
| 47 | for (;;) {
|
---|
| 48 | if (!WinGetMsg(hab, &qmsg, (HWND) 0, 0, 0)) {
|
---|
| 49 | if (qmsg.hwnd)
|
---|
| 50 | qmsg.msg = WM_CLOSE;
|
---|
| 51 | else
|
---|
| 52 | break;
|
---|
| 53 | }
|
---|
| 54 | if (hwndBubble &&
|
---|
| 55 | ((qmsg.msg > (WM_BUTTON1DOWN - 1) &&
|
---|
| 56 | qmsg.msg < (WM_BUTTON3DBLCLK + 1)) ||
|
---|
| 57 | (qmsg.msg > (WM_CHORD - 1) &&
|
---|
| 58 | qmsg.msg < (WM_BUTTON3CLICK + 1))) &&
|
---|
| 59 | WinIsWindowVisible(hwndBubble))
|
---|
| 60 | WinShowWindow(hwndBubble, FALSE);
|
---|
| 61 | WinDispatchMsg(hab, &qmsg);
|
---|
| 62 | }
|
---|
| 63 | if (WinIsWindow(hab, WinWindowFromID(hwndFrame, FID_CLIENT)))
|
---|
| 64 | WinSendMsg(WinWindowFromID(hwndFrame, FID_CLIENT), WM_CLOSE,
|
---|
| 65 | MPVOID, MPVOID);
|
---|
| 66 | }
|
---|
[1077] | 67 | # ifdef FORTIFY
|
---|
| 68 | Fortify_LeaveScope();
|
---|
| 69 | # endif
|
---|
[551] | 70 | }
|
---|
[2] | 71 | }
|
---|
| 72 | DosSleep(250L);
|
---|
| 73 | WinDestroyMsgQueue(hmq);
|
---|
| 74 | }
|
---|
| 75 | WinTerminate(hab);
|
---|
| 76 | }
|
---|
| 77 | return 0;
|
---|
| 78 | }
|
---|