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