Changeset 1155 for trunk/vtree.c


Ignore:
Timestamp:
Sep 5, 2008, 11:38:38 PM (17 years ago)
Author:
John Small
Message:

Ticket 187: Draft 1: Functions only

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/vtree.c

    r907 r1155  
    2020
    2121#include "dll\fm3dll.h"
     22#include "dll\treecnr.h"                        // StartTreeCnr
    2223
    2324int main(int argc, char *argv[])
     
    3637    if (hmq) {
    3738      if (InitFM3DLL(hab, argc, argv)) {
    38         for (x = 1; x < argc; x++) {
    39           if (*argv[x] == '~') {
    40             startminimized = TRUE;
    41             break;
    42           }
    43         }
    44         hwndTree = StartTreeCnr(HWND_DESKTOP, 0);
    45         if (hwndTree) {
    46           if (hwndHelp)
    47             WinAssociateHelpInstance(hwndHelp, hwndTree);
    48           if (!WinRestoreWindowPos("FM/2", "VTreeWindowPos", hwndTree)) {
     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)) {
    4950
    50             SWP swp;
    51             ULONG adjust;
     51            SWP swp;
     52            ULONG adjust;
    5253
    53             adjust = WinQuerySysValue(HWND_DESKTOP, SV_CXICON) * 8L;
    54             WinQueryTaskSizePos(hab, 0L, &swp);
    55             swp.cx = min(swp.cx, adjust);
    56             WinSetWindowPos(hwndTree, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy,
    57                             SWP_SHOW | SWP_MOVE | SWP_SIZE | SWP_ZORDER |
    58                             SWP_ACTIVATE);
    59           }
    60           if (startminimized)
    61             WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE);
    62           else
    63             WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 0, 0,
    64                             SWP_SHOW | SWP_ZORDER | SWP_ACTIVATE);
    65           for (;;) {
    66             if (!WinGetMsg(hab, &qmsg, (HWND) 0, 0, 0)) {
    67               if (qmsg.hwnd)
    68                 qmsg.msg = WM_CLOSE;
    69               else
    70                 break;
    71             }
    72             if (hwndBubble &&
    73                 ((qmsg.msg > (WM_BUTTON1DOWN - 1) &&
    74                   qmsg.msg < (WM_BUTTON3DBLCLK + 1)) ||
    75                 (qmsg.msg > (WM_CHORD - 1) &&
    76                   qmsg.msg < (WM_BUTTON3CLICK + 1))) &&
    77                 WinIsWindowVisible(hwndBubble))
    78               WinShowWindow(hwndBubble, FALSE);
    79             WinDispatchMsg(hab, &qmsg);
    80           }
    81         }
     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        }
    8283      }
    8384      DosSleep(125);
Note: See TracChangeset for help on using the changeset viewer.