[907] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: vdir.c 1176 2008-09-10 21:52:46Z jbs $
|
---|
| 5 |
|
---|
| 6 | INF directory viewer applet
|
---|
| 7 |
|
---|
| 8 | Copyright (c) 1993-98 M. Kimes
|
---|
| 9 | Copyright (c) 2007, 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
|
---|
| 19 |
|
---|
| 20 | #include "dll\fm3dll.h"
|
---|
[1176] | 21 | #include "dll\init.h" // InitFM3DLL
|
---|
| 22 | #include "dll\valid.h" // IsFile
|
---|
| 23 | #include "dll\dirs.h" // save_dir
|
---|
[2] | 24 |
|
---|
[551] | 25 | int main(int argc, char *argv[])
|
---|
| 26 | {
|
---|
| 27 | HAB hab;
|
---|
| 28 | HMQ hmq;
|
---|
| 29 | QMSG qmsg;
|
---|
| 30 | HWND hwndFrame;
|
---|
| 31 | CHAR fullname[CCHMAXPATH], *thisarg = NULL;
|
---|
| 32 | INT x;
|
---|
[2] | 33 |
|
---|
[551] | 34 | strcpy(appname, "VDIR");
|
---|
[2] | 35 | DosError(FERR_DISABLEHARDERR);
|
---|
[551] | 36 | for (x = 1; x < argc; x++) {
|
---|
| 37 | if (!strchr("/;,`\'", *argv[x]) && (IsRoot(argv[x]) || !IsFile(argv[x]))) {
|
---|
[2] | 38 | thisarg = argv[x];
|
---|
| 39 | break;
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
| 42 |
|
---|
[551] | 43 | if (thisarg) {
|
---|
| 44 | if (DosQueryPathInfo(thisarg,
|
---|
| 45 | FIL_QUERYFULLNAME, fullname, sizeof(fullname)))
|
---|
| 46 | strcpy(fullname, thisarg);
|
---|
[2] | 47 | }
|
---|
| 48 | else
|
---|
| 49 | save_dir(fullname);
|
---|
| 50 | hab = WinInitialize(0);
|
---|
[551] | 51 | if (hab) {
|
---|
| 52 | hmq = WinCreateMsgQueue(hab, 1024);
|
---|
| 53 | if (hmq) {
|
---|
| 54 | if (InitFM3DLL(hab, argc, argv)) {
|
---|
| 55 | hwndFrame = StartDirCnr(HWND_DESKTOP, fullname, (HWND) 0, 0);
|
---|
| 56 | if (hwndFrame) {
|
---|
| 57 | if (hwndHelp)
|
---|
| 58 | WinAssociateHelpInstance(hwndHelp, hwndFrame);
|
---|
| 59 | for (;;) {
|
---|
| 60 | if (!WinGetMsg(hab, &qmsg, (HWND) 0, 0, 0)) {
|
---|
| 61 | if (qmsg.hwnd)
|
---|
| 62 | qmsg.msg = WM_CLOSE;
|
---|
| 63 | else
|
---|
| 64 | break;
|
---|
| 65 | }
|
---|
| 66 | if (hwndBubble &&
|
---|
| 67 | ((qmsg.msg > (WM_BUTTON1DOWN - 1) &&
|
---|
| 68 | qmsg.msg < (WM_BUTTON3DBLCLK + 1)) ||
|
---|
| 69 | (qmsg.msg > (WM_CHORD - 1) &&
|
---|
| 70 | qmsg.msg < (WM_BUTTON3CLICK + 1))) &&
|
---|
| 71 | WinIsWindowVisible(hwndBubble))
|
---|
| 72 | WinShowWindow(hwndBubble, FALSE);
|
---|
| 73 | WinDispatchMsg(hab, &qmsg);
|
---|
| 74 | }
|
---|
| 75 | }
|
---|
[2] | 76 | }
|
---|
| 77 | DosSleep(125L);
|
---|
| 78 | WinDestroyMsgQueue(hmq);
|
---|
| 79 | }
|
---|
| 80 | WinTerminate(hab);
|
---|
| 81 | }
|
---|
| 82 | return 0;
|
---|
| 83 | }
|
---|