| [907] | 1 | 
 | 
|---|
 | 2 | /***********************************************************************
 | 
|---|
 | 3 | 
 | 
|---|
 | 4 |   $Id: fm4.c 1215 2008-09-13 06:54:03Z jbs $
 | 
|---|
 | 5 | 
 | 
|---|
 | 6 |   fm/2 lite applet
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 |   Copyright (c) 1993-98 M. Kimes
 | 
|---|
 | 9 |   Copyright (c) 2008 Steven H.Levine
 | 
|---|
 | 10 | 
 | 
|---|
 | 11 |   05 Jan 08 SHL Sync
 | 
|---|
 | 12 | 
 | 
|---|
 | 13 | ***********************************************************************/
 | 
|---|
 | 14 | 
 | 
|---|
 | 15 | #include <string.h>
 | 
|---|
 | 16 | 
 | 
|---|
| [2] | 17 | #define INCL_DOS
 | 
|---|
 | 18 | #define INCL_WIN
 | 
|---|
| [907] | 19 | #define INCL_LONGLONG
 | 
|---|
| [2] | 20 | 
 | 
|---|
| [1177] | 21 | #include "dll\fm3dll.h"
 | 
|---|
| [1215] | 22 | #include "dll\mainwnd.h"                // Data declaration(s)
 | 
|---|
 | 23 | #include "dll\notebook.h"               // Data declaration(s)
 | 
|---|
| [2] | 24 | #include "dll\tools.h"
 | 
|---|
 | 25 | #include "dll\version.h"
 | 
|---|
| [1215] | 26 | #include "dll\mainwnd2.h"               // StartFM32
 | 
|---|
| [1177] | 27 | #include "dll\init.h"                   // InitFM3DLL
 | 
|---|
| [2] | 28 | 
 | 
|---|
| [551] | 29 | int main(int argc, char *argv[])
 | 
|---|
 | 30 | {
 | 
|---|
 | 31 |   HAB hab;
 | 
|---|
 | 32 |   HMQ hmq;
 | 
|---|
 | 33 |   QMSG qmsg;
 | 
|---|
 | 34 |   HWND hwndFrame;
 | 
|---|
| [2] | 35 | 
 | 
|---|
| [551] | 36 |   strcpy(appname, "FM/4");
 | 
|---|
| [2] | 37 |   {
 | 
|---|
 | 38 |     INT x;
 | 
|---|
 | 39 | 
 | 
|---|
| [551] | 40 |     for (x = 1; x < argc; x++) {
 | 
|---|
 | 41 |       if (*argv[x] == '+' && !argv[x][1])
 | 
|---|
 | 42 |         fLogFile = TRUE;
 | 
|---|
 | 43 |       if (*argv[x] == '-') {
 | 
|---|
 | 44 |         if (argv[x][1])
 | 
|---|
 | 45 |           strcpy(profile, &argv[x][1]);
 | 
|---|
| [2] | 46 |       }
 | 
|---|
 | 47 |     }
 | 
|---|
 | 48 |   }
 | 
|---|
 | 49 |   DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 50 |   hab = WinInitialize(0);
 | 
|---|
| [551] | 51 |   if (hab) {
 | 
|---|
 | 52 |     hmq = WinCreateMsgQueue(hab, 2048);
 | 
|---|
 | 53 |     if (hmq) {
 | 
|---|
 | 54 |       if (InitFM3DLL(hab, argc, argv)) {
 | 
|---|
 | 55 |         if (CheckVersion(VERMAJOR, VERMINOR)) {
 | 
|---|
 | 56 |           hwndFrame = StartFM32(hab, argc, argv);
 | 
|---|
 | 57 |           if (hwndFrame != (HWND) 0) {
 | 
|---|
 | 58 |             for (;;) {
 | 
|---|
 | 59 |               if (!WinGetMsg(hab, &qmsg, (HWND) 0, 0, 0)) {
 | 
|---|
 | 60 |                 if (qmsg.hwnd)
 | 
|---|
 | 61 |                   qmsg.msg = WM_CLOSE;
 | 
|---|
 | 62 |                 else
 | 
|---|
 | 63 |                   break;
 | 
|---|
 | 64 |               }
 | 
|---|
 | 65 |               if (hwndBubble &&
 | 
|---|
 | 66 |                   ((qmsg.msg > (WM_BUTTON1DOWN - 1) &&
 | 
|---|
 | 67 |                     qmsg.msg < (WM_BUTTON3DBLCLK + 1)) ||
 | 
|---|
 | 68 |                    (qmsg.msg > (WM_CHORD - 1) &&
 | 
|---|
 | 69 |                     qmsg.msg < (WM_BUTTON3CLICK + 1))) &&
 | 
|---|
 | 70 |                   WinIsWindowVisible(hwndBubble))
 | 
|---|
 | 71 |                 WinShowWindow(hwndBubble, FALSE);
 | 
|---|
 | 72 |               WinDispatchMsg(hab, &qmsg);
 | 
|---|
 | 73 |             }
 | 
|---|
 | 74 |             if (WinIsWindow(hab, WinWindowFromID(hwndFrame, FID_CLIENT)))
 | 
|---|
 | 75 |               WinSendMsg(WinWindowFromID(hwndFrame,
 | 
|---|
 | 76 |                                          FID_CLIENT),
 | 
|---|
 | 77 |                          WM_CLOSE, MPVOID, MPVOID);
 | 
|---|
 | 78 |           }
 | 
|---|
 | 79 |         }
 | 
|---|
| [2] | 80 |       }
 | 
|---|
 | 81 |       DosSleep(250L);
 | 
|---|
 | 82 |       WinDestroyMsgQueue(hmq);
 | 
|---|
 | 83 |     }
 | 
|---|
 | 84 |     WinTerminate(hab);
 | 
|---|
 | 85 |   }
 | 
|---|
 | 86 |   return 0;
 | 
|---|
 | 87 | }
 | 
|---|