source: trunk/vtree.c@ 1155

Last change on this file since 1155 was 1155, checked in by John Small, 17 years ago

Ticket 187: Draft 1: Functions only

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1
2/***********************************************************************
3
4 $Id: vtree.c 1155 2008-09-05 21:38:38Z jbs $
5
6 Tree viewer 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 <stdlib.h>
16#include <string.h>
17
18#define INCL_DOS
19#define INCL_WIN
20
21#include "dll\fm3dll.h"
22#include "dll\treecnr.h" // StartTreeCnr
23
24int main(int argc, char *argv[])
25{
26 HAB hab;
27 HMQ hmq;
28 QMSG qmsg;
29 INT x;
30 BOOL startminimized = FALSE;
31
32 strcpy(appname, "VTREE");
33 DosError(FERR_DISABLEHARDERR);
34 hab = WinInitialize(0);
35 if (hab) {
36 hmq = WinCreateMsgQueue(hab, 1024);
37 if (hmq) {
38 if (InitFM3DLL(hab, argc, argv)) {
39 for (x = 1; x < argc; x++) {
40 if (*argv[x] == '~') {
41 startminimized = TRUE;
42 break;
43 }
44 }
45 hwndTree = StartTreeCnr(HWND_DESKTOP, 0);
46 if (hwndTree) {
47 if (hwndHelp)
48 WinAssociateHelpInstance(hwndHelp, hwndTree);
49 if (!WinRestoreWindowPos("FM/2", "VTreeWindowPos", hwndTree)) {
50
51 SWP swp;
52 ULONG adjust;
53
54 adjust = WinQuerySysValue(HWND_DESKTOP, SV_CXICON) * 8L;
55 WinQueryTaskSizePos(hab, 0L, &swp);
56 swp.cx = min(swp.cx, adjust);
57 WinSetWindowPos(hwndTree, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy,
58 SWP_SHOW | SWP_MOVE | SWP_SIZE | SWP_ZORDER |
59 SWP_ACTIVATE);
60 }
61 if (startminimized)
62 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE);
63 else
64 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 0, 0,
65 SWP_SHOW | SWP_ZORDER | SWP_ACTIVATE);
66 for (;;) {
67 if (!WinGetMsg(hab, &qmsg, (HWND) 0, 0, 0)) {
68 if (qmsg.hwnd)
69 qmsg.msg = WM_CLOSE;
70 else
71 break;
72 }
73 if (hwndBubble &&
74 ((qmsg.msg > (WM_BUTTON1DOWN - 1) &&
75 qmsg.msg < (WM_BUTTON3DBLCLK + 1)) ||
76 (qmsg.msg > (WM_CHORD - 1) &&
77 qmsg.msg < (WM_BUTTON3CLICK + 1))) &&
78 WinIsWindowVisible(hwndBubble))
79 WinShowWindow(hwndBubble, FALSE);
80 WinDispatchMsg(hab, &qmsg);
81 }
82 }
83 }
84 DosSleep(125);
85 WinDestroyMsgQueue(hmq);
86 }
87 WinTerminate(hab);
88 }
89 return 0;
90}
Note: See TracBrowser for help on using the repository browser.