source: branches/ticket_150/vdir.c@ 869

Last change on this file since 869 was 551, checked in by Gregg Young, 18 years ago

Indentation cleanup

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
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
12int main(int argc, char *argv[])
13{
14
15 HAB hab;
16 HMQ hmq;
17 QMSG qmsg;
18 HWND hwndFrame;
19 CHAR fullname[CCHMAXPATH], *thisarg = NULL;
20 INT x;
21
22 strcpy(appname, "VDIR");
23 DosError(FERR_DISABLEHARDERR);
24 for (x = 1; x < argc; x++) {
25 if (!strchr("/;,`\'", *argv[x]) && (IsRoot(argv[x]) || !IsFile(argv[x]))) {
26 thisarg = argv[x];
27 break;
28 }
29 }
30
31 if (thisarg) {
32 if (DosQueryPathInfo(thisarg,
33 FIL_QUERYFULLNAME, fullname, sizeof(fullname)))
34 strcpy(fullname, thisarg);
35 }
36 else
37 save_dir(fullname);
38 hab = WinInitialize(0);
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 }
64 }
65 DosSleep(125L);
66 WinDestroyMsgQueue(hmq);
67 }
68 WinTerminate(hab);
69 }
70 return 0;
71}
Note: See TracBrowser for help on using the repository browser.