Changeset 1455 for trunk/dll/mainwnd.c


Ignore:
Timestamp:
Sep 15, 2009, 4:43:55 AM (16 years ago)
Author:
Steven Levine
Message:

Blink thread LEDs while worker threads are working
Drop expermental code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/mainwnd.c

    r1454 r1455  
    8585  19 Mar 09 GKY Moved DeletePresParams to presparam.c
    8686  28 Mar 09 GKY Add RemoveOldCnrSwitches to remove pre 3.16 style ini keys;
    87                 add State.version key for check
     87                add State.version key for check
    8888  07 Jun 09 GKY Fix IDM_BLINK to not leave a DataBar? on the screen when fDataMin is TRUE.
    8989  21 Jun 09 GKY Added drive letter to bitmap buttons in drive bar; Eliminate static drive
    90                 letter windows; Use button ID to identify drive letter for processing.
     90                letter windows; Use button ID to identify drive letter for processing.
    9191  12 Jul 09 GKY Removed duplicate UM_SETUP2 message from RestoreDirCnrState caused dbl dir
    92                 listings in tree
     92                listings in tree
    9393  13 Jul 09 GKY Fixed under allocation of memory in the paint code for the drivebar bitmap buttons
    9494  22 Jul 09 GKY Drivebar enhancements add refresh removable, rescan all drives, drive button
    95                 loads drive root directory in directory container or expands drive tree
    96                 and rescans drive in tree container depending on container focus, greyed out
    97                 inappropriate menu context choices
     95                loads drive root directory in directory container or expands drive tree
     96                and rescans drive in tree container depending on container focus, greyed out
     97                inappropriate menu context choices
    9898  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
    9999  12 Sep 09 GKY Add FM3.INI User ini and system ini to submenu for view ini
     100  14 Sep 09 SHL Blink thread LEDs when workers busy
    100101
    101102***********************************************************************/
     
    108109#define INCL_DOS
    109110#define INCL_WIN
    110 #define INCL_SHLERRORS                  // PMERR_NOT_IN_IDX
     111#define INCL_SHLERRORS                  // PMERR_NOT_IN_IDX
    111112#define INCL_WINHELP
    112113#define INCL_GPI
     
    126127#include "comp.h"
    127128#include "datamin.h"
    128 #include "pathutil.h"                   // BldQuotedFileName
    129 #include "errutil.h"                    // Dos_Error...
    130 #include "strutil.h"                    // GetPString
    131 #include "notebook.h"                   // CfgDlgProc CfgMenuInit
    132 #include "command.h"                    // LINKCMDS
    133 #include "avl.h"                        // free_archivers
    134 #include "walkem.h"                     // free_setups...
    135 #include "key.h"                        // AboutDlgProc
    136 #include "menu.h"                       // AddToMenu
     129#include "pathutil.h"                   // BldQuotedFileName
     130#include "errutil.h"                    // Dos_Error...
     131#include "strutil.h"                    // GetPString
     132#include "notebook.h"                   // CfgDlgProc CfgMenuInit
     133#include "command.h"                    // LINKCMDS
     134#include "avl.h"                        // free_archivers
     135#include "walkem.h"                     // free_setups...
     136#include "key.h"                        // AboutDlgProc
     137#include "menu.h"                       // AddToMenu
    137138#include "mainwnd.h"
    138 #include "cmdline.h"                    // CmdLine2DlgProc, save_cmdlines
    139 #include "common.h"                     // CommonCreateMainChildren, CommonDriveCmd, CommonMainWndProc
     139#include "cmdline.h"                    // CmdLine2DlgProc, save_cmdlines
     140#include "common.h"                     // CommonCreateMainChildren, CommonDriveCmd, CommonMainWndProc
    140141                                        // CommonTextButton
    141 #include "notify.h"                     // DoNotify, HideNote, ShowNote
    142 #include "draglist.h"                   // DragOne
     142#include "notify.h"                     // DoNotify, HideNote, ShowNote
     143#include "draglist.h"                   // DragOne
    143144#include "chklist.h"                    // DropListProc
    144145#include "avv.h"                        // EditArchiverDefinition
     
    266267      switch (id) {
    267268      case IDM_RESCAN:
    268         strcpy(s, GetPString(IDS_RESCANALLDRIVESTEXT));
    269         break;
     269        strcpy(s, GetPString(IDS_RESCANALLDRIVESTEXT));
     270        break;
    270271
    271272      case IDM_REFRESHREMOVABLES:
    272         strcpy(s, GetPString(IDS_REFRESHREMOVABLESTEXT));
    273         break;
     273        strcpy(s, GetPString(IDS_REFRESHREMOVABLESTEXT));
     274        break;
    274275
    275276      default:
    276         *dv = 0;
    277         *dv = id - IDM_DRIVEA + 'A';
    278         strcpy(dv + 1, ":");
    279         d = toupper(*dv);
    280         if (isalpha(d) && d > 'B' &&
    281             !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID |
    282                                      DRIVE_SLOW)) &&
    283             (!hwndBubble ||
    284              WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&
    285             !WinQueryCapture(HWND_DESKTOP)) {
    286  
    287           FSALLOCATE fsa;
    288           CHAR szQty[38];
    289           ULONG ulPctFree;
    290           ULONGLONG ullFreeQty;
    291  
    292           if (!DosQueryFSInfo((d - 'A') + 1,
    293                               FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) {
    294             ullFreeQty = (ULONGLONG) fsa.cUnitAvail *
    295               (fsa.cSectorUnit * fsa.cbSector);
    296             ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ?
    297               (fsa.cUnitAvail * 100) / fsa.cUnit : 0;
    298             CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' ');
    299             sprintf(s, "%s %s (%lu%%) %s", dv, szQty, ulPctFree, GetPString(IDS_FREETEXT));
    300           }
    301         }
     277        *dv = 0;
     278        *dv = id - IDM_DRIVEA + 'A';
     279        strcpy(dv + 1, ":");
     280        d = toupper(*dv);
     281        if (isalpha(d) && d > 'B' &&
     282            !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID |
     283                                     DRIVE_SLOW)) &&
     284            (!hwndBubble ||
     285             WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&
     286            !WinQueryCapture(HWND_DESKTOP)) {
     287
     288          FSALLOCATE fsa;
     289          CHAR szQty[38];
     290          ULONG ulPctFree;
     291          ULONGLONG ullFreeQty;
     292
     293          if (!DosQueryFSInfo((d - 'A') + 1,
     294                              FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) {
     295            ullFreeQty = (ULONGLONG) fsa.cUnitAvail *
     296              (fsa.cSectorUnit * fsa.cbSector);
     297            ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ?
     298              (fsa.cUnitAvail * 100) / fsa.cUnit : 0;
     299            CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' ');
     300            sprintf(s, "%s %s (%lu%%) %s", dv, szQty, ulPctFree, GetPString(IDS_FREETEXT));
     301          }
     302        }
    302303      }
    303304      if ((!hwndBubble ||
    304            WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&
    305           !WinQueryCapture(HWND_DESKTOP))
    306         WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID);
     305           WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&
     306          !WinQueryCapture(HWND_DESKTOP))
     307        WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID);
    307308    }
    308309    return 0;
     
    879880    id = WinQueryWindowUShort(hwnd, QWS_ID);
    880881    if (id == CBID_EDIT &&
    881         WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID) ==
     882        WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID) ==
    882883        MAIN_USERLIST) {
    883884
     
    12131214    {
    12141215      MRESULT mr = PFNWPStatic(hwnd, msg, mp1, mp2);
    1215       HBITMAP hbmold = (HBITMAP) 0;
    1216       HPS hps = (HPS) 0;
    12171216
    12181217      switch (WinQueryWindowUShort(hwnd, QWS_ID)) {
    12191218      case MAIN_LED:
    1220         hps = WinGetPS(hwnd);
    1221         hbmold = (HBITMAP) WinSendMsg(hwnd, SM_QUERYHANDLE, MPVOID, MPVOID);
    1222         if (!fBlueLED) {
    1223           hbmLEDon = GpiLoadBitmap(hps, 0, LEDON_BMP, 12, 12);
    1224           hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF_BMP, 12, 12);
    1225         }
    1226         else {
    1227           hbmLEDon = GpiLoadBitmap(hps, 0, LEDON2_BMP, 12, 12);
    1228           hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF2_BMP, 12, 12);
    1229         }
    1230         if (hbmLEDoff && hbmLEDon)
    1231           WinSendMsg(hwnd, SM_SETHANDLE, MPFROMLONG(hbmLEDoff), MPVOID);
    1232         else {
    1233           if (hbmLEDoff)
    1234             GpiDeleteBitmap(hbmLEDoff);
    1235           if (hbmLEDon)
    1236             GpiDeleteBitmap(hbmLEDon);
    1237         }
    1238         if (hbmold &&
    1239             hbmLEDon &&
    1240             hbmLEDoff && hbmold != hbmLEDon && hbmold != hbmLEDoff)
    1241           GpiDeleteBitmap(hbmold);
    1242         if (hps)
    1243           WinReleasePS(hps);
     1219        {
     1220          HPS hps = WinGetPS(hwnd);
     1221          HBITMAP hbmold = (HBITMAP)WinSendMsg(hwnd, SM_QUERYHANDLE, MPVOID, MPVOID);
     1222          if (!fBlueLED) {
     1223            hbmLEDon = GpiLoadBitmap(hps, 0, LEDON_BMP, 12, 12);
     1224            hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF_BMP, 12, 12);
     1225          }
     1226          else {
     1227            hbmLEDon = GpiLoadBitmap(hps, 0, LEDON2_BMP, 12, 12);
     1228            hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF2_BMP, 12, 12);
     1229          }
     1230          if (hbmLEDoff && hbmLEDon)
     1231            WinSendMsg(hwnd, SM_SETHANDLE, MPFROMLONG(hbmLEDoff), MPVOID);
     1232          else {
     1233            if (hbmLEDoff)
     1234              GpiDeleteBitmap(hbmLEDoff);
     1235            if (hbmLEDon)
     1236              GpiDeleteBitmap(hbmLEDon);
     1237          }
     1238          if (hbmold &&
     1239              hbmLEDon &&
     1240              hbmLEDoff && hbmold != hbmLEDon && hbmold != hbmLEDoff)
     1241            GpiDeleteBitmap(hbmold);
     1242          if (hps)
     1243            WinReleasePS(hps);
     1244        }
    12441245        break;
    12451246      default:
     
    18591860    case IDM_RESCAN:
    18601861      {
    1861         BOOL toggleTree = FALSE;
    1862  
    1863         if (!hwndTree) {
    1864           WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
    1865           toggleTree = TRUE;
    1866         }
    1867         WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
    1868         if (toggleTree)
    1869           WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     1862        BOOL toggleTree = FALSE;
     1863
     1864        if (!hwndTree) {
     1865          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     1866          toggleTree = TRUE;
     1867        }
     1868        WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
     1869        if (toggleTree)
     1870          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
    18701871      }
    18711872      break;
    18721873    case IDM_REFRESHREMOVABLES:
    18731874      {
    1874         BOOL toggleTree = FALSE;
    1875  
    1876         if (!hwndTree) {
    1877           WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
    1878           toggleTree = TRUE;
    1879         }
    1880         WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_REFRESHREMOVABLES, 0), MPVOID);
    1881         if (toggleTree)
    1882           WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     1875        BOOL toggleTree = FALSE;
     1876
     1877        if (!hwndTree) {
     1878          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
     1879          toggleTree = TRUE;
     1880        }
     1881        WinSendMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_REFRESHREMOVABLES, 0), MPVOID);
     1882        if (toggleTree)
     1883          WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_VTREE, 0), MPVOID);
    18831884      }
    18841885      break;
    18851886    default:
    18861887      {
    1887         CHAR dv[4];
    1888  
    1889         *dv = SHORT1FROMMP(mp1) - IDM_DRIVEA + 'A';
    1890         strcpy(dv + 1, ":\\");
    1891         if (isalpha(*dv)) {
    1892  
    1893           HWND hwndActive;
    1894  
    1895           dv[1] = ':';
    1896           dv[2] = '\\';
    1897           dv[3] = 0;
    1898           hwndActive = TopWindow(hwnd, (HWND) 0);
    1899           if (hwndActive)
    1900             WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT),
    1901                        UM_DRIVECMD, MPFROMP(dv), MPVOID);
    1902         }
     1888        CHAR dv[4];
     1889
     1890        *dv = SHORT1FROMMP(mp1) - IDM_DRIVEA + 'A';
     1891        strcpy(dv + 1, ":\\");
     1892        if (isalpha(*dv)) {
     1893
     1894          HWND hwndActive;
     1895
     1896          dv[1] = ':';
     1897          dv[2] = '\\';
     1898          dv[3] = 0;
     1899          hwndActive = TopWindow(hwnd, (HWND) 0);
     1900          if (hwndActive)
     1901            WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT),
     1902                       UM_DRIVECMD, MPFROMP(dv), MPVOID);
     1903        }
    19031904      }
    19041905    }
     
    19321933      id = WinQueryWindowUShort(hwnd, QWS_ID);
    19331934      if (helpid != id) {
    1934         helpid = id;
     1935        helpid = id;
    19351936        PostMsg(MainObjectHwnd, UM_SETUP6, MPFROMLONG((ULONG) hwnd), MPVOID);
    19361937      }
     
    19421943  case WM_PAINT:
    19431944    {
    1944       HPS hps; 
     1945      HPS hps;
    19451946      POINTL aptl[4] = {0, 0, DRIVE_BUTTON_WIDTH - 1, DRIVE_BUTTON_HEIGHT - 1,
    19461947      0, 0, DRIVE_BUTTON_WIDTH - 1, DRIVE_BUTTON_HEIGHT - 1};
     
    19551956      id = WinQueryWindowUShort(hwnd, QWS_ID);
    19561957      if (id == IDM_REFRESHREMOVABLES || id == IDM_RESCAN)
    1957         break;
     1958        break;
    19581959      *szDrv = 0;
    19591960      x = id - IDM_DRIVEA;
     
    19651966          else
    19661967            iconid = (driveflags[x] & DRIVE_REMOVABLE) ?
    1967                       REMOVABLE_ICON :
     1968                      REMOVABLE_ICON :
    19681969                     (driveflags[x] & DRIVE_VIRTUAL) ?
    19691970                      VIRTUAL_ICON :
    1970                      (driveflags[x] & DRIVE_REMOTE) ?
    1971                       REMOTE_ICON :
     1971                     (driveflags[x] & DRIVE_REMOTE) ?
     1972                      REMOTE_ICON :
    19721973                     (driveflags[x] & DRIVE_RAMDISK) ?
    19731974                      RAMDISK_ICON :
    19741975                     (driveflags[x] & DRIVE_ZIPSTREAM) ?
    1975                       ZIPSTREAM_ICON :
    1976                      (driveflags[x] & DRIVE_LOCALHD) ?
    1977                       DRIVE_ICON : DONNO_ICON;
     1976                      ZIPSTREAM_ICON :
     1977                     (driveflags[x] & DRIVE_LOCALHD) ?
     1978                      DRIVE_ICON : DONNO_ICON;
    19781979        }
    19791980        else
    1980           iconid = FLOPPY_ICON;
     1981          iconid = FLOPPY_ICON;
    19811982      hps = WinBeginPaint(hwnd, (HPS) 0, NULL);
    19821983      if (hps) {
    1983         hbm = GpiLoadBitmap(hps, 0, iconid, 0, 0);
    1984         if (hbm) {
    1985           pbmpData = xmallocz(sizeof(PBITMAPINFOHEADER) * 3, pszSrcFile, __LINE__);
    1986           if (pbmpData) {
    1987             GpiQueryBitmapParameters(hbm, pbmpData);
    1988             aptl[1].x = pbmpData->cx;
    1989             aptl[1].y = pbmpData->cy;
    1990             aptl[3].x = pbmpData->cx;
    1991             aptl[3].y = pbmpData->cy;
    1992             GpiWCBitBlt(hps, hbm, 4L, aptl, ROP_SRCCOPY, BBO_PAL_COLORS);
    1993             free(pbmpData);
    1994           }
    1995         }
    1996         memset(&fat, 0, sizeof(fat));
    1997         fat.usRecordLength = sizeof(FATTRS);
    1998         fat.fsSelection = FATTR_SEL_BOLD ;
    1999         fat.usCodePage = 850;
    2000         fat.fsFontUse = FATTR_FONTUSE_NOMIX;
    2001         strcpy(fat.szFacename , FNT_HELVETICA);
    2002         x = GpiCreateLogFont(hps, NULL, DRIVEBAR_FONT_LCID, &fat);
    2003         if (x != GPI_ERROR) {
    2004           GpiSetCharSet(hps, DRIVEBAR_FONT_LCID);
    2005           sizfCharBox.cx = MAKEFIXED(10,0); //Font size
    2006           sizfCharBox.cy = MAKEFIXED(14,0);
    2007           GpiSetCharBox( hps, &sizfCharBox );
    2008           GpiSetColor(hps, iconid == RAMDISK_ICON ? CLR_YELLOW : CLR_DARKBLUE);
    2009           ptlStart.x = 1L;  //Char box position
    2010           ptlStart.y = 8L;
    2011           GpiCharStringAt(hps, &ptlStart, strlen(szDrv), szDrv);
    2012           GpiDeleteSetId(hps, DRIVEBAR_FONT_LCID);
    2013         }
    2014         WinEndPaint(hps);
     1984        hbm = GpiLoadBitmap(hps, 0, iconid, 0, 0);
     1985        if (hbm) {
     1986          pbmpData = xmallocz(sizeof(PBITMAPINFOHEADER) * 3, pszSrcFile, __LINE__);
     1987          if (pbmpData) {
     1988            GpiQueryBitmapParameters(hbm, pbmpData);
     1989            aptl[1].x = pbmpData->cx;
     1990            aptl[1].y = pbmpData->cy;
     1991            aptl[3].x = pbmpData->cx;
     1992            aptl[3].y = pbmpData->cy;
     1993            GpiWCBitBlt(hps, hbm, 4L, aptl, ROP_SRCCOPY, BBO_PAL_COLORS);
     1994            free(pbmpData);
     1995          }
     1996        }
     1997        memset(&fat, 0, sizeof(fat));
     1998        fat.usRecordLength = sizeof(FATTRS);
     1999        fat.fsSelection = FATTR_SEL_BOLD ;
     2000        fat.usCodePage = 850;
     2001        fat.fsFontUse = FATTR_FONTUSE_NOMIX;
     2002        strcpy(fat.szFacename , FNT_HELVETICA);
     2003        x = GpiCreateLogFont(hps, NULL, DRIVEBAR_FONT_LCID, &fat);
     2004        if (x != GPI_ERROR) {
     2005          GpiSetCharSet(hps, DRIVEBAR_FONT_LCID);
     2006          sizfCharBox.cx = MAKEFIXED(10,0); //Font size
     2007          sizfCharBox.cy = MAKEFIXED(14,0);
     2008          GpiSetCharBox( hps, &sizfCharBox );
     2009          GpiSetColor(hps, iconid == RAMDISK_ICON ? CLR_YELLOW : CLR_DARKBLUE);
     2010          ptlStart.x = 1L;  //Char box position
     2011          ptlStart.y = 8L;
     2012          GpiCharStringAt(hps, &ptlStart, strlen(szDrv), szDrv);
     2013          GpiDeleteSetId(hps, DRIVEBAR_FONT_LCID);
     2014        }
     2015        WinEndPaint(hps);
    20152016      }
    20162017    }
     
    20572058        UINT iDrv;
    20582059
    2059         strcat(szDrv, PCSZ_BACKSLASH);
     2060        strcat(szDrv, PCSZ_BACKSLASH);
    20602061        MakeValidDir(szDrv);
    2061         // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c
    2062         local = ~driveflags[iDrv] & DRIVE_REMOTE && ~driveflags[iDrv] & DRIVE_VIRTUAL &&
    2063                 ~driveflags[iDrv] & DRIVE_RAMDISK;
     2062        // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c
     2063        local = ~driveflags[iDrv] & DRIVE_REMOTE && ~driveflags[iDrv] & DRIVE_VIRTUAL &&
     2064                ~driveflags[iDrv] & DRIVE_RAMDISK;
    20642065        rdy = toupper(*szDrv) == toupper(chDrv);
    2065         iDrv = toupper(*szDrv) - 'A';
     2066        iDrv = toupper(*szDrv) - 'A';
    20662067        if (!rdy || ~driveflags[iDrv] & DRIVE_REMOTE)
    2067           WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE);
    2068 
    2069         if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE)
    2070           WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE);
     2068          WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE);
     2069
     2070        if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE)
     2071          WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE);
    20712072
    20722073        if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE || !local) {
     
    20842085          WinEnableMenuItem(hwndMenu, IDM_ARCHIVE, FALSE);
    20852086          WinEnableMenuItem(hwndMenu, IDM_SIZES, FALSE);
    2086           WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE);
    2087 
    2088         if (!rdy || !local)
     2087          WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE);
     2088
     2089        if (!rdy || !local)
    20892090          WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE);
    20902091        }
     
    23332334VOID BuildDriveBarButtons(HWND hwndT)
    23342335{
    2335   register ULONG x; 
    2336   ULONG ulDriveNum, ulDriveMap; 
     2336  register ULONG x;
     2337  ULONG ulDriveNum, ulDriveMap;
    23372338  HENUM henum;
    23382339  HWND hwndB;
     
    23522353                                WC_DRIVEBUTTONS,
    23532354                                0,
    2354                                 BS_NOPOINTERFOCUS | BS_USERBUTTON,
     2355                                BS_NOPOINTERFOCUS | BS_USERBUTTON,
    23552356                                0,
    23562357                                0,
     
    23602361        if (!hwndB)
    23612362          Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    2362                     PCSZ_WINCREATEWINDOW);
    2363         else {
     2363                    PCSZ_WINCREATEWINDOW);
     2364        else {
    23642365          WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);
    23652366        }
     
    23672368    }                                   // for
    23682369    hwndB = WinCreateWindow(hwndT,
    2369                             WC_DRIVEBUTTONS,
    2370                             "#7001",
    2371                             BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,
    2372                             0,
    2373                             0,
    2374                             DRIVE_BUTTON_WIDTH,
    2375                             DRIVE_BUTTON_HEIGHT,
    2376                             hwndT, HWND_TOP, IDM_REFRESHREMOVABLES, NULL, NULL);
     2370                            WC_DRIVEBUTTONS,
     2371                            "#7001",
     2372                            BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,
     2373                            0,
     2374                            0,
     2375                            DRIVE_BUTTON_WIDTH,
     2376                            DRIVE_BUTTON_HEIGHT,
     2377                            hwndT, HWND_TOP, IDM_REFRESHREMOVABLES, NULL, NULL);
    23772378  if (!hwndB)
    23782379    Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
    23792380              PCSZ_WINCREATEWINDOW);
    23802381  hwndB = WinCreateWindow(hwndT,
    2381                           WC_DRIVEBUTTONS,
    2382                           "#7000",
    2383                           BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,
    2384                           0,
    2385                           0,
    2386                           DRIVE_BUTTON_WIDTH,
    2387                           DRIVE_BUTTON_HEIGHT,
    2388                           hwndT, HWND_TOP, IDM_RESCAN, NULL, NULL);
     2382                          WC_DRIVEBUTTONS,
     2383                          "#7000",
     2384                          BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,
     2385                          0,
     2386                          0,
     2387                          DRIVE_BUTTON_WIDTH,
     2388                          DRIVE_BUTTON_HEIGHT,
     2389                          hwndT, HWND_TOP, IDM_RESCAN, NULL, NULL);
    23892390  if (!hwndB)
    23902391    Win_Error(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,
     
    24152416    WinSetWindowPos(hwndB,
    24162417                    HWND_TOP,
    2417                     ctrlxpos, ctrlypos, ctrlxsize, DRIVE_BUTTON_HEIGHT, SWP_MOVE | SWP_SHOW);
     2418                    ctrlxpos, ctrlypos, ctrlxsize, DRIVE_BUTTON_HEIGHT, SWP_MOVE | SWP_SHOW);
    24182419    ctrlxpos += (ctrlxsize + 2);
    24192420    if (ctrlxpos + (DRIVE_BUTTON_WIDTH + 2 + ((fShowTarget && DriveLines == 0) ?
    2420                           256 : 0)) > xwidth) {
     2421                          256 : 0)) > xwidth) {
    24212422      ctrlxpos = 1;
    24222423      ctrlypos += DRIVE_BUTTON_HEIGHT;
     
    26272628                                hwnd, HWND_TOP, COMMAND_BUTTON, NULL, NULL);
    26282629        if (!hwndB)
    2629           Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    2630                     PCSZ_WINCREATEWINDOW);
     2630          Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     2631                    PCSZ_WINCREATEWINDOW);
    26312632        hwndE = WinCreateWindow(hwnd,
    26322633                                WC_ENTRYFIELD,
     
    26392640                                hwnd, HWND_TOP, COMMAND_LINE, NULL, NULL);
    26402641        if (!hwndE)
    2641           Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    2642                     PCSZ_WINCREATEWINDOW);
     2642          Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
     2643                    PCSZ_WINCREATEWINDOW);
    26432644        if (!hwndE || !hwndB) {
    26442645          PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
     
    30773078              continue;
    30783079            }
    3079             sprintf(szKeyBase, "%sDirCnr.%lu", szPrefix, numsaves);
    3080             strcpy(szKey, szKeyBase);
    3081             strcat(szKey, ".");
    3082             eos = &szKey[strlen(szKey)];
    3083             strcpy(eos, "Pos");
     3080            sprintf(szKeyBase, "%sDirCnr.%lu", szPrefix, numsaves);
     3081            strcpy(szKey, szKeyBase);
     3082            strcat(szKey, ".");
     3083            eos = &szKey[strlen(szKey)];
     3084            strcpy(eos, "Pos");
    30843085            PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & swp,
    30853086                                sizeof(SWP));
    30863087            dcd = WinQueryWindowPtr(WinWindowFromID(hwndC, DIR_CNR), QWL_USER);
    3087             if (dcd) {
    3088               strcpy(eos, "Sort");
     3088            if (dcd) {
     3089              strcpy(eos, "Sort");
    30893090              PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->sortFlags,
    3090                                   sizeof(INT));
    3091               strcpy(eos, "Filter");
     3091                                  sizeof(INT));
     3092              strcpy(eos, "Filter");
    30923093              PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->mask,
    3093                                   sizeof(MASK));
    3094               strcpy(eos, "View");
     3094                                  sizeof(MASK));
     3095              strcpy(eos, "View");
    30953096              flWindowAttr = dcd->flWindowAttr;
    30963097              if (!fLeaveTree && (flWindowAttr & CV_TREE)) {
     
    31113112              PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) &flWindowAttr,
    31123113                                  sizeof(ULONG));
    3113               WriteDetailsSwitches(szKeyBase, &dcd->ds, TRUE);
     3114              WriteDetailsSwitches(szKeyBase, &dcd->ds, TRUE);
    31143115              SavePresParams(hwndDir, szKeyBase);
    3115             }
    3116             strcpy(eos, "Dir");
     3116            }
     3117            strcpy(eos, "Dir");
    31173118            PrfWriteProfileString(fmprof, FM3Str, szKey, szDir);
    3118             numsaves++;
     3119            numsaves++;
    31193120          }
    31203121        }
     
    31323133    if (!size && fSaveState) {
    31333134      for (ulTemp = 0; ulTemp < previous_numsaves; ulTemp++)
    3134         RemoveOldCnrSwitches(szPrefix, ulTemp);
     3135        RemoveOldCnrSwitches(szPrefix, ulTemp);
    31353136       sprintf(szKey, "%sVersion", szPrefix);
    31363137       PrfWriteProfileString(fmprof, FM3Str, szKey, "3.16");
     
    33233324          if (fIsShutDownState &&
    33243325              driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) {
    3325             RemoveCnrSwitches(szKeyBase, NULL);
    3326             RemoveOldCnrSwitches(szPrefix, x);
     3326            RemoveCnrSwitches(szKeyBase, NULL);
     3327            RemoveOldCnrSwitches(szPrefix, x);
    33273328            continue;
    33283329          }
    3329           LoadDetailsSwitches(szKeyBase, &localdcd.ds, TRUE);
     3330          LoadDetailsSwitches(szKeyBase, &localdcd.ds, TRUE);
    33303331          hwndDir = (HWND) WinSendMsg(hwndClient,
    33313332                                      UM_SETDIR,
     
    33643365                dcd->ds.detailslatime   = localdcd.ds.detailslatime  ;
    33653366                dcd->ds.detailslwdate   = localdcd.ds.detailslwdate  ;
    3366                 dcd->ds.detailslwtime   = localdcd.ds.detailslwtime  ;
    3367                 strcpy(eos, "Sort");
     3367                dcd->ds.detailslwtime   = localdcd.ds.detailslwtime  ;
     3368                strcpy(eos, "Sort");
    33683369                size = sizeof(INT);
    33693370                if (PrfQueryProfileData(fmprof,
     
    33753376                    dcd->sortFlags = SORT_PATHNAME;
    33763377                }
    3377                 size = sizeof(MASK);
    3378                 strcpy(eos, "Filter");
     3378                size = sizeof(MASK);
     3379                strcpy(eos, "Filter");
    33793380                if (PrfQueryProfileData(fmprof,
    33803381                                        FM3Str,
     
    33863387                }
    33873388                *(dcd->mask.prompt) = 0;
    3388                 strcpy(eos, "View");
     3389                strcpy(eos, "View");
    33893390                if (!noview) {
    33903391                  size = sizeof(ULONG);
     
    34123413                }
    34133414                if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL))
    3414                   WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL); 
     3415                  WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL);
    34153416              }
    34163417            }
     
    34353436                              SWP_SIZE | SWP_SHOW |  SWP_ZORDER |
    34363437                              SWP_ACTIVATE);
    3437           }
    3438           if (fDeleteState)
    3439             RemoveCnrSwitches(szKeyBase, pszStateName);
     3438          }
     3439          if (fDeleteState)
     3440            RemoveCnrSwitches(szKeyBase, pszStateName);
    34403441        }
    34413442      }
     
    47484749            else {
    47494750              PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    4750               for (x = 0; x < numsaves; x++) {
    4751                 sprintf(szKeyBase, "%s.DirCnr.%lu", szStateName, x);
    4752                 RemoveCnrSwitches(szKeyBase, szStateName);
    4753                 size = 0;
    4754                 sprintf(szKey, "%sVersion", szStateName);
    4755                 if (PrfQueryProfileSize(fmprof, FM3Str, szKey, &size) && size)
    4756                   RemoveOldCnrSwitches(szStateName, x);
     4751              for (x = 0; x < numsaves; x++) {
     4752                sprintf(szKeyBase, "%s.DirCnr.%lu", szStateName, x);
     4753                RemoveCnrSwitches(szKeyBase, szStateName);
     4754                size = 0;
     4755                sprintf(szKey, "%sVersion", szStateName);
     4756                if (PrfQueryProfileSize(fmprof, FM3Str, szKey, &size) && size)
     4757                  RemoveOldCnrSwitches(szStateName, x);
    47574758              }
    47584759            }
     
    48074808
    48084809      if (fDataMin) {
    4809         fDataMin = FALSE;
    4810         changed = TRUE;
     4810        fDataMin = FALSE;
     4811        changed = TRUE;
    48114812      }
    48124813      WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0,
    4813                       SWP_MINIMIZE);
     4814                      SWP_MINIMIZE);
    48144815      WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0,
    4815                       SWP_RESTORE | SWP_ZORDER);
     4816                      SWP_RESTORE | SWP_ZORDER);
    48164817      if (changed)
    4817         fDataMin = TRUE;
     4818        fDataMin = TRUE;
    48184819      break;
    48194820    }
     
    55065507                         hwnd, HWND_TOP, IDM_IDEALSIZE, NULL, NULL)) {
    55075508      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    5508                 PCSZ_WINCREATEWINDOW);
     5509                PCSZ_WINCREATEWINDOW);
    55095510    }
    55105511    else {
     
    55285529    if (!hwndTmp)
    55295530      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    5530                 PCSZ_WINCREATEWINDOW);
     5531                PCSZ_WINCREATEWINDOW);
    55315532
    55325533    hwndTmp = WinCreateWindow(hwndFrame,
     
    55415542    if (!hwndTmp)
    55425543      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    5543                 PCSZ_WINCREATEWINDOW);
     5544                PCSZ_WINCREATEWINDOW);
    55445545
    55455546    hwndUserlist = WinCreateWindow(hwndFrame,
     
    55615562    if (!hwndUserlist)
    55625563      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    5563                 PCSZ_WINCREATEWINDOW);
     5564                PCSZ_WINCREATEWINDOW);
    55645565    hwndCmdlist = WinCreateWindow(hwndFrame,
    55655566                                  WC_COMBOBOX,
     
    55805581    if (!hwndCmdlist)
    55815582      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    5582                 PCSZ_WINCREATEWINDOW);
     5583                PCSZ_WINCREATEWINDOW);
    55835584    WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT));
    55845585    hwndStatelist = WinCreateWindow(hwndFrame,
     
    56005601    if (!hwndStatelist)
    56015602      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    5602                 PCSZ_WINCREATEWINDOW);
     5603                PCSZ_WINCREATEWINDOW);
    56035604
    56045605    hwndDrivelist = WinCreateWindow(hwndFrame,
     
    56195620    if (!hwndDrivelist)
    56205621      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    5621                 PCSZ_WINCREATEWINDOW);
     5622                PCSZ_WINCREATEWINDOW);
    56225623    //fixme to allow user to change presparams 1-10-09 GKY
    56235624    SetPresParams(hwndDrivelist,
     
    56395640    if (!hwndButtonlist)
    56405641      Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    5641                 PCSZ_WINCREATEWINDOW);
     5642                PCSZ_WINCREATEWINDOW);
    56425643    WinSendMsg(WinWindowFromID(hwndUserlist, CBID_EDIT),
    56435644               EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
     
    58225823      PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID);
    58235824      if (fInitialDriveScan) {
    5824         DosPostEventSem(hevInitialCnrScanComplete);
    5825         DosCloseEventSem(hevInitialCnrScanComplete);
     5825        DosPostEventSem(hevInitialCnrScanComplete);
     5826        DosCloseEventSem(hevInitialCnrScanComplete);
    58265827      }
    58275828    }
     
    58985899  case UM_THREADUSE:
    58995900  case UM_BUILDDRIVEBAR:
     5901  case WM_TIMER:
    59005902    return CommonMainWndProc(hwnd, msg, mp1, mp2);
    59015903
Note: See TracChangeset for help on using the changeset viewer.