[2] | 1 | #define INCL_DOS
|
---|
| 2 | #define INCL_WIN
|
---|
| 3 |
|
---|
| 4 | #include <os2.h>
|
---|
| 5 | #include <stdarg.h>
|
---|
| 6 | #include <stdio.h>
|
---|
| 7 | #include <stdlib.h>
|
---|
| 8 | #include <string.h>
|
---|
| 9 | #include <ctype.h>
|
---|
| 10 | #include "dll\fm3dll.h"
|
---|
| 11 |
|
---|
[551] | 12 | int main(int argc, char *argv[])
|
---|
| 13 | {
|
---|
[2] | 14 |
|
---|
[551] | 15 | HAB hab;
|
---|
| 16 | HMQ hmq;
|
---|
| 17 | QMSG qmsg;
|
---|
| 18 | HWND hwndFrame;
|
---|
| 19 | CHAR fullname[CCHMAXPATH], *thisarg = NULL;
|
---|
| 20 | INT x;
|
---|
[2] | 21 |
|
---|
[551] | 22 | strcpy(appname, "VDIR");
|
---|
[2] | 23 | DosError(FERR_DISABLEHARDERR);
|
---|
[551] | 24 | for (x = 1; x < argc; x++) {
|
---|
| 25 | if (!strchr("/;,`\'", *argv[x]) && (IsRoot(argv[x]) || !IsFile(argv[x]))) {
|
---|
[2] | 26 | thisarg = argv[x];
|
---|
| 27 | break;
|
---|
| 28 | }
|
---|
| 29 | }
|
---|
| 30 |
|
---|
[551] | 31 | if (thisarg) {
|
---|
| 32 | if (DosQueryPathInfo(thisarg,
|
---|
| 33 | FIL_QUERYFULLNAME, fullname, sizeof(fullname)))
|
---|
| 34 | strcpy(fullname, thisarg);
|
---|
[2] | 35 | }
|
---|
| 36 | else
|
---|
| 37 | save_dir(fullname);
|
---|
| 38 | hab = WinInitialize(0);
|
---|
[551] | 39 | if (hab) {
|
---|
| 40 | hmq = WinCreateMsgQueue(hab, 1024);
|
---|
| 41 | if (hmq) {
|
---|
| 42 | if (InitFM3DLL(hab, argc, argv)) {
|
---|
| 43 | hwndFrame = StartDirCnr(HWND_DESKTOP, fullname, (HWND) 0, 0);
|
---|
| 44 | if (hwndFrame) {
|
---|
| 45 | if (hwndHelp)
|
---|
| 46 | WinAssociateHelpInstance(hwndHelp, hwndFrame);
|
---|
| 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 | }
|
---|
[2] | 64 | }
|
---|
| 65 | DosSleep(125L);
|
---|
| 66 | WinDestroyMsgQueue(hmq);
|
---|
| 67 | }
|
---|
| 68 | WinTerminate(hab);
|
---|
| 69 | }
|
---|
| 70 | return 0;
|
---|
| 71 | }
|
---|