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