| [36] | 1 | 
 | 
|---|
 | 2 | /***********************************************************************
 | 
|---|
 | 3 | 
 | 
|---|
 | 4 |   $Id: seeall.c 1226 2008-09-13 23:12:40Z jbs $
 | 
|---|
 | 5 | 
 | 
|---|
 | 6 |   See all matching files
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 |   Copyright (c) 1993-98 M. Kimes
 | 
|---|
| [907] | 9 |   Copyright (c) 2001, 2008 Steven H. Levine
 | 
|---|
| [36] | 10 | 
 | 
|---|
| [130] | 11 |   16 Oct 02 SHL Handle large partitions
 | 
|---|
 | 12 |   25 Nov 03 SHL StartSeeAll: avoid forgetting startpath
 | 
|---|
 | 13 |   06 Dec 03 SHL StartSeeAll: correct malloc arg oops
 | 
|---|
 | 14 |   23 May 05 SHL Use QWL_USER
 | 
|---|
| [162] | 15 |   25 May 05 SHL Use ULONGLONG and CommaFmtULL
 | 
|---|
| [186] | 16 |   05 Jun 05 SHL Use QWL_USER
 | 
|---|
| [204] | 17 |   06 Jun 05 SHL Drop unused code
 | 
|---|
| [302] | 18 |   29 May 06 SHL Comments
 | 
|---|
| [335] | 19 |   17 Jul 06 SHL Use Runtime_Error
 | 
|---|
| [517] | 20 |   19 Oct 06 SHL Correct . and .. detect
 | 
|---|
| [533] | 21 |   03 Nov 06 SHL Renames
 | 
|---|
 | 22 |   03 Nov 06 SHL Count thread usage
 | 
|---|
| [593] | 23 |   30 Mar 07 GKY Remove GetPString for window class names
 | 
|---|
| [783] | 24 |   03 Aug 07 GKY Enlarged and made setable everywhere Findbuf (speeds file loading)
 | 
|---|
| [775] | 25 |   06 Aug 07 GKY Reduce DosSleep times (ticket 148)
 | 
|---|
| [773] | 26 |   07 Aug 07 SHL Use BldQuotedFullPathName and BldQuotedFileName
 | 
|---|
| [783] | 27 |   13 Aug 07 SHL Sync code with other FilesToGet usage
 | 
|---|
 | 28 |   13 Aug 07 SHL Move #pragma alloc_text to end for OpenWatcom compat
 | 
|---|
| [787] | 29 |   14 Aug 07 SHL Revert to DosSleep(0) to speed up inner loops
 | 
|---|
 | 30 |   14 Aug 07 SHL Drop afFilesToGet
 | 
|---|
| [814] | 31 |   26 Aug 07 GKY DosSleep(1) in loops changed to (0)
 | 
|---|
| [846] | 32 |   27 Sep 07 SHL Correct ULONGLONG size formatting
 | 
|---|
| [897] | 33 |   30 Dec 07 GKY Use CommaFmtULL
 | 
|---|
 | 34 |   30 Dec 07 GKY Use TestFDates for comparing by date
 | 
|---|
| [955] | 35 |   15 Feb 08 GKY Prevent trap on scan of drive containing files that exceed maxpath
 | 
|---|
| [985] | 36 |   29 Feb 08 GKY Use xfree where appropriate
 | 
|---|
 | 37 |   29 Feb 08 GKY Refactor global command line variables to notebook.h
 | 
|---|
| [1084] | 38 |   20 Jul 08 GKY Add save/append filename to clipboard.
 | 
|---|
 | 39 |                 Change menu wording to make these easier to find
 | 
|---|
| [36] | 40 | 
 | 
|---|
 | 41 | ***********************************************************************/
 | 
|---|
 | 42 | 
 | 
|---|
| [907] | 43 | #include <stdlib.h>
 | 
|---|
 | 44 | #include <string.h>
 | 
|---|
 | 45 | #include <ctype.h>
 | 
|---|
 | 46 | #include <process.h>
 | 
|---|
 | 47 | 
 | 
|---|
| [2] | 48 | #define INCL_DOS
 | 
|---|
 | 49 | #define INCL_DOSERRORS
 | 
|---|
 | 50 | #define INCL_WIN
 | 
|---|
 | 51 | #define INCL_GPI
 | 
|---|
| [162] | 52 | #define INCL_LONGLONG
 | 
|---|
| [2] | 53 | 
 | 
|---|
| [1180] | 54 | #include "fm3dll.h"
 | 
|---|
| [1226] | 55 | #include "fm3dll2.h"                    // #define's for UM_*, control id's, etc.
 | 
|---|
 | 56 | #include "seeall.h"
 | 
|---|
| [1212] | 57 | #include "mainwnd2.h"                   // Data declaration(s)
 | 
|---|
 | 58 | #include "grep.h"                       // Data declaration(s)
 | 
|---|
 | 59 | #include "arccnrs.h"                    // Data declaration(s)
 | 
|---|
 | 60 | #include "init.h"                       // Data declaration(s)
 | 
|---|
 | 61 | #include "worker.h"                     // Data declaration(s)
 | 
|---|
 | 62 | #include "newview.h"                    // Data declarations
 | 
|---|
| [2] | 63 | #include "fm3dlg.h"
 | 
|---|
 | 64 | #include "fm3str.h"
 | 
|---|
| [1158] | 65 | #include "pathutil.h"                   // BldQuotedFullPathName...
 | 
|---|
 | 66 | #include "makelist.h"                   // AddToList
 | 
|---|
 | 67 | #include "errutil.h"                    // Dos_Error...
 | 
|---|
 | 68 | #include "strutil.h"                    // GetPString
 | 
|---|
| [985] | 69 | #include "notebook.h"                   // targetdirectory
 | 
|---|
| [1158] | 70 | #include "copyf.h"                      // AdjustWildcardName, make_deleteable
 | 
|---|
 | 71 | #include "attribs.h"                    // AttrListDlgProc
 | 
|---|
 | 72 | #include "chklist.h"                    // CenterOverWindow, CheckListProc
 | 
|---|
 | 73 | #include "colors.h"                     // ColorDlgProc
 | 
|---|
 | 74 | #include "draglist.h"                   // DragList
 | 
|---|
 | 75 | #include "extract.h"                    // ExtractDlgProc
 | 
|---|
 | 76 | #include "info.h"                       // FileInfoProc
 | 
|---|
 | 77 | #include "valid.h"                      // GetDesktopName, IsNewer, TestFDates
 | 
|---|
 | 78 | #include "saveclip.h"                   // ListToClipboardHab, SaveAllListDlgProc
 | 
|---|
 | 79 | #include "shadow.h"                     // MakeShadows
 | 
|---|
 | 80 | #include "mkdir.h"                      // MassMkdir
 | 
|---|
 | 81 | #include "objcnr.h"                     // ObjCnrDlgProc
 | 
|---|
 | 82 | #include "codepage.h"                   // PickCodepage
 | 
|---|
 | 83 | #include "printer.h"                    // PrintDlgProc, PrintListThread
 | 
|---|
 | 84 | #include "rename.h"                     // RenameProc
 | 
|---|
 | 85 | #include "uudecode.h"                   // UUD
 | 
|---|
 | 86 | #include "walkem.h"                     // WalkCopyDlgProc, WalkMoveDlgProc
 | 
|---|
| [1180] | 87 | #include "archive.h"                    // ArchiveDlgProc
 | 
|---|
 | 88 | #include "common.h"                     // CommonTextProc, DecrThreadUsage, IncrThreadUsage
 | 
|---|
 | 89 | #include "defview.h"                    // DefaultViewKeys
 | 
|---|
 | 90 | #include "eas.h"                        // DisplayEAsProc
 | 
|---|
 | 91 | #include "mainwnd.h"                    // GetNextWindowPos
 | 
|---|
 | 92 | #include "filter.h"                     // PickMaskDlgProc
 | 
|---|
 | 93 | #include "avl.h"                        // SBoxDlgProc
 | 
|---|
 | 94 | #include "collect.h"                    // StartCollector
 | 
|---|
 | 95 | #include "subj.h"                       // Subject
 | 
|---|
 | 96 | #include "commafmt.h"                   // commafmt
 | 
|---|
 | 97 | #include "literal.h"                    // wildcard
 | 
|---|
 | 98 | #include "wrappers.h"                   // xDosFindNext
 | 
|---|
| [1158] | 99 | #include "misc.h"                       // SetConditionalCascade
 | 
|---|
| [1180] | 100 | #include "fonts.h"                      // SetMLEFont
 | 
|---|
 | 101 | #include "stristr.h"                    // stristr
 | 
|---|
 | 102 | #include "systemf.h"                    // runemf2
 | 
|---|
| [1018] | 103 | #include "fortify.h"
 | 
|---|
 | 104 | 
 | 
|---|
| [2] | 105 | #pragma data_seg(DATA2)
 | 
|---|
| [335] | 106 | 
 | 
|---|
 | 107 | static PSZ pszSrcFile = __FILE__;
 | 
|---|
 | 108 | 
 | 
|---|
| [551] | 109 | typedef struct
 | 
|---|
 | 110 | {
 | 
|---|
 | 111 |   CHAR *fullname, *filename;
 | 
|---|
 | 112 |   USHORT attrFile, flags;
 | 
|---|
 | 113 |   FDATE date;
 | 
|---|
 | 114 |   FTIME time;
 | 
|---|
| [841] | 115 |   ULONGLONG cbFile;
 | 
|---|
 | 116 |   ULONG CRC;
 | 
|---|
| [551] | 117 | }
 | 
|---|
 | 118 | ALLFILES;
 | 
|---|
| [2] | 119 | 
 | 
|---|
 | 120 | #define AF_SELECTED     0x0001
 | 
|---|
 | 121 | #define AF_DELETED      0x0002
 | 
|---|
 | 122 | #define AF_FILTERED     0x0004
 | 
|---|
 | 123 | #define AF_DUPE         0x0008
 | 
|---|
 | 124 | #define AF_CRCED        0x0010
 | 
|---|
 | 125 | 
 | 
|---|
 | 126 | #define AFM_MARK        0
 | 
|---|
 | 127 | #define AFM_UNMARK      1
 | 
|---|
 | 128 | #define AFM_INVERT      2
 | 
|---|
 | 129 | #define AFM_MARKDELETED 3
 | 
|---|
 | 130 | #define AFM_FILTER      4
 | 
|---|
 | 131 | 
 | 
|---|
 | 132 | #define DP_NAMES        0x0001
 | 
|---|
 | 133 | #define DP_DATES        0x0002
 | 
|---|
 | 134 | #define DP_SIZES        0x0004
 | 
|---|
 | 135 | #define DP_CRCS         0x0008
 | 
|---|
 | 136 | #define DP_EXTS         0x0010
 | 
|---|
 | 137 | 
 | 
|---|
 | 138 | #define FIXED_FONT_LCID 5
 | 
|---|
 | 139 | 
 | 
|---|
 | 140 | #define COLORS_MAX                   8
 | 
|---|
 | 141 | 
 | 
|---|
 | 142 | #define COLORS_CURSOREDNORMALBACK    0
 | 
|---|
 | 143 | #define COLORS_CURSOREDSELECTEDBACK  1
 | 
|---|
 | 144 | #define COLORS_NORMALBACK            2
 | 
|---|
 | 145 | #define COLORS_SELECTEDBACK          3
 | 
|---|
 | 146 | #define COLORS_SELECTEDNORMALFORE    4
 | 
|---|
 | 147 | #define COLORS_NORMALFORE            5
 | 
|---|
 | 148 | #define COLORS_READONLYFORE          6
 | 
|---|
 | 149 | #define COLORS_SYSTEMFORE            7
 | 
|---|
 | 150 | 
 | 
|---|
| [551] | 151 | static LONG Colors[COLORS_MAX] = { COLR_WHITE, COLR_DARKGRAY, COLR_PALEGRAY,
 | 
|---|
 | 152 |   COLR_BLACK, COLR_WHITE, COLR_BLACK,
 | 
|---|
 | 153 |   COLR_DARKBLUE, COLR_DARKRED
 | 
|---|
 | 154 | };
 | 
|---|
| [2] | 155 | 
 | 
|---|
| [551] | 156 | typedef int (FNSORT) (const void *, const void *);
 | 
|---|
| [2] | 157 | typedef FNSORT *PFNSORT;
 | 
|---|
 | 158 | 
 | 
|---|
| [551] | 159 | typedef struct
 | 
|---|
 | 160 | {
 | 
|---|
 | 161 |   USHORT size;
 | 
|---|
 | 162 |   USHORT dupeflags;
 | 
|---|
 | 163 |   ALLFILES *afhead;
 | 
|---|
 | 164 |   ALLFILES **afindex;
 | 
|---|
| [943] | 165 |   ULONG afheadcnt;
 | 
|---|
| [551] | 166 |   ULONG afalloc;
 | 
|---|
 | 167 |   ULONG longest;
 | 
|---|
 | 168 |   ULONG longestw;
 | 
|---|
 | 169 |   ULONG topfile;
 | 
|---|
 | 170 |   ULONG cursored;
 | 
|---|
 | 171 |   ULONG selected;
 | 
|---|
 | 172 |   ULONGLONG ullSelectedBytes;
 | 
|---|
| [943] | 173 |   ULONG afindexcnt;
 | 
|---|
| [551] | 174 |   ULONG lastselected;
 | 
|---|
 | 175 |   ULONG lastdirection;
 | 
|---|
 | 176 |   ULONG multiplier;
 | 
|---|
 | 177 |   ULONG lasttime;
 | 
|---|
 | 178 |   CHAR stopflag;
 | 
|---|
 | 179 |   CHAR abDrvFlags[26];
 | 
|---|
 | 180 |   CHAR szCommonName[CCHMAXPATH];
 | 
|---|
 | 181 |   CHAR szFindPath[CCHMAXPATH];
 | 
|---|
 | 182 |   LONG lMaxAscender;
 | 
|---|
 | 183 |   LONG lMaxDescender;
 | 
|---|
 | 184 |   LONG lMaxHeight;
 | 
|---|
 | 185 |   LONG maxx;
 | 
|---|
 | 186 |   LONG horzscroll;
 | 
|---|
 | 187 |   BOOL fullnames;
 | 
|---|
 | 188 |   BOOL invertsort;
 | 
|---|
 | 189 |   BOOL mousecaptured;
 | 
|---|
 | 190 |   HMTX hmtxScan;
 | 
|---|
 | 191 |   HWND hvscroll;
 | 
|---|
 | 192 |   HWND hhscroll;
 | 
|---|
 | 193 |   HWND hwndMenu;
 | 
|---|
 | 194 |   HWND hwndObj;
 | 
|---|
 | 195 |   HWND hwndClient;
 | 
|---|
 | 196 |   HWND hwndPopup;
 | 
|---|
 | 197 |   HWND hwndStatus;
 | 
|---|
 | 198 |   HWND hwndFrame;
 | 
|---|
 | 199 |   HPS hps;
 | 
|---|
 | 200 |   PFNSORT pfnCompare;
 | 
|---|
 | 201 |   MASK mask;
 | 
|---|
 | 202 |   FATTRS fattrs;
 | 
|---|
 | 203 |   LONG aulColors[8];
 | 
|---|
 | 204 |   BOOL killme;
 | 
|---|
 | 205 | }
 | 
|---|
 | 206 | ALLDATA;
 | 
|---|
| [2] | 207 | 
 | 
|---|
| [551] | 208 | static BOOL Fullnames = FALSE;
 | 
|---|
 | 209 | static BOOL Firsttime = TRUE;
 | 
|---|
 | 210 | static BOOL SortReverse;
 | 
|---|
 | 211 | static USHORT Codepage, SortType;
 | 
|---|
| [2] | 212 | static FATTRS Fattrs;
 | 
|---|
 | 213 | 
 | 
|---|
| [551] | 214 | extern LONG CRCFile(CHAR * filename, INT * error);
 | 
|---|
| [2] | 215 | 
 | 
|---|
| [551] | 216 | MRESULT EXPENTRY DupeDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 | 
|---|
| [162] | 217 | {
 | 
|---|
| [551] | 218 |   switch (msg) {
 | 
|---|
 | 219 |   case WM_INITDLG:
 | 
|---|
 | 220 |     {
 | 
|---|
 | 221 |       USHORT flags = SHORT1FROMMP(mp2);
 | 
|---|
| [2] | 222 | 
 | 
|---|
| [551] | 223 |       WinCheckButton(hwnd, DUPE_NAMES, ((flags & DP_NAMES) != 0));
 | 
|---|
 | 224 |       WinCheckButton(hwnd, DUPE_DATES, ((flags & DP_NAMES) != 0));
 | 
|---|
 | 225 |       WinCheckButton(hwnd, DUPE_SIZES, ((flags & DP_NAMES) != 0));
 | 
|---|
 | 226 |       WinCheckButton(hwnd, DUPE_CRCS, ((flags & DP_NAMES) != 0));
 | 
|---|
 | 227 |       if (!(flags & DP_NAMES))
 | 
|---|
| [1158] | 228 |         WinEnableWindow(WinWindowFromID(hwnd, DUPE_EXTS), FALSE);
 | 
|---|
| [551] | 229 |     }
 | 
|---|
 | 230 |     break;
 | 
|---|
 | 231 | 
 | 
|---|
 | 232 |   case WM_CONTROL:
 | 
|---|
 | 233 |     switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 234 |     case DUPE_NAMES:
 | 
|---|
 | 235 |       if (WinQueryButtonCheckstate(hwnd, DUPE_NAMES))
 | 
|---|
| [1158] | 236 |         WinEnableWindow(WinWindowFromID(hwnd, DUPE_EXTS), TRUE);
 | 
|---|
| [551] | 237 |       else {
 | 
|---|
| [1158] | 238 |         WinCheckButton(hwnd, DUPE_EXTS, FALSE);
 | 
|---|
 | 239 |         WinEnableWindow(WinWindowFromID(hwnd, DUPE_EXTS), FALSE);
 | 
|---|
| [2] | 240 |       }
 | 
|---|
 | 241 |       break;
 | 
|---|
| [551] | 242 |     case DUPE_SIZES:
 | 
|---|
 | 243 |       if (!WinQueryButtonCheckstate(hwnd, DUPE_SIZES))
 | 
|---|
| [1158] | 244 |         WinCheckButton(hwnd, DUPE_CRCS, FALSE);
 | 
|---|
| [551] | 245 |       break;
 | 
|---|
 | 246 |     case DUPE_CRCS:
 | 
|---|
 | 247 |       if (WinQueryButtonCheckstate(hwnd, DUPE_CRCS))
 | 
|---|
| [1158] | 248 |         WinCheckButton(hwnd, DUPE_SIZES, TRUE);
 | 
|---|
| [551] | 249 |       break;
 | 
|---|
 | 250 |     }
 | 
|---|
 | 251 |     return 0;
 | 
|---|
| [2] | 252 | 
 | 
|---|
| [551] | 253 |   case WM_COMMAND:
 | 
|---|
 | 254 |     switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 255 |     case DID_OK:
 | 
|---|
 | 256 |       {
 | 
|---|
| [1158] | 257 |         USHORT flags = 0;
 | 
|---|
| [551] | 258 | 
 | 
|---|
| [1158] | 259 |         if (WinQueryButtonCheckstate(hwnd, DUPE_NAMES)) {
 | 
|---|
 | 260 |           flags |= DP_NAMES;
 | 
|---|
 | 261 |           if (WinQueryButtonCheckstate(hwnd, DUPE_EXTS))
 | 
|---|
 | 262 |             flags |= DP_EXTS;
 | 
|---|
 | 263 |         }
 | 
|---|
 | 264 |         if (WinQueryButtonCheckstate(hwnd, DUPE_DATES))
 | 
|---|
 | 265 |           flags |= DP_DATES;
 | 
|---|
 | 266 |         if (WinQueryButtonCheckstate(hwnd, DUPE_SIZES)) {
 | 
|---|
 | 267 |           flags |= DP_SIZES;
 | 
|---|
 | 268 |           if (WinQueryButtonCheckstate(hwnd, DUPE_CRCS))
 | 
|---|
 | 269 |             flags |= (DP_CRCS | DP_SIZES);
 | 
|---|
 | 270 |         }
 | 
|---|
 | 271 |         if (!flags)
 | 
|---|
 | 272 |           saymsg(MB_ENTER,
 | 
|---|
 | 273 |                  hwnd,
 | 
|---|
 | 274 |                  GetPString(IDS_ERRORTEXT),
 | 
|---|
 | 275 |                  "%s", GetPString(IDS_CHECKONETEXT));
 | 
|---|
 | 276 |         else
 | 
|---|
 | 277 |           WinDismissDlg(hwnd, flags);
 | 
|---|
| [2] | 278 |       }
 | 
|---|
| [551] | 279 |       break;
 | 
|---|
| [2] | 280 | 
 | 
|---|
| [551] | 281 |     case DID_CANCEL:
 | 
|---|
 | 282 |       WinDismissDlg(hwnd, 0);
 | 
|---|
 | 283 |       break;
 | 
|---|
| [2] | 284 | 
 | 
|---|
| [551] | 285 |     case IDM_HELP:
 | 
|---|
 | 286 |       if (hwndHelp)
 | 
|---|
| [1158] | 287 |         WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
 | 
|---|
 | 288 |                    MPFROM2SHORT(HELP_DUPES, 0), MPFROMSHORT(HM_RESOURCEID));
 | 
|---|
| [551] | 289 |       break;
 | 
|---|
 | 290 |     }
 | 
|---|
 | 291 |     return 0;
 | 
|---|
| [2] | 292 |   }
 | 
|---|
| [551] | 293 |   return WinDefDlgProc(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 294 | }
 | 
|---|
 | 295 | 
 | 
|---|
| [551] | 296 | static ULONG NumLines(RECTL * rcl, ALLDATA * ad)
 | 
|---|
| [162] | 297 | {
 | 
|---|
| [2] | 298 |   ULONG numlines;
 | 
|---|
 | 299 | 
 | 
|---|
 | 300 |   numlines = (rcl->yTop - rcl->yBottom) / ad->lMaxHeight;
 | 
|---|
| [551] | 301 |   if (ad->lMaxDescender && numlines &&
 | 
|---|
 | 302 |       ((rcl->yTop - rcl->yBottom) -
 | 
|---|
 | 303 |        (numlines * ad->lMaxHeight) <= ad->lMaxDescender))
 | 
|---|
| [2] | 304 |     numlines--;
 | 
|---|
 | 305 |   return numlines;
 | 
|---|
 | 306 | }
 | 
|---|
 | 307 | 
 | 
|---|
| [551] | 308 | MRESULT EXPENTRY SeeObjWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 | 
|---|
| [50] | 309 | {
 | 
|---|
| [551] | 310 |   switch (msg) {
 | 
|---|
 | 311 |   case UM_MASSACTION:
 | 
|---|
 | 312 |     {
 | 
|---|
 | 313 |       CHAR **files = NULL, **list = (CHAR **) mp2, path[CCHMAXPATH];
 | 
|---|
| [907] | 314 |       UINT numfiles = 0, numalloc = 0;
 | 
|---|
 | 315 |       INT plen = 0;
 | 
|---|
| [551] | 316 |       HWND hwndFrame = WinQueryWindowULong(hwnd, QWL_USER);
 | 
|---|
 | 317 |       CHAR message[CCHMAXPATH * 2], wildname[CCHMAXPATH];
 | 
|---|
 | 318 |       register INT x;
 | 
|---|
 | 319 |       register CHAR *p, *pp;
 | 
|---|
 | 320 |       BOOL dontask = FALSE, wildcarding = FALSE,
 | 
|---|
| [1158] | 321 |         overold = FALSE, overnew = FALSE;
 | 
|---|
| [2] | 322 | 
 | 
|---|
| [551] | 323 |       if (!list || !list[0])
 | 
|---|
| [1158] | 324 |         goto Abort;
 | 
|---|
| [551] | 325 |       *path = *wildname = 0;
 | 
|---|
| [2] | 326 | 
 | 
|---|
| [551] | 327 |       switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 328 |       case IDM_MOVEPRESERVE:
 | 
|---|
| [1158] | 329 |         {
 | 
|---|
 | 330 |           CHAR preserve[CCHMAXPATH], *end;
 | 
|---|
| [2] | 331 | 
 | 
|---|
| [1158] | 332 |           mp1 = MPFROM2SHORT(IDM_MOVE, SHORT2FROMMP(mp1));
 | 
|---|
 | 333 |           strcpy(preserve, list[0] + 2);
 | 
|---|
 | 334 |           end = strrchr(preserve, '\\');
 | 
|---|
 | 335 |           if (end) {
 | 
|---|
 | 336 |             end++;
 | 
|---|
 | 337 |             for (x = 1; list[x]; x++) {
 | 
|---|
 | 338 |               p = preserve;
 | 
|---|
 | 339 |               pp = list[x] + 2;
 | 
|---|
 | 340 |               while (p < end && toupper(*p) == toupper(*pp)) {
 | 
|---|
 | 341 |                 p++;
 | 
|---|
 | 342 |                 pp++;
 | 
|---|
 | 343 |               }
 | 
|---|
 | 344 |               if (*p == '\\')
 | 
|---|
 | 345 |                 p++;
 | 
|---|
 | 346 |               if (p < end)
 | 
|---|
 | 347 |                 end = p;
 | 
|---|
 | 348 |             }
 | 
|---|
 | 349 |             *end = 0;
 | 
|---|
 | 350 |           }
 | 
|---|
 | 351 |           else
 | 
|---|
 | 352 |             *preserve = 0;
 | 
|---|
 | 353 |           plen = strlen(preserve);
 | 
|---|
 | 354 |           if (plen)
 | 
|---|
 | 355 |             plen += 2;
 | 
|---|
 | 356 |         }
 | 
|---|
 | 357 |         break;
 | 
|---|
| [551] | 358 |       case IDM_COPYPRESERVE:
 | 
|---|
| [1158] | 359 |         {
 | 
|---|
 | 360 |           CHAR preserve[CCHMAXPATH], *end;
 | 
|---|
| [2] | 361 | 
 | 
|---|
| [1158] | 362 |           mp1 = MPFROM2SHORT(IDM_COPY, SHORT2FROMMP(mp1));
 | 
|---|
 | 363 |           strcpy(preserve, list[0] + 2);
 | 
|---|
 | 364 |           end = strrchr(preserve, '\\');
 | 
|---|
 | 365 |           if (end) {
 | 
|---|
 | 366 |             end++;
 | 
|---|
 | 367 |             for (x = 1; list[x]; x++) {
 | 
|---|
 | 368 |               p = preserve;
 | 
|---|
 | 369 |               pp = list[x] + 2;
 | 
|---|
 | 370 |               while (p < end && toupper(*p) == toupper(*pp)) {
 | 
|---|
 | 371 |                 p++;
 | 
|---|
 | 372 |                 pp++;
 | 
|---|
 | 373 |               }
 | 
|---|
 | 374 |               if (*p == '\\')
 | 
|---|
 | 375 |                 p++;
 | 
|---|
 | 376 |               if (p < end)
 | 
|---|
 | 377 |                 end = p;
 | 
|---|
 | 378 |             }
 | 
|---|
 | 379 |             *end = 0;
 | 
|---|
 | 380 |           }
 | 
|---|
 | 381 |           else
 | 
|---|
 | 382 |             *preserve = 0;
 | 
|---|
 | 383 |           plen = strlen(preserve);
 | 
|---|
 | 384 |           if (plen)
 | 
|---|
 | 385 |             plen += 2;
 | 
|---|
 | 386 |         }
 | 
|---|
 | 387 |         break;
 | 
|---|
| [551] | 388 |       case IDM_WILDMOVE:
 | 
|---|
| [1158] | 389 |         wildcarding = TRUE;
 | 
|---|
 | 390 |         mp1 = MPFROM2SHORT(IDM_MOVE, SHORT2FROMMP(mp1));
 | 
|---|
 | 391 |         break;
 | 
|---|
| [551] | 392 |       case IDM_WILDRENAME:
 | 
|---|
| [1158] | 393 |         wildcarding = TRUE;
 | 
|---|
 | 394 |         mp1 = MPFROM2SHORT(IDM_RENAME, SHORT2FROMMP(mp1));
 | 
|---|
 | 395 |         break;
 | 
|---|
| [551] | 396 |       case IDM_WILDCOPY:
 | 
|---|
| [1158] | 397 |         wildcarding = TRUE;
 | 
|---|
 | 398 |         mp1 = MPFROM2SHORT(IDM_COPY, SHORT2FROMMP(mp1));
 | 
|---|
 | 399 |         break;
 | 
|---|
| [551] | 400 |       }
 | 
|---|
| [2] | 401 | 
 | 
|---|
| [551] | 402 |       switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 403 |       case IDM_OBJECT:
 | 
|---|
 | 404 |       case IDM_SHADOW:
 | 
|---|
| [1158] | 405 |         {
 | 
|---|
 | 406 |           APIRET rc;
 | 
|---|
| [2] | 407 | 
 | 
|---|
| [1158] | 408 |           GetDesktopName(path, sizeof(path));
 | 
|---|
 | 409 |           rc = WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 410 |                          hwndFrame,
 | 
|---|
 | 411 |                          ObjCnrDlgProc,
 | 
|---|
 | 412 |                          FM3ModHandle, OBJCNR_FRAME, MPFROMP(path));
 | 
|---|
 | 413 |           if (rc) {
 | 
|---|
 | 414 |             if (rc > 1)
 | 
|---|
 | 415 |               strcpy(path, "<WP_DESKTOP>");
 | 
|---|
 | 416 |           }
 | 
|---|
 | 417 |           else {
 | 
|---|
 | 418 |             FreeList(list);
 | 
|---|
 | 419 |             break;
 | 
|---|
 | 420 |           }
 | 
|---|
 | 421 |           MakeShadows(hwndFrame,
 | 
|---|
 | 422 |                       list, (SHORT1FROMMP(mp1) == IDM_SHADOW), path, NULL);
 | 
|---|
 | 423 |         }
 | 
|---|
 | 424 |         FreeList(list);
 | 
|---|
 | 425 |         break;
 | 
|---|
| [2] | 426 | 
 | 
|---|
| [551] | 427 |       case IDM_PRINT:
 | 
|---|
| [1158] | 428 |         {
 | 
|---|
 | 429 |           LISTINFO *li;
 | 
|---|
| [1063] | 430 | #         ifdef FORTIFY
 | 
|---|
 | 431 |           Fortify_EnterScope();
 | 
|---|
 | 432 | #          endif
 | 
|---|
| [1158] | 433 |           li = xmallocz(sizeof(LISTINFO), pszSrcFile, __LINE__);
 | 
|---|
 | 434 |           if (li) {
 | 
|---|
 | 435 |             li->hwndS = WinWindowFromID(hwndFrame, FID_CLIENT);
 | 
|---|
 | 436 |             li->type = IDM_PRINT;
 | 
|---|
 | 437 |             li->list = list;
 | 
|---|
 | 438 |             if (WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 439 |                           li->hwndS,
 | 
|---|
 | 440 |                           PrintDlgProc,
 | 
|---|
 | 441 |                           FM3ModHandle, PRN_FRAME, MPFROMP(li))) {
 | 
|---|
 | 442 |               if (li && li->list && li->list[0]) {
 | 
|---|
 | 443 |                 strcpy(li->targetpath, printer);
 | 
|---|
 | 444 |                 if (_beginthread(PrintListThread, NULL, 65536, (PVOID) li) ==
 | 
|---|
 | 445 |                     -1) {
 | 
|---|
 | 446 |                   Runtime_Error(pszSrcFile, __LINE__,
 | 
|---|
 | 447 |                                 GetPString(IDS_COULDNTSTARTTHREADTEXT));
 | 
|---|
 | 448 |                   FreeListInfo(li);
 | 
|---|
 | 449 |                 }
 | 
|---|
 | 450 |               }
 | 
|---|
 | 451 |             }
 | 
|---|
 | 452 |           }
 | 
|---|
 | 453 |         }
 | 
|---|
 | 454 |         break;
 | 
|---|
| [2] | 455 | 
 | 
|---|
| [551] | 456 |       case IDM_EAS:
 | 
|---|
| [1158] | 457 |         if (WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 458 |                       hwndFrame,
 | 
|---|
 | 459 |                       DisplayEAsProc, FM3ModHandle, EA_FRAME, (PVOID) list)) {
 | 
|---|
 | 460 |           if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 461 |                        UM_UPDATERECORDLIST, MPFROMP(list), MPVOID))
 | 
|---|
 | 462 |             FreeList(list);
 | 
|---|
 | 463 |         }
 | 
|---|
 | 464 |         else
 | 
|---|
 | 465 |           FreeList(list);
 | 
|---|
 | 466 |         break;
 | 
|---|
| [551] | 467 | 
 | 
|---|
 | 468 |       case IDM_INFO:
 | 
|---|
| [1158] | 469 |         if (WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 470 |                       hwndFrame,
 | 
|---|
 | 471 |                       FileInfoProc,
 | 
|---|
 | 472 |                       FM3ModHandle, FLE_FRAME, (PVOID) list) == 2) {
 | 
|---|
 | 473 |           if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 474 |                        UM_UPDATERECORDLIST, MPFROMP(list), MPVOID))
 | 
|---|
 | 475 |             FreeList(list);
 | 
|---|
 | 476 |         }
 | 
|---|
 | 477 |         else
 | 
|---|
 | 478 |           FreeList(list);
 | 
|---|
 | 479 |         break;
 | 
|---|
| [551] | 480 | 
 | 
|---|
 | 481 |       case IDM_ARCHIVE:
 | 
|---|
| [1158] | 482 |         {
 | 
|---|
 | 483 |           DIRCNRDATA ad;
 | 
|---|
 | 484 |           CHAR szBuffer[1025];
 | 
|---|
| [551] | 485 | 
 | 
|---|
| [1158] | 486 |           memset(&ad, 0, sizeof(ad));
 | 
|---|
 | 487 |           ad.namecanchange = 1;
 | 
|---|
 | 488 |           ad.info = arcsighead;         // Hide dups
 | 
|---|
 | 489 |           if (!WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 490 |                          hwndFrame,
 | 
|---|
 | 491 |                          SBoxDlgProc,
 | 
|---|
 | 492 |                          FM3ModHandle,
 | 
|---|
 | 493 |                          ASEL_FRAME, (PVOID) & ad.info) || !ad.info) {
 | 
|---|
 | 494 |             // we blew it
 | 
|---|
 | 495 |             FreeList(list);
 | 
|---|
 | 496 |             break;
 | 
|---|
 | 497 |           }
 | 
|---|
 | 498 |           if (!ad.info->create &&
 | 
|---|
 | 499 |               !ad.info->move &&
 | 
|---|
 | 500 |               !ad.info->createwdirs &&
 | 
|---|
 | 501 |               !ad.info->movewdirs && !ad.info->createrecurse) {
 | 
|---|
 | 502 |             // 14 Aug 07 SHL fixme to tell user why we failed
 | 
|---|
 | 503 |             FreeList(list);
 | 
|---|
 | 504 |             break;
 | 
|---|
 | 505 |           }
 | 
|---|
 | 506 |           if (!WinDlgBox(HWND_DESKTOP, hwndFrame, ArchiveDlgProc, FM3ModHandle, ARCH_FRAME, (PVOID) & ad) || !*ad.arcname || !*ad.command) {    /* we blew it */
 | 
|---|
 | 507 |             FreeList(list);
 | 
|---|
 | 508 |             break;
 | 
|---|
 | 509 |           }
 | 
|---|
 | 510 |           // Build archiver command line
 | 
|---|
 | 511 |           strcpy(szBuffer, ad.command);
 | 
|---|
 | 512 |           strcat(szBuffer, " ");
 | 
|---|
 | 513 |           strcat(szBuffer, ad.arcname);
 | 
|---|
 | 514 |           p = &szBuffer[strlen(szBuffer)];
 | 
|---|
 | 515 |           if (ad.mask.szMask) {
 | 
|---|
 | 516 |             strcat(szBuffer, " ");
 | 
|---|
 | 517 |             strcat(szBuffer, ad.mask.szMask);
 | 
|---|
 | 518 |           }
 | 
|---|
 | 519 |           strcat(szBuffer, " ");
 | 
|---|
 | 520 |           x = 0;
 | 
|---|
 | 521 |           while (list[x]) {
 | 
|---|
 | 522 |             FILESTATUS3 fsa;
 | 
|---|
 | 523 |             memset(&fsa, 0, sizeof(fsa));
 | 
|---|
 | 524 |             DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 525 |             DosQueryPathInfo(list[x], FIL_STANDARD, &fsa, sizeof(fsa));
 | 
|---|
 | 526 |             if (fsa.attrFile & FILE_DIRECTORY) {
 | 
|---|
 | 527 |               BldQuotedFullPathName(szBuffer + strlen(szBuffer),
 | 
|---|
 | 528 |                                     list[x], "*");
 | 
|---|
 | 529 |             }
 | 
|---|
 | 530 |             else
 | 
|---|
 | 531 |               BldQuotedFileName(szBuffer + strlen(szBuffer), list[x]);
 | 
|---|
 | 532 |             x++;
 | 
|---|
 | 533 |             if (!list[x] || strlen(szBuffer) + strlen(list[x]) + 5 > 1024) {
 | 
|---|
 | 534 |               runemf2(SEPARATE | WINDOWED | WAIT |
 | 
|---|
 | 535 |                       (fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED)),
 | 
|---|
| [888] | 536 |                       HWND_DESKTOP, pszSrcFile, __LINE__,
 | 
|---|
 | 537 |                       NULL, NULL, "%s", szBuffer);
 | 
|---|
| [1158] | 538 |               DosSleep(1);              // Let archiver get started
 | 
|---|
 | 539 |               *p = 0;
 | 
|---|
 | 540 |             }
 | 
|---|
 | 541 |             strcat(szBuffer, " ");
 | 
|---|
 | 542 |           } // while
 | 
|---|
 | 543 |           AddToList(ad.arcname, &files, &numfiles, &numalloc);
 | 
|---|
 | 544 |         }
 | 
|---|
 | 545 |         if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 546 |                      UM_UPDATERECORDLIST, MPFROMP(list), MPVOID))
 | 
|---|
 | 547 |           FreeList(list);
 | 
|---|
 | 548 |         break;
 | 
|---|
| [2] | 549 | 
 | 
|---|
| [551] | 550 |       case IDM_ATTRS:
 | 
|---|
| [1158] | 551 |         {
 | 
|---|
 | 552 |           LISTINFO li;
 | 
|---|
| [2] | 553 | 
 | 
|---|
| [1158] | 554 |           memset(&li, 0, sizeof(li));
 | 
|---|
 | 555 |           li.list = list;
 | 
|---|
 | 556 |           if (WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 557 |                         hwndFrame,
 | 
|---|
 | 558 |                         AttrListDlgProc,
 | 
|---|
 | 559 |                         FM3ModHandle, ATR_FRAME, MPFROMP(&li))) {
 | 
|---|
 | 560 |             if (li.list && li.list[0]) {
 | 
|---|
 | 561 |               if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 562 |                            UM_UPDATERECORDLIST, MPFROMP(li.list), MPVOID))
 | 
|---|
 | 563 |                 FreeList(li.list);
 | 
|---|
 | 564 |             }
 | 
|---|
 | 565 |           }
 | 
|---|
 | 566 |           else
 | 
|---|
 | 567 |             FreeList(list);
 | 
|---|
 | 568 |         }
 | 
|---|
 | 569 |         break;
 | 
|---|
| [2] | 570 | 
 | 
|---|
| [551] | 571 |       case IDM_MOVE:
 | 
|---|
 | 572 |       case IDM_COPY:
 | 
|---|
| [1158] | 573 |         if (!*path)
 | 
|---|
 | 574 |           strcpy(path, targetdir);
 | 
|---|
 | 575 |         if (!*path)
 | 
|---|
 | 576 |           strcpy(path, list[0]);
 | 
|---|
 | 577 |         MakeValidDir(path);
 | 
|---|
| [551] | 578 |       RetryPath:
 | 
|---|
| [1158] | 579 |         if (SHORT1FROMMP(mp1) == IDM_MOVE) {
 | 
|---|
 | 580 |           if (!WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 581 |                          hwndFrame,
 | 
|---|
 | 582 |                          WalkMoveDlgProc,
 | 
|---|
 | 583 |                          FM3ModHandle, WALK_FRAME, MPFROMP(path)) || !*path) {
 | 
|---|
 | 584 |             FreeList(list);
 | 
|---|
 | 585 |             goto Abort;
 | 
|---|
 | 586 |           }
 | 
|---|
 | 587 |         }
 | 
|---|
 | 588 |         else {
 | 
|---|
 | 589 |           if (!WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 590 |                          hwndFrame,
 | 
|---|
 | 591 |                          WalkCopyDlgProc,
 | 
|---|
 | 592 |                          FM3ModHandle, WALK_FRAME, MPFROMP(path)) || !*path) {
 | 
|---|
 | 593 |             FreeList(list);
 | 
|---|
 | 594 |             goto Abort;
 | 
|---|
 | 595 |           }
 | 
|---|
 | 596 |         }
 | 
|---|
 | 597 |         if (driveflags[toupper(*path) - 'A'] & DRIVE_NOTWRITEABLE) {
 | 
|---|
 | 598 |           saymsg(MB_CANCEL,
 | 
|---|
 | 599 |                  hwndFrame,
 | 
|---|
 | 600 |                  GetPString(IDS_ERRORTEXT),
 | 
|---|
 | 601 |                  "%s", GetPString(IDS_NOTWRITENOTARGETTEXT));
 | 
|---|
 | 602 |           goto RetryPath;
 | 
|---|
 | 603 |         }
 | 
|---|
 | 604 |         /* intentional fallthru */
 | 
|---|
| [551] | 605 |       case IDM_RENAME:
 | 
|---|
| [1158] | 606 |         {
 | 
|---|
 | 607 |           CHAR newname[CCHMAXPATH], *moving, *move, *moved;
 | 
|---|
 | 608 |           APIRET rc;
 | 
|---|
 | 609 |           INT type;
 | 
|---|
 | 610 |           FILESTATUS4L fs4;
 | 
|---|
 | 611 |           BOOL isnewer, existed;
 | 
|---|
| [2] | 612 | 
 | 
|---|
| [1158] | 613 |           for (x = 0; list[x]; x++) {
 | 
|---|
 | 614 |           Retry:
 | 
|---|
 | 615 |             type = (SHORT1FROMMP(mp1) == IDM_RENAME) ? MOVE :
 | 
|---|
 | 616 |               (SHORT1FROMMP(mp1) == IDM_MOVE) ? MOVE :
 | 
|---|
 | 617 |               (SHORT1FROMMP(mp1) == IDM_WPSMOVE) ? WPSMOVE :
 | 
|---|
 | 618 |               (SHORT1FROMMP(mp1) == IDM_WPSCOPY) ? WPSCOPY : COPY;
 | 
|---|
 | 619 |             moving = (SHORT1FROMMP(mp1) == IDM_RENAME) ?
 | 
|---|
 | 620 |               GetPString(IDS_RENAMINGTEXT) :
 | 
|---|
 | 621 |               (SHORT1FROMMP(mp1) == IDM_MOVE ||
 | 
|---|
 | 622 |                SHORT1FROMMP(mp1) == IDM_WPSMOVE) ?
 | 
|---|
 | 623 |               GetPString(IDS_MOVINGTEXT) : GetPString(IDS_COPYINGTEXT);
 | 
|---|
 | 624 |             move = (SHORT1FROMMP(mp1) == IDM_RENAME) ?
 | 
|---|
 | 625 |               GetPString(IDS_RENAMETEXT) :
 | 
|---|
 | 626 |               (SHORT1FROMMP(mp1) == IDM_MOVE ||
 | 
|---|
 | 627 |                SHORT1FROMMP(mp1) == IDM_WPSMOVE) ?
 | 
|---|
 | 628 |               GetPString(IDS_MOVETEXT) : GetPString(IDS_COPYTEXT);
 | 
|---|
 | 629 |             moved = (SHORT1FROMMP(mp1) == IDM_RENAME) ?
 | 
|---|
 | 630 |               GetPString(IDS_RENAMEDTEXT) :
 | 
|---|
 | 631 |               (SHORT1FROMMP(mp1) == IDM_MOVE ||
 | 
|---|
 | 632 |                SHORT1FROMMP(mp1) == IDM_WPSMOVE) ?
 | 
|---|
 | 633 |               GetPString(IDS_MOVEDTEXT) : GetPString(IDS_COPIEDTEXT);
 | 
|---|
 | 634 |             if (*path) {
 | 
|---|
 | 635 |               strcpy(newname, path);
 | 
|---|
 | 636 |               if (newname[strlen(newname) - 1] != '\\')
 | 
|---|
 | 637 |                 strcat(newname, "\\");
 | 
|---|
 | 638 |               if (plen)
 | 
|---|
 | 639 |                 p = list[x] + plen;
 | 
|---|
 | 640 |               else {
 | 
|---|
 | 641 |                 p = strrchr(list[x], '\\');
 | 
|---|
 | 642 |                 if (p)
 | 
|---|
 | 643 |                   p++;
 | 
|---|
 | 644 |                 else
 | 
|---|
 | 645 |                   p = list[x];
 | 
|---|
 | 646 |               }
 | 
|---|
 | 647 |               strcat(newname, p);
 | 
|---|
 | 648 |             }
 | 
|---|
 | 649 |             else
 | 
|---|
 | 650 |               strcpy(newname, list[x]);
 | 
|---|
 | 651 |             if ((wildcarding || SHORT1FROMMP(mp1) == IDM_RENAME) && *wildname) {
 | 
|---|
| [2] | 652 | 
 | 
|---|
| [1158] | 653 |               CHAR testname[CCHMAXPATH];
 | 
|---|
| [2] | 654 | 
 | 
|---|
| [1158] | 655 |               strcpy(testname, wildname);
 | 
|---|
 | 656 |               if (AdjustWildcardName(newname, testname))
 | 
|---|
 | 657 |                 strcpy(newname, testname);
 | 
|---|
 | 658 |             }
 | 
|---|
 | 659 |             existed = (IsFile(newname) != -1);
 | 
|---|
 | 660 |             isnewer = IsNewer(list[x], newname);
 | 
|---|
 | 661 |             if (existed && SHORT1FROMMP(mp1) != IDM_RENAME && dontask) {
 | 
|---|
 | 662 |               if (!overold && !overnew)
 | 
|---|
 | 663 |                 break;
 | 
|---|
 | 664 |               if (!overold && !isnewer)
 | 
|---|
 | 665 |                 break;
 | 
|---|
 | 666 |               if (!overnew && isnewer)
 | 
|---|
 | 667 |                 break;
 | 
|---|
 | 668 |             }
 | 
|---|
 | 669 |             if ((SHORT1FROMMP(mp1) == IDM_RENAME &&
 | 
|---|
 | 670 |                  (!dontask || !*wildname)) ||
 | 
|---|
 | 671 |                 (!dontask && existed) ||
 | 
|---|
 | 672 |                 (!dontask && wildcarding) ||
 | 
|---|
 | 673 |                 (IsFile(newname) == 0 && IsFile(list[x]) == 1)) {
 | 
|---|
| [2] | 674 | 
 | 
|---|
| [1158] | 675 |               MOVEIT mv;
 | 
|---|
| [551] | 676 | 
 | 
|---|
| [1158] | 677 |               memset(&mv, 0, sizeof(mv));
 | 
|---|
 | 678 |               mv.rename = (SHORT1FROMMP(mp1) == IDM_RENAME);
 | 
|---|
 | 679 |               mv.source = list[x];
 | 
|---|
 | 680 |               strcpy(mv.target, newname);
 | 
|---|
 | 681 |               rc = WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 682 |                              hwndFrame,
 | 
|---|
 | 683 |                              RenameProc,
 | 
|---|
 | 684 |                              FM3ModHandle, REN_FRAME, (PVOID) & mv);
 | 
|---|
 | 685 |               if (!rc) {
 | 
|---|
 | 686 |                 FreeList(list);
 | 
|---|
 | 687 |                 goto Abort;
 | 
|---|
 | 688 |               }
 | 
|---|
 | 689 |               DosSleep(0);  //26 Aug 07 GKY 1
 | 
|---|
 | 690 |               if (mv.skip || !*mv.target)
 | 
|---|
 | 691 |                 break;
 | 
|---|
 | 692 |               if (mv.dontask)
 | 
|---|
 | 693 |                 dontask = TRUE;
 | 
|---|
 | 694 |               if (mv.overold)
 | 
|---|
 | 695 |                 overold = TRUE;
 | 
|---|
 | 696 |               if (mv.overnew)
 | 
|---|
 | 697 |                 overnew = TRUE;
 | 
|---|
 | 698 |               if (wildcarding || SHORT1FROMMP(mp1) == IDM_RENAME) {
 | 
|---|
 | 699 |                 p = strrchr(mv.target, '\\');
 | 
|---|
 | 700 |                 if (p && (strchr(p, '*') || strchr(p, '?'))) {
 | 
|---|
 | 701 |                   strcpy(wildname, mv.target);
 | 
|---|
 | 702 |                   AdjustWildcardName(list[x], mv.target);
 | 
|---|
 | 703 |                 }
 | 
|---|
 | 704 |                 else
 | 
|---|
 | 705 |                   *wildname = 0;
 | 
|---|
 | 706 |               }
 | 
|---|
 | 707 |               strcpy(newname, mv.target);
 | 
|---|
 | 708 |               existed = (IsFile(newname) != -1);
 | 
|---|
 | 709 |               isnewer = IsNewer(list[x], newname);
 | 
|---|
 | 710 |               if (!mv.overwrite) {
 | 
|---|
 | 711 |                 if (existed && SHORT1FROMMP(mp1) != IDM_RENAME && dontask) {
 | 
|---|
 | 712 |                   if (!overold && !overnew)
 | 
|---|
 | 713 |                     break;
 | 
|---|
 | 714 |                   if (!overold && !isnewer)
 | 
|---|
 | 715 |                     break;
 | 
|---|
 | 716 |                   if (!overnew && isnewer)
 | 
|---|
 | 717 |                     break;
 | 
|---|
 | 718 |                 }
 | 
|---|
 | 719 |               }
 | 
|---|
 | 720 |             }
 | 
|---|
 | 721 |             if (!stricmp(list[x], newname))
 | 
|---|
 | 722 |               break;
 | 
|---|
 | 723 |             sprintf(message,
 | 
|---|
 | 724 |                     " %s \"%s\" %s \"%s\"",
 | 
|---|
 | 725 |                     moving, list[x], GetPString(IDS_TOTEXT), newname);
 | 
|---|
 | 726 |             WinSetWindowText(WinWindowFromID(hwndFrame, SEEALL_STATUS),
 | 
|---|
 | 727 |                              message);
 | 
|---|
 | 728 |             if (fRealIdle)
 | 
|---|
 | 729 |               priority_idle();
 | 
|---|
 | 730 |             if (plen) {
 | 
|---|
 | 731 |               /* make directory/ies, if required */
 | 
|---|
| [2] | 732 | 
 | 
|---|
| [1158] | 733 |               CHAR dirpart[CCHMAXPATH];
 | 
|---|
| [2] | 734 | 
 | 
|---|
| [1158] | 735 |               strcpy(dirpart, newname);
 | 
|---|
 | 736 |               p = strrchr(dirpart, '\\');
 | 
|---|
 | 737 |               if (p) {
 | 
|---|
 | 738 |                 *p = 0;
 | 
|---|
 | 739 |                 if (p > dirpart + 3)
 | 
|---|
 | 740 |                   MassMkdir((hwndMain) ? hwndMain : (HWND) 0, dirpart);
 | 
|---|
 | 741 |               }
 | 
|---|
 | 742 |             }
 | 
|---|
 | 743 |             rc = docopyf(type, list[x], "%s", newname);
 | 
|---|
 | 744 |             priority_normal();
 | 
|---|
 | 745 |             if (rc) {
 | 
|---|
 | 746 |               if ((rc == ERROR_DISK_FULL ||
 | 
|---|
 | 747 |                    rc == ERROR_HANDLE_DISK_FULL) &&
 | 
|---|
 | 748 |                   isalpha(*newname) &&
 | 
|---|
 | 749 |                   (driveflags[toupper(*newname) - 'A'] & DRIVE_REMOVABLE) &&
 | 
|---|
 | 750 |                   !(driveflags[toupper(*newname) - 'A'] & DRIVE_NOTWRITEABLE)
 | 
|---|
 | 751 |                   && toupper(*newname) != toupper(*list[x])
 | 
|---|
 | 752 |                   && !DosQueryPathInfo(list[x], FIL_QUERYEASIZEL, &fs4,
 | 
|---|
 | 753 |                                        sizeof(fs4))
 | 
|---|
 | 754 |                   && !(fs4.attrFile & FILE_DIRECTORY)) {
 | 
|---|
| [2] | 755 | 
 | 
|---|
| [1158] | 756 |                 FSALLOCATE fsa;
 | 
|---|
 | 757 |                 ULONGLONG ullFreeBytes;
 | 
|---|
 | 758 |                 CHAR *ptr;
 | 
|---|
 | 759 |                 INT cntr;
 | 
|---|
| [2] | 760 | 
 | 
|---|
| [1158] | 761 |                 WinSetWindowText(WinWindowFromID(hwndFrame, SEEALL_STATUS),
 | 
|---|
 | 762 |                                  GetPString(IDS_FITTINGTEXT));
 | 
|---|
 | 763 |                 DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 764 |                 if (!DosQueryFSInfo(toupper(*newname) - '@',
 | 
|---|
 | 765 |                                     FSIL_ALLOC, &fsa, sizeof(fsa))) {
 | 
|---|
 | 766 |                   // Assume large file support
 | 
|---|
 | 767 |                   ullFreeBytes = (ULONGLONG) fsa.cUnitAvail * fsa.cSectorUnit *
 | 
|---|
 | 768 |                                 fsa.cbSector;
 | 
|---|
 | 769 |                   if (ullFreeBytes) {
 | 
|---|
 | 770 |                     // Find item that will fit in available space
 | 
|---|
 | 771 |                     for (cntr = x + 1; list[cntr]; cntr++) {
 | 
|---|
 | 772 |                       DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 773 |                       if (!DosQueryPathInfo(list[cntr],
 | 
|---|
 | 774 |                                             FIL_QUERYEASIZEL,
 | 
|---|
 | 775 |                                             &fs4, sizeof(fs4)) &&
 | 
|---|
 | 776 |                           !(fs4.attrFile & FILE_DIRECTORY) &&
 | 
|---|
 | 777 |                           // fixme to use CBLIST_TO_EASIZE?
 | 
|---|
 | 778 |                           fs4.cbFile + fs4.cbList <= ullFreeBytes) {
 | 
|---|
 | 779 |                         // Swap with failing item
 | 
|---|
 | 780 |                         ptr = list[x];
 | 
|---|
 | 781 |                         list[x] = list[cntr];
 | 
|---|
 | 782 |                         list[cntr] = ptr;
 | 
|---|
 | 783 |                         goto Retry;
 | 
|---|
 | 784 |                       }
 | 
|---|
 | 785 |                     }
 | 
|---|
 | 786 |                     WinSetWindowText(WinWindowFromID(hwndFrame,
 | 
|---|
 | 787 |                                                      SEEALL_STATUS),
 | 
|---|
 | 788 |                                      GetPString(IDS_COULDNTFITTEXT));
 | 
|---|
 | 789 |                   }
 | 
|---|
 | 790 |                 }
 | 
|---|
 | 791 |                 rc = saymsg(MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION,
 | 
|---|
 | 792 |                             hwndFrame,
 | 
|---|
 | 793 |                             GetPString(IDS_DISKFULLTEXT),
 | 
|---|
 | 794 |                             "%s", GetPString(IDS_ANOTHERDISKTEXT));
 | 
|---|
 | 795 |                 if (rc == MBID_RETRY)
 | 
|---|
 | 796 |                   goto Retry;
 | 
|---|
 | 797 |                 if (rc == MBID_ABORT) {
 | 
|---|
 | 798 |                   FreeList(list);
 | 
|---|
 | 799 |                   goto Abort;
 | 
|---|
 | 800 |                 }
 | 
|---|
 | 801 |               }
 | 
|---|
 | 802 |               else {
 | 
|---|
 | 803 |                 if (LogFileHandle)
 | 
|---|
 | 804 |                   fprintf(LogFileHandle,
 | 
|---|
 | 805 |                           GetPString(IDS_LOGTOFAILEDTEXT),
 | 
|---|
 | 806 |                           move, list[x], newname, rc);
 | 
|---|
 | 807 |                 rc = Dos_Error(MB_ENTERCANCEL,
 | 
|---|
 | 808 |                                rc,
 | 
|---|
 | 809 |                                hwndFrame,
 | 
|---|
 | 810 |                                pszSrcFile,
 | 
|---|
 | 811 |                                __LINE__,
 | 
|---|
 | 812 |                                "%s %s \"%s\" %s\"%s\" %s.",
 | 
|---|
 | 813 |                                move,
 | 
|---|
 | 814 |                                GetPString(IDS_OFTEXT),
 | 
|---|
 | 815 |                                list[x],
 | 
|---|
 | 816 |                                GetPString(IDS_TOTEXT),
 | 
|---|
 | 817 |                                newname, GetPString(IDS_FAILEDTEXT));
 | 
|---|
 | 818 |                 if (rc == MBID_CANCEL) {
 | 
|---|
 | 819 |                   FreeList(list);
 | 
|---|
 | 820 |                   goto Abort;
 | 
|---|
 | 821 |                 }
 | 
|---|
 | 822 |               }
 | 
|---|
 | 823 |             }
 | 
|---|
 | 824 |             else {
 | 
|---|
 | 825 |               if (LogFileHandle)
 | 
|---|
 | 826 |                 fprintf(LogFileHandle,
 | 
|---|
 | 827 |                         "%s \"%s\" %s \"%s\"\n",
 | 
|---|
 | 828 |                         moved, list[x], GetPString(IDS_TOTEXT), newname);
 | 
|---|
 | 829 |               AddToList(newname, &files, &numfiles, &numalloc);
 | 
|---|
 | 830 |             }
 | 
|---|
 | 831 |           }
 | 
|---|
 | 832 |         }
 | 
|---|
 | 833 |         if (SHORT1FROMMP(mp1) != IDM_COPY) {
 | 
|---|
 | 834 |           if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 835 |                        UM_UPDATERECORDLIST, MPFROMP(list), MPVOID))
 | 
|---|
 | 836 |             FreeList(list);
 | 
|---|
 | 837 |         }
 | 
|---|
 | 838 |         else
 | 
|---|
 | 839 |           FreeList(list);
 | 
|---|
 | 840 |         break;
 | 
|---|
| [2] | 841 | 
 | 
|---|
| [551] | 842 |       case IDM_UUDECODE:
 | 
|---|
| [1158] | 843 |         for (x = 0; list[x]; x++)
 | 
|---|
 | 844 |           UUD(list[x], NULL);
 | 
|---|
 | 845 |         break;
 | 
|---|
| [2] | 846 | 
 | 
|---|
| [551] | 847 |       case IDM_EXTRACT:
 | 
|---|
| [1158] | 848 |         for (x = 0; list[x]; x++) {
 | 
|---|
| [2] | 849 | 
 | 
|---|
| [1158] | 850 |           EXTRDATA ex;
 | 
|---|
 | 851 |           BOOL maskspaces = FALSE;
 | 
|---|
| [2] | 852 | 
 | 
|---|
| [1158] | 853 |           memset(&ex, 0, sizeof(ex));
 | 
|---|
 | 854 |           ex.info = find_type(list[x], NULL);
 | 
|---|
 | 855 |           if (!ex.info || (!ex.info->extract && !ex.info->exwdirs))
 | 
|---|
 | 856 |             break;
 | 
|---|
 | 857 |           ex.size = sizeof(ex);
 | 
|---|
 | 858 |           ex.arcname = list[x];
 | 
|---|
 | 859 |           strcpy(ex.masks, "*");
 | 
|---|
 | 860 |           if (!WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 861 |                          hwndFrame,
 | 
|---|
 | 862 |                          ExtractDlgProc,
 | 
|---|
 | 863 |                          FM3ModHandle,
 | 
|---|
 | 864 |                          EXT_FRAME,
 | 
|---|
 | 865 |                          (PVOID) & ex) ||
 | 
|---|
 | 866 |               !ex.ret || !*ex.command || !*ex.arcname || !*ex.extractdir)
 | 
|---|
 | 867 |             break;
 | 
|---|
 | 868 |           if (IsFile(ex.extractdir) != 0)
 | 
|---|
 | 869 |             Runtime_Error(pszSrcFile, __LINE__, "directory expected");
 | 
|---|
 | 870 |           else {
 | 
|---|
 | 871 |             if (needs_quoting(ex.masks) && !strchr(ex.masks, '\"'))
 | 
|---|
 | 872 |               maskspaces = TRUE;
 | 
|---|
 | 873 |             runemf2(SEPARATE | WINDOWED |
 | 
|---|
 | 874 |                     (fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED)),
 | 
|---|
| [888] | 875 |                     HWND_DESKTOP, pszSrcFile, __LINE__,
 | 
|---|
 | 876 |                     ex.extractdir, NULL,
 | 
|---|
| [1158] | 877 |                     "%s %s %s%s%s",
 | 
|---|
 | 878 |                     ex.command,
 | 
|---|
 | 879 |                     ex.arcname,
 | 
|---|
 | 880 |                     maskspaces ? "\"" : NullStr,
 | 
|---|
 | 881 |                     *ex.masks ? ex.masks : "*",
 | 
|---|
 | 882 |                     maskspaces ? "\"" : NullStr);
 | 
|---|
 | 883 |           }
 | 
|---|
 | 884 |         }
 | 
|---|
 | 885 |         // fixme to not leak?
 | 
|---|
 | 886 |         if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 887 |                      UM_UPDATERECORDLIST, MPFROMP(list), MPVOID))
 | 
|---|
 | 888 |           FreeList(list);
 | 
|---|
 | 889 |         break;
 | 
|---|
| [2] | 890 | 
 | 
|---|
| [551] | 891 |       case IDM_SUBJECT:
 | 
|---|
| [1158] | 892 |         for (x = 0; list[x]; x++) {
 | 
|---|
| [2] | 893 | 
 | 
|---|
| [1158] | 894 |           INT ret;
 | 
|---|
| [2] | 895 | 
 | 
|---|
| [1158] | 896 |           if (IsFile(list[x]) == 1) {
 | 
|---|
 | 897 |             ret = Subject(hwndFrame, list[x]);
 | 
|---|
 | 898 |             if (!ret)
 | 
|---|
 | 899 |               break;
 | 
|---|
 | 900 |           }
 | 
|---|
 | 901 |         }
 | 
|---|
 | 902 |         if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 903 |                      UM_UPDATERECORDLIST, MPFROMP(list), MPVOID))
 | 
|---|
 | 904 |           FreeList(list);
 | 
|---|
 | 905 |         break;
 | 
|---|
| [2] | 906 | 
 | 
|---|
| [551] | 907 |       case IDM_OPENDEFAULT:
 | 
|---|
 | 908 |       case IDM_OPENSETTINGS:
 | 
|---|
| [1158] | 909 |         for (x = 0; list[x]; x++) {
 | 
|---|
 | 910 |           if (IsFile(list[x]) != -1) {
 | 
|---|
| [2] | 911 | 
 | 
|---|
| [1158] | 912 |             CHAR *s;
 | 
|---|
| [2] | 913 | 
 | 
|---|
| [1158] | 914 |             switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 915 |             case IDM_OPENSETTINGS:
 | 
|---|
 | 916 |               s = Settings;
 | 
|---|
 | 917 |               break;
 | 
|---|
 | 918 |             default:
 | 
|---|
 | 919 |               s = Default;
 | 
|---|
 | 920 |               break;
 | 
|---|
 | 921 |             }
 | 
|---|
 | 922 |             OpenObject(list[x], s, hwndFrame);
 | 
|---|
 | 923 |           }
 | 
|---|
 | 924 |         }
 | 
|---|
 | 925 |         FreeList(list);
 | 
|---|
 | 926 |         break;
 | 
|---|
| [2] | 927 | 
 | 
|---|
| [551] | 928 |       case IDM_DELETE:
 | 
|---|
 | 929 |       case IDM_PERMDELETE:
 | 
|---|
| [1158] | 930 |         {
 | 
|---|
 | 931 |           CHECKLIST cl;
 | 
|---|
 | 932 |           INT isdir = 0, sysdir = 0, ro = 0, hs = 0;
 | 
|---|
 | 933 |           FILESTATUS3 fsa;
 | 
|---|
 | 934 |           CHAR prompt[CCHMAXPATH * 3];
 | 
|---|
 | 935 |           APIRET error;
 | 
|---|
| [2] | 936 | 
 | 
|---|
| [1158] | 937 |           for (x = 0; list[x]; x++) {
 | 
|---|
 | 938 |             if (IsRoot(list[x])) {
 | 
|---|
 | 939 |               list = RemoveFromList(list, list[x]);
 | 
|---|
 | 940 |               if (!list)
 | 
|---|
 | 941 |                 break;
 | 
|---|
 | 942 |               x--;
 | 
|---|
 | 943 |               continue;
 | 
|---|
 | 944 |             }
 | 
|---|
 | 945 |             DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 946 |             if (DosQueryPathInfo(list[x], FIL_STANDARD, &fsa, sizeof(fsa))) {
 | 
|---|
 | 947 |               list = RemoveFromList(list, list[x]);
 | 
|---|
 | 948 |               if (!list)
 | 
|---|
 | 949 |                 break;
 | 
|---|
 | 950 |               x--;
 | 
|---|
 | 951 |               continue;
 | 
|---|
 | 952 |             }
 | 
|---|
 | 953 |             if (fsa.attrFile & FILE_DIRECTORY) {
 | 
|---|
 | 954 |               isdir++;
 | 
|---|
 | 955 |               if (stristr(list[x], ":\\OS2\\") ||
 | 
|---|
 | 956 |                   !stricmp(list[x] + 1, ":\\OS2"))
 | 
|---|
 | 957 |                 sysdir++;
 | 
|---|
 | 958 |             }
 | 
|---|
 | 959 |             else {
 | 
|---|
 | 960 |               if (fsa.attrFile & (FILE_HIDDEN | FILE_SYSTEM))
 | 
|---|
 | 961 |                 hs++;
 | 
|---|
 | 962 |               if (fsa.attrFile & FILE_READONLY)
 | 
|---|
 | 963 |                 ro++;
 | 
|---|
 | 964 |             }
 | 
|---|
 | 965 |           }
 | 
|---|
 | 966 |           if (!list)
 | 
|---|
 | 967 |             break;
 | 
|---|
 | 968 |           if (fConfirmDelete || isdir) {
 | 
|---|
 | 969 |             memset(&cl, 0, sizeof(cl));
 | 
|---|
 | 970 |             cl.size = sizeof(cl);
 | 
|---|
 | 971 |             cl.list = list;
 | 
|---|
 | 972 |             cl.prompt = prompt;
 | 
|---|
 | 973 |             cl.flags |= CHECK_FILES;
 | 
|---|
 | 974 |             cl.cmd = SHORT1FROMMP(mp1);
 | 
|---|
 | 975 |             sprintf(prompt,
 | 
|---|
 | 976 |                     GetPString(IDS_DELPROMPT1TEXT),
 | 
|---|
 | 977 |                     (SHORT1FROMMP(mp1) == IDM_DELETE) ?
 | 
|---|
 | 978 |                     NullStr :
 | 
|---|
 | 979 |                     GetPString(IDS_PERMANENTLYTEXT), &"s"[list[1] == NULL]);
 | 
|---|
 | 980 |             if (isdir) {
 | 
|---|
 | 981 |               sprintf(&prompt[strlen(prompt)],
 | 
|---|
 | 982 |                       GetPString(IDS_DELPROMPT2TEXT),
 | 
|---|
 | 983 |                       isdir,
 | 
|---|
 | 984 |                       (isdir > 1) ?
 | 
|---|
 | 985 |                       GetPString(IDS_ARETEXT) :
 | 
|---|
 | 986 |                       GetPString(IDS_ISTEXT),
 | 
|---|
 | 987 |                       (isdir == 1) ?
 | 
|---|
 | 988 |                       GetPString(IDS_ATEXT) :
 | 
|---|
 | 989 |                       NullStr,
 | 
|---|
 | 990 |                       (isdir > 1) ?
 | 
|---|
 | 991 |                       GetPString(IDS_IESTEXT) : GetPString(IDS_YTEXT));
 | 
|---|
 | 992 |               if (sysdir)
 | 
|---|
 | 993 |                 sprintf(&prompt[strlen(prompt)],
 | 
|---|
 | 994 |                         GetPString(IDS_DELPROMPT3TEXT),
 | 
|---|
 | 995 |                         sysdir,
 | 
|---|
 | 996 |                         (sysdir == 1) ?
 | 
|---|
 | 997 |                         GetPString(IDS_YTEXT) : GetPString(IDS_IESTEXT));
 | 
|---|
 | 998 |             }
 | 
|---|
 | 999 |             if (ro)
 | 
|---|
 | 1000 |               sprintf(&prompt[strlen(prompt)],
 | 
|---|
 | 1001 |                       GetPString(IDS_DELPROMPT4TEXT),
 | 
|---|
 | 1002 |                       ro,
 | 
|---|
 | 1003 |                       &"s"[ro == 1],
 | 
|---|
 | 1004 |                       (ro > 1) ?
 | 
|---|
 | 1005 |                       GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
 | 
|---|
 | 1006 |             if (hs)
 | 
|---|
 | 1007 |               sprintf(&prompt[strlen(prompt)],
 | 
|---|
 | 1008 |                       GetPString(IDS_DELPROMPT5TEXT),
 | 
|---|
 | 1009 |                       hs,
 | 
|---|
 | 1010 |                       &"s"[hs == 1],
 | 
|---|
 | 1011 |                       (hs > 1) ?
 | 
|---|
 | 1012 |                       GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
 | 
|---|
 | 1013 |             if (ro || hs || sysdir)
 | 
|---|
 | 1014 |               DosBeep(300, 100);
 | 
|---|
 | 1015 |             strcat(prompt, GetPString(IDS_DELPROMPT6TEXT));
 | 
|---|
 | 1016 |             if (!WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 1017 |                            WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 1018 |                            CheckListProc,
 | 
|---|
 | 1019 |                            FM3ModHandle, CHECK_FRAME, MPFROMP(&cl)))
 | 
|---|
 | 1020 |               break;
 | 
|---|
 | 1021 |             list = cl.list;
 | 
|---|
 | 1022 |             if (!list || !list[0])
 | 
|---|
 | 1023 |               break;
 | 
|---|
 | 1024 |           }
 | 
|---|
 | 1025 |           for (x = 0; list[x]; x++) {
 | 
|---|
 | 1026 |             fsa.attrFile = 0;
 | 
|---|
 | 1027 |             DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 1028 |             DosQueryPathInfo(list[x], FIL_STANDARD, &fsa, sizeof(fsa));
 | 
|---|
 | 1029 |             if (fsa.attrFile & FILE_DIRECTORY) {
 | 
|---|
 | 1030 |               sprintf(prompt, GetPString(IDS_DELETINGTEXT), list[x]);
 | 
|---|
 | 1031 |               WinSetWindowText(WinWindowFromID(hwndFrame, SEEALL_STATUS),
 | 
|---|
 | 1032 |                                prompt);
 | 
|---|
 | 1033 |               error = (APIRET) wipeallf("%s%s*",
 | 
|---|
 | 1034 |                                         list[x],
 | 
|---|
 | 1035 |                                         (*list[x] &&
 | 
|---|
 | 1036 |                                          list[x][strlen(list[x]) - 1] !=
 | 
|---|
 | 1037 |                                          '\\') ? "\\" : NullStr);
 | 
|---|
 | 1038 |               DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 1039 |               if (!error)
 | 
|---|
 | 1040 |                 error = DosDeleteDir(list[x]);
 | 
|---|
 | 1041 |               else
 | 
|---|
 | 1042 |                 DosDeleteDir(list[x]);
 | 
|---|
 | 1043 |             }
 | 
|---|
 | 1044 |             else {
 | 
|---|
 | 1045 |               DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 1046 |               if (SHORT1FROMMP(mp1) == IDM_DELETE)
 | 
|---|
 | 1047 |                 error = DosDelete(list[x]);
 | 
|---|
 | 1048 |               else
 | 
|---|
 | 1049 |                 error = DosForceDelete(list[x]);
 | 
|---|
 | 1050 |               if (error) {
 | 
|---|
 | 1051 |                 DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 1052 |                 make_deleteable(list[x]);
 | 
|---|
 | 1053 |                 if (SHORT1FROMMP(mp1) == IDM_DELETE)
 | 
|---|
 | 1054 |                   error = DosDelete(list[x]);
 | 
|---|
 | 1055 |                 else
 | 
|---|
 | 1056 |                   error = DosForceDelete(list[x]);
 | 
|---|
 | 1057 |               }
 | 
|---|
 | 1058 |             }
 | 
|---|
 | 1059 |             if (error) {
 | 
|---|
 | 1060 |               if (LogFileHandle)
 | 
|---|
 | 1061 |                 fprintf(LogFileHandle,
 | 
|---|
 | 1062 |                         GetPString(IDS_DELETEFAILED1TEXT), list[x], error);
 | 
|---|
 | 1063 |               if (Dos_Error(MB_ENTERCANCEL,
 | 
|---|
 | 1064 |                             error,
 | 
|---|
 | 1065 |                             hwndFrame,
 | 
|---|
 | 1066 |                             pszSrcFile,
 | 
|---|
 | 1067 |                             __LINE__,
 | 
|---|
 | 1068 |                             GetPString(IDS_DELETEFAILED2TEXT),
 | 
|---|
 | 1069 |                             list[x]) == MBID_CANCEL)
 | 
|---|
 | 1070 |                 break;
 | 
|---|
 | 1071 |             }
 | 
|---|
 | 1072 |             else if (LogFileHandle)
 | 
|---|
 | 1073 |               fprintf(LogFileHandle,
 | 
|---|
 | 1074 |                       "%s\n", GetPString(IDS_DELETEDTEXT), list[x]);
 | 
|---|
 | 1075 |             AddToList(list[x], &files, &numfiles, &numalloc);
 | 
|---|
 | 1076 |           }
 | 
|---|
 | 1077 |         }
 | 
|---|
 | 1078 |         FreeList(list);
 | 
|---|
 | 1079 |         break;
 | 
|---|
| [2] | 1080 | 
 | 
|---|
| [551] | 1081 |       case IDM_SAVETOLIST:
 | 
|---|
| [1158] | 1082 |         if (list) {
 | 
|---|
 | 1083 |           WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 1084 |                     WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 1085 |                     SaveAllListDlgProc,
 | 
|---|
 | 1086 |                     FM3ModHandle, SAV_FRAME, MPFROMP(list));
 | 
|---|
 | 1087 |           FreeList(list);
 | 
|---|
 | 1088 |         }
 | 
|---|
 | 1089 |         break;
 | 
|---|
| [2] | 1090 | 
 | 
|---|
| [551] | 1091 |       case IDM_SAVETOCLIP:
 | 
|---|
 | 1092 |       case IDM_APPENDTOCLIP:
 | 
|---|
| [1084] | 1093 |       case IDM_SAVETOCLIPFILENAME:
 | 
|---|
 | 1094 |       case IDM_APPENDTOCLIPFILENAME:
 | 
|---|
| [1158] | 1095 |         if (list) {
 | 
|---|
 | 1096 |           ListToClipboardHab(WinQueryAnchorBlock(hwnd),
 | 
|---|
 | 1097 |                              list, SHORT1FROMMP(mp1));
 | 
|---|
 | 1098 |           FreeList(list);
 | 
|---|
 | 1099 |         }
 | 
|---|
 | 1100 |         break;
 | 
|---|
| [2] | 1101 | 
 | 
|---|
| [551] | 1102 |       default:
 | 
|---|
| [1158] | 1103 |         if (list)
 | 
|---|
 | 1104 |           FreeList(list);
 | 
|---|
 | 1105 |         break;
 | 
|---|
| [551] | 1106 |       }
 | 
|---|
| [2] | 1107 | 
 | 
|---|
| [551] | 1108 |       switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 1109 |       case IDM_MOVE:
 | 
|---|
 | 1110 |       case IDM_COPY:
 | 
|---|
 | 1111 |       case IDM_RENAME:
 | 
|---|
| [1158] | 1112 |         sprintf(message,
 | 
|---|
 | 1113 |                 GetPString(IDS_OPSCOMPLETETEXT),
 | 
|---|
 | 1114 |                 SHORT1FROMMP(mp1) == IDM_MOVE ?
 | 
|---|
 | 1115 |                   GetPString(IDS_MOVETEXT) :
 | 
|---|
 | 1116 |                   SHORT1FROMMP(mp1) == IDM_COPY ?
 | 
|---|
 | 1117 |                     GetPString(IDS_COPYTEXT) :
 | 
|---|
 | 1118 |                     SHORT1FROMMP(mp1) == IDM_WPSMOVE ?
 | 
|---|
 | 1119 |                       GetPString(IDS_WPSMOVETEXT) :
 | 
|---|
 | 1120 |                       SHORT1FROMMP(mp1) == IDM_WPSCOPY ?
 | 
|---|
 | 1121 |                         GetPString(IDS_WPSCOPYTEXT) :
 | 
|---|
 | 1122 |                         GetPString(IDS_RENAMETEXT),
 | 
|---|
 | 1123 |                 &"s"[x == 1],
 | 
|---|
 | 1124 |                 SHORT1FROMMP(mp1) == IDM_MOVE ||
 | 
|---|
 | 1125 |                 SHORT1FROMMP(mp1) == IDM_COPY ||
 | 
|---|
 | 1126 |                 SHORT1FROMMP(mp1) == IDM_WPSMOVE ||
 | 
|---|
 | 1127 |                 SHORT1FROMMP(mp1) == IDM_WPSCOPY ?
 | 
|---|
 | 1128 |                   GetPString(IDS_TOTEXT) : NullStr,
 | 
|---|
 | 1129 |                 SHORT1FROMMP(mp1) == IDM_MOVE ||
 | 
|---|
 | 1130 |                 SHORT1FROMMP(mp1) == IDM_COPY ||
 | 
|---|
 | 1131 |                 SHORT1FROMMP(mp1) == IDM_WPSCOPY ?
 | 
|---|
 | 1132 |                   path : NullStr,
 | 
|---|
 | 1133 |                 x != 1 ? GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
 | 
|---|
 | 1134 |         WinSetWindowText(WinWindowFromID(hwndFrame, SEEALL_STATUS), message);
 | 
|---|
 | 1135 |         if (toupper(*path) < 'C')
 | 
|---|
 | 1136 |           DosBeep(1000, 25);
 | 
|---|
 | 1137 |         DosSleep(16);                   // 05 Aug 07 GKY 33
 | 
|---|
 | 1138 |         break;
 | 
|---|
| [551] | 1139 | 
 | 
|---|
 | 1140 |       default:
 | 
|---|
| [1158] | 1141 |         break;
 | 
|---|
| [2] | 1142 |       }
 | 
|---|
| [551] | 1143 |     Abort:
 | 
|---|
 | 1144 |       if (files) {
 | 
|---|
| [1158] | 1145 |         if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
 | 1146 |                      UM_UPDATERECORDLIST, MPFROMP(files), MPVOID))
 | 
|---|
 | 1147 |           FreeList(files);
 | 
|---|
| [551] | 1148 |       }
 | 
|---|
 | 1149 |       PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
| [1158] | 1150 |               UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
| [551] | 1151 |     }
 | 
|---|
 | 1152 |     return 0;
 | 
|---|
| [2] | 1153 | 
 | 
|---|
| [551] | 1154 |   case WM_CLOSE:
 | 
|---|
 | 1155 |     WinDestroyWindow(hwnd);
 | 
|---|
 | 1156 |     break;
 | 
|---|
| [2] | 1157 | 
 | 
|---|
| [551] | 1158 |   case WM_DESTROY:
 | 
|---|
 | 1159 |     if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID))
 | 
|---|
 | 1160 |       WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
 | 
|---|
 | 1161 |     break;
 | 
|---|
| [2] | 1162 |   }
 | 
|---|
| [551] | 1163 |   return WinDefWindowProc(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 1164 | }
 | 
|---|
 | 1165 | 
 | 
|---|
| [551] | 1166 | static VOID MakeSeeObjWinThread(VOID * args)
 | 
|---|
| [162] | 1167 | {
 | 
|---|
| [551] | 1168 |   HAB hab2;
 | 
|---|
 | 1169 |   HMQ hmq2;
 | 
|---|
 | 1170 |   HWND hwndObj;
 | 
|---|
 | 1171 |   ALLDATA *ad = (ALLDATA *) args;
 | 
|---|
 | 1172 |   QMSG qmsg2;
 | 
|---|
| [2] | 1173 | 
 | 
|---|
| [551] | 1174 |   if (ad) {
 | 
|---|
| [1063] | 1175 | #   ifdef FORTIFY
 | 
|---|
 | 1176 |     Fortify_EnterScope();
 | 
|---|
 | 1177 | #    endif
 | 
|---|
| [2] | 1178 |     hab2 = WinInitialize(0);
 | 
|---|
| [551] | 1179 |     if (hab2) {
 | 
|---|
 | 1180 |       hmq2 = WinCreateMsgQueue(hab2, 256);
 | 
|---|
 | 1181 |       if (hmq2) {
 | 
|---|
| [1158] | 1182 |         DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 1183 |         WinRegisterClass(hab2,
 | 
|---|
 | 1184 |                          WC_OBJECTWINDOW,
 | 
|---|
 | 1185 |                          SeeObjWndProc, 0, sizeof(PVOID));
 | 
|---|
 | 1186 |         hwndObj = WinCreateWindow(HWND_OBJECT,
 | 
|---|
 | 1187 |                                   WC_OBJECTWINDOW,
 | 
|---|
 | 1188 |                                   (PSZ) NULL,
 | 
|---|
 | 1189 |                                   0,
 | 
|---|
 | 1190 |                                   0,
 | 
|---|
 | 1191 |                                   0,
 | 
|---|
 | 1192 |                                   0,
 | 
|---|
 | 1193 |                                   0, 0, HWND_TOP, SEEALL_OBJ, NULL, NULL);
 | 
|---|
 | 1194 |         if (!hwndObj) {
 | 
|---|
 | 1195 |           Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,
 | 
|---|
 | 1196 |                      IDS_WINCREATEWINDOW);
 | 
|---|
 | 1197 |           if (!PostMsg(ad->hwndClient, WM_CLOSE, MPVOID, MPVOID))
 | 
|---|
 | 1198 |             WinSendMsg(ad->hwndClient, WM_CLOSE, MPVOID, MPVOID);
 | 
|---|
 | 1199 |         }
 | 
|---|
 | 1200 |         else {
 | 
|---|
 | 1201 |           ad->hwndObj = hwndObj;
 | 
|---|
 | 1202 |           WinSetWindowULong(hwndObj, QWL_USER, ad->hwndFrame);
 | 
|---|
 | 1203 |           priority_normal();
 | 
|---|
 | 1204 |           while (WinGetMsg(hab2, &qmsg2, (HWND) 0, 0, 0))
 | 
|---|
 | 1205 |             WinDispatchMsg(hab2, &qmsg2);
 | 
|---|
 | 1206 |           WinDestroyWindow(hwndObj);
 | 
|---|
 | 1207 |         }
 | 
|---|
 | 1208 |         WinDestroyMsgQueue(hmq2);
 | 
|---|
| [2] | 1209 |       }
 | 
|---|
 | 1210 |       else
 | 
|---|
| [1038] | 1211 |         WinTerminate(hab2);
 | 
|---|
| [1063] | 1212 |     }
 | 
|---|
 | 1213 | #   ifdef FORTIFY
 | 
|---|
| [1038] | 1214 |     Fortify_LeaveScope();
 | 
|---|
| [1063] | 1215 | #    endif
 | 
|---|
| [2] | 1216 |   }
 | 
|---|
 | 1217 | }
 | 
|---|
 | 1218 | 
 | 
|---|
| [551] | 1219 | static VOID SelectMask(HWND hwnd, BOOL deselect)
 | 
|---|
| [84] | 1220 | {
 | 
|---|
| [551] | 1221 |   MASK mask;
 | 
|---|
 | 1222 |   register ULONG x, y, z;
 | 
|---|
 | 1223 |   BOOL ret;
 | 
|---|
 | 1224 |   ALLDATA *pAD = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [2] | 1225 | 
 | 
|---|
| [551] | 1226 |   memset(&mask, 0, sizeof(mask));
 | 
|---|
| [2] | 1227 |   mask.fNoAttribs = FALSE;
 | 
|---|
 | 1228 |   mask.fNoDirs = TRUE;
 | 
|---|
| [84] | 1229 |   mask.attrFile = pAD->mask.attrFile;
 | 
|---|
 | 1230 |   mask.antiattr = pAD->mask.antiattr;
 | 
|---|
| [2] | 1231 |   mask.fIsSeeAll = TRUE;
 | 
|---|
 | 1232 |   strcpy(mask.prompt,
 | 
|---|
| [1158] | 1233 |          GetPString((!deselect) ?
 | 
|---|
 | 1234 |                     IDS_SELECTFILTERTEXT : IDS_DESELECTFILTERTEXT));
 | 
|---|
| [84] | 1235 |   if (WinDlgBox(HWND_DESKTOP,
 | 
|---|
| [1158] | 1236 |                 hwnd,
 | 
|---|
 | 1237 |                 PickMaskDlgProc,
 | 
|---|
 | 1238 |                 FM3ModHandle,
 | 
|---|
 | 1239 |                 MSK_FRAME,
 | 
|---|
 | 1240 |                 MPFROMP(&mask)) &&
 | 
|---|
| [551] | 1241 |       (*mask.szMask ||
 | 
|---|
 | 1242 |        mask.attrFile != pAD->mask.attrFile ||
 | 
|---|
 | 1243 |        mask.antiattr != pAD->mask.antiattr)) {
 | 
|---|
| [943] | 1244 |     for (x = 0; x < pAD->afindexcnt; x++) {
 | 
|---|
 | 1245 |       y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - x : x;
 | 
|---|
| [2] | 1246 |       ret = FALSE;
 | 
|---|
| [84] | 1247 |       if (mask.pszMasks[1]) {
 | 
|---|
| [1158] | 1248 |         for (z = 0; mask.pszMasks[z]; z++) {
 | 
|---|
 | 1249 |           if (*mask.pszMasks[z]) {
 | 
|---|
 | 1250 |             if (*mask.pszMasks[z] != '/') {
 | 
|---|
 | 1251 |               if (wildcard((strchr(mask.pszMasks[z], '\\') ||
 | 
|---|
 | 1252 |                             strchr(mask.pszMasks[z], ':')) ?
 | 
|---|
 | 1253 |                            pAD->afindex[y]->fullname : pAD->afindex[y]->
 | 
|---|
 | 1254 |                            filename, mask.pszMasks[z], FALSE))
 | 
|---|
 | 1255 |                 ret = TRUE;
 | 
|---|
 | 1256 |             }
 | 
|---|
 | 1257 |             else {
 | 
|---|
 | 1258 |               if (wildcard((strchr(mask.pszMasks[z], '\\') ||
 | 
|---|
 | 1259 |                             strchr(mask.pszMasks[z], ':')) ?
 | 
|---|
 | 1260 |                            pAD->afindex[y]->fullname : pAD->afindex[y]->
 | 
|---|
 | 1261 |                            filename, mask.pszMasks[y] + 1, FALSE)) {
 | 
|---|
 | 1262 |                 ret = FALSE;
 | 
|---|
 | 1263 |                 break;
 | 
|---|
 | 1264 |               }
 | 
|---|
 | 1265 |             }
 | 
|---|
 | 1266 |           }
 | 
|---|
 | 1267 |         }
 | 
|---|
| [2] | 1268 |       }
 | 
|---|
| [84] | 1269 |       else if (*mask.szMask) {
 | 
|---|
| [1158] | 1270 |         if (wildcard((strchr(mask.szMask, '\\') ||
 | 
|---|
 | 1271 |                       strchr(mask.szMask, ':')) ?
 | 
|---|
 | 1272 |                      pAD->afindex[y]->fullname : pAD->afindex[y]->filename,
 | 
|---|
 | 1273 |                      mask.szMask, FALSE))
 | 
|---|
 | 1274 |           ret = TRUE;
 | 
|---|
| [2] | 1275 |       }
 | 
|---|
 | 1276 |       else
 | 
|---|
| [1158] | 1277 |         ret = TRUE;
 | 
|---|
| [84] | 1278 |       if (ret) {
 | 
|---|
| [1158] | 1279 |         if ((!(mask.attrFile & FILE_HIDDEN)
 | 
|---|
 | 1280 |              && (pAD->afindex[y]->attrFile & FILE_HIDDEN))
 | 
|---|
 | 1281 |             || (!(mask.attrFile & FILE_SYSTEM)
 | 
|---|
 | 1282 |                 && (pAD->afindex[y]->attrFile & FILE_SYSTEM))
 | 
|---|
 | 1283 |             || (!(mask.attrFile & FILE_READONLY)
 | 
|---|
 | 1284 |                 && (pAD->afindex[y]->attrFile & FILE_READONLY))
 | 
|---|
 | 1285 |             || (!(mask.attrFile & FILE_ARCHIVED)
 | 
|---|
 | 1286 |                 && (pAD->afindex[y]->attrFile & FILE_ARCHIVED)))
 | 
|---|
 | 1287 |           ret = FALSE;
 | 
|---|
 | 1288 |         else
 | 
|---|
 | 1289 |           if (((mask.antiattr & FILE_HIDDEN)
 | 
|---|
 | 1290 |                && !(pAD->afindex[y]->attrFile & FILE_HIDDEN))
 | 
|---|
 | 1291 |               || ((mask.antiattr & FILE_SYSTEM)
 | 
|---|
 | 1292 |                   && !(pAD->afindex[y]->attrFile & FILE_SYSTEM))
 | 
|---|
 | 1293 |               || ((mask.antiattr & FILE_READONLY)
 | 
|---|
 | 1294 |                   && !(pAD->afindex[y]->attrFile & FILE_READONLY))
 | 
|---|
 | 1295 |               || ((mask.antiattr & FILE_ARCHIVED)
 | 
|---|
 | 1296 |                   && !(pAD->afindex[y]->attrFile & FILE_ARCHIVED)))
 | 
|---|
 | 1297 |           ret = FALSE;
 | 
|---|
| [2] | 1298 |       }
 | 
|---|
| [84] | 1299 |       if (ret) {
 | 
|---|
| [1158] | 1300 |         if (deselect) {
 | 
|---|
 | 1301 |           if (pAD->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 1302 |             pAD->selected--;
 | 
|---|
 | 1303 |             pAD->ullSelectedBytes -= pAD->afindex[y]->cbFile;
 | 
|---|
 | 1304 |             pAD->afindex[y]->flags &= ~AF_SELECTED;
 | 
|---|
 | 1305 |           }
 | 
|---|
 | 1306 |         }
 | 
|---|
 | 1307 |         else {
 | 
|---|
 | 1308 |           if (~pAD->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 1309 |             pAD->selected++;
 | 
|---|
 | 1310 |             pAD->ullSelectedBytes += pAD->afindex[y]->cbFile;
 | 
|---|
 | 1311 |             pAD->afindex[y]->flags |= AF_SELECTED;
 | 
|---|
 | 1312 |           }
 | 
|---|
 | 1313 |         }
 | 
|---|
| [2] | 1314 |       }
 | 
|---|
| [1158] | 1315 |     }                                   // for
 | 
|---|
| [2] | 1316 |   }
 | 
|---|
 | 1317 | }
 | 
|---|
 | 1318 | 
 | 
|---|
| [551] | 1319 | static VOID CollectList(HWND hwnd, CHAR ** list)
 | 
|---|
| [162] | 1320 | {
 | 
|---|
| [551] | 1321 |   if (!Collector) {
 | 
|---|
 | 1322 |     if (hwndMain && !fExternalCollector && !strcmp(realappname, FM3Str)) {
 | 
|---|
| [2] | 1323 | 
 | 
|---|
 | 1324 |       HWND hwndC;
 | 
|---|
| [551] | 1325 |       SWP swp;
 | 
|---|
| [2] | 1326 | 
 | 
|---|
| [551] | 1327 |       if (!fAutoTile)
 | 
|---|
| [1158] | 1328 |         GetNextWindowPos(hwndMain, &swp, NULL, NULL);
 | 
|---|
| [551] | 1329 |       hwndC = StartCollector(hwndMain, 4);
 | 
|---|
 | 1330 |       if (hwndC) {
 | 
|---|
| [1158] | 1331 |         if (!fAutoTile)
 | 
|---|
 | 1332 |           WinSetWindowPos(hwndC, HWND_TOP, swp.x, swp.y,
 | 
|---|
 | 1333 |                           swp.cx, swp.cy, SWP_MOVE | SWP_SIZE |
 | 
|---|
 | 1334 |                           SWP_SHOW | SWP_ZORDER);
 | 
|---|
 | 1335 |         else
 | 
|---|
 | 1336 |           TileChildren(hwndMain, TRUE);
 | 
|---|
 | 1337 |         WinSetWindowPos(hwndC, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE);
 | 
|---|
 | 1338 |         DosSleep(100);//05 Aug 07 GKY 250
 | 
|---|
| [2] | 1339 |       }
 | 
|---|
 | 1340 |     }
 | 
|---|
 | 1341 |     else {
 | 
|---|
| [551] | 1342 |       StartCollector(HWND_DESKTOP, 4);
 | 
|---|
| [771] | 1343 |       DosSleep(100);//05 Aug 07 GKY 250
 | 
|---|
| [2] | 1344 |     }
 | 
|---|
 | 1345 |   }
 | 
|---|
| [551] | 1346 |   if (!PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_COLLECTOR, 0),
 | 
|---|
| [1158] | 1347 |                MPFROMP(list)))
 | 
|---|
| [2] | 1348 |     FreeList(list);
 | 
|---|
 | 1349 | }
 | 
|---|
 | 1350 | 
 | 
|---|
| [551] | 1351 | static VOID FreeAllFilesList(HWND hwnd)
 | 
|---|
| [162] | 1352 | {
 | 
|---|
| [551] | 1353 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [2] | 1354 |   register ULONG x;
 | 
|---|
 | 1355 | 
 | 
|---|
| [943] | 1356 |   if (ad->afhead && ad->afheadcnt) {
 | 
|---|
 | 1357 |     for (x = 0; x < ad->afheadcnt; x++) {
 | 
|---|
| [1009] | 1358 |       xfree(ad->afhead[x].fullname, pszSrcFile, __LINE__);
 | 
|---|
| [2] | 1359 |     }
 | 
|---|
| [1039] | 1360 |     free(ad->afhead);
 | 
|---|
| [2] | 1361 |     ad->afhead = NULL;
 | 
|---|
| [1009] | 1362 |     xfree(ad->afindex, pszSrcFile, __LINE__);
 | 
|---|
| [2] | 1363 |     ad->afindex = NULL;
 | 
|---|
 | 1364 |   }
 | 
|---|
 | 1365 |   DosPostEventSem(CompactSem);
 | 
|---|
| [943] | 1366 |   ad->afalloc = ad->afindexcnt = ad->afheadcnt = ad->longest = ad->longestw =
 | 
|---|
| [2] | 1367 |     ad->maxx = ad->horzscroll = 0;
 | 
|---|
 | 1368 | }
 | 
|---|
 | 1369 | 
 | 
|---|
| [551] | 1370 | static CHAR **BuildAList(HWND hwnd)
 | 
|---|
| [162] | 1371 | {
 | 
|---|
| [551] | 1372 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
 | 1373 |   ULONG x;
 | 
|---|
 | 1374 |   ULONG y;
 | 
|---|
 | 1375 |   ULONG z = 0;
 | 
|---|
 | 1376 |   CHAR **list = NULL;
 | 
|---|
| [907] | 1377 |   UINT numfiles = 0;
 | 
|---|
 | 1378 |   UINT numalloc = 0;
 | 
|---|
| [551] | 1379 |   INT error;
 | 
|---|
| [2] | 1380 | 
 | 
|---|
| [551] | 1381 |   if (ad->selected) {
 | 
|---|
| [943] | 1382 |     for (x = 0; x < ad->afindexcnt; x++) {
 | 
|---|
 | 1383 |       y = (ad->invertsort) ? (ad->afindexcnt - 1) - x : x;
 | 
|---|
| [551] | 1384 |       if (ad->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
| [1158] | 1385 |         error = AddToList(ad->afindex[y]->fullname, &list,
 | 
|---|
 | 1386 |                           &numfiles, &numalloc);
 | 
|---|
 | 1387 |         if (error)
 | 
|---|
 | 1388 |           break;
 | 
|---|
 | 1389 |         z++;
 | 
|---|
 | 1390 |         if (z >= ad->selected)
 | 
|---|
 | 1391 |           break;
 | 
|---|
| [2] | 1392 |       }
 | 
|---|
 | 1393 |     }
 | 
|---|
 | 1394 |   }
 | 
|---|
 | 1395 |   return list;
 | 
|---|
 | 1396 | }
 | 
|---|
 | 1397 | 
 | 
|---|
| [551] | 1398 | static BOOL Mark(HWND hwnd, INT command, CHAR ** list)
 | 
|---|
| [84] | 1399 | {
 | 
|---|
| [2] | 1400 |   /* Marks only unfiltered files */
 | 
|---|
 | 1401 | 
 | 
|---|
| [551] | 1402 |   ALLDATA *pAD = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
 | 1403 |   register ULONG x, y, z;
 | 
|---|
 | 1404 |   BOOL ret = TRUE;
 | 
|---|
 | 1405 |   BOOL didone = FALSE;
 | 
|---|
| [2] | 1406 | 
 | 
|---|
| [943] | 1407 |   for (x = 0; x < pAD->afindexcnt; x++) {
 | 
|---|
 | 1408 |     y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - x : x;
 | 
|---|
| [551] | 1409 |     if (list) {
 | 
|---|
| [2] | 1410 |       ret = FALSE;
 | 
|---|
| [551] | 1411 |       for (z = 0; list[z]; z++) {
 | 
|---|
| [1158] | 1412 |         if (!stricmp(list[z], pAD->afindex[y]->fullname)) {
 | 
|---|
 | 1413 |           ret = TRUE;
 | 
|---|
 | 1414 |           break;
 | 
|---|
 | 1415 |         }
 | 
|---|
| [2] | 1416 |       }
 | 
|---|
 | 1417 |     }
 | 
|---|
| [551] | 1418 |     if (ret) {
 | 
|---|
| [2] | 1419 |       didone = TRUE;
 | 
|---|
| [84] | 1420 |       if (command == AFM_UNMARK) {
 | 
|---|
| [1158] | 1421 |         if (pAD->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 1422 |           pAD->selected--;
 | 
|---|
 | 1423 |           pAD->ullSelectedBytes -= pAD->afindex[y]->cbFile;
 | 
|---|
 | 1424 |           pAD->afindex[y]->flags &= ~AF_SELECTED;
 | 
|---|
 | 1425 |         }
 | 
|---|
| [2] | 1426 |       }
 | 
|---|
| [84] | 1427 |       else if (command == AFM_MARK) {
 | 
|---|
| [1158] | 1428 |         if (~pAD->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 1429 |           pAD->selected++;
 | 
|---|
 | 1430 |           pAD->ullSelectedBytes += pAD->afindex[y]->cbFile;
 | 
|---|
 | 1431 |           pAD->afindex[y]->flags |= AF_SELECTED;
 | 
|---|
 | 1432 |         }
 | 
|---|
| [2] | 1433 |       }
 | 
|---|
| [84] | 1434 |       else if (command == AFM_INVERT) {
 | 
|---|
| [1158] | 1435 |         if (pAD->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 1436 |           pAD->selected--;
 | 
|---|
 | 1437 |           pAD->ullSelectedBytes -= pAD->afindex[y]->cbFile;
 | 
|---|
 | 1438 |           pAD->afindex[y]->flags &= ~AF_SELECTED;
 | 
|---|
 | 1439 |         }
 | 
|---|
 | 1440 |         else {
 | 
|---|
 | 1441 |           pAD->selected++;
 | 
|---|
 | 1442 |           pAD->ullSelectedBytes += pAD->afindex[y]->cbFile;
 | 
|---|
 | 1443 |           pAD->afindex[y]->flags |= AF_SELECTED;
 | 
|---|
 | 1444 |         }
 | 
|---|
| [2] | 1445 |       }
 | 
|---|
| [84] | 1446 |       else if (command == AFM_MARKDELETED) {
 | 
|---|
| [1158] | 1447 |         if (pAD->afindex[y]->flags & AF_SELECTED)
 | 
|---|
 | 1448 |           pAD->afindex[y]->flags |= AF_DELETED;
 | 
|---|
| [2] | 1449 |       }
 | 
|---|
| [551] | 1450 |       else if (command == AFM_FILTER) {
 | 
|---|
| [1158] | 1451 |         if (pAD->afindex[y]->flags & AF_SELECTED)
 | 
|---|
 | 1452 |           pAD->afindex[y]->flags |= AF_FILTERED;
 | 
|---|
| [2] | 1453 |       }
 | 
|---|
 | 1454 |     }
 | 
|---|
| [1158] | 1455 |   }                                     // for x
 | 
|---|
| [2] | 1456 |   return didone;
 | 
|---|
 | 1457 | }
 | 
|---|
 | 1458 | 
 | 
|---|
| [783] | 1459 | static BOOL UpdateList(HWND hwnd, CHAR **list)
 | 
|---|
| [162] | 1460 | {
 | 
|---|
| [2] | 1461 |   /* Updates files in the list */
 | 
|---|
 | 1462 | 
 | 
|---|
| [551] | 1463 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [783] | 1464 |   ULONG x, z;
 | 
|---|
| [551] | 1465 |   BOOL ret, didone = FALSE;
 | 
|---|
| [841] | 1466 |   FILEFINDBUF3L ffb;
 | 
|---|
| [783] | 1467 |   ULONG ulFindCnt;
 | 
|---|
| [551] | 1468 |   HDIR hdir;
 | 
|---|
 | 1469 |   CHAR *p;
 | 
|---|
| [2] | 1470 | 
 | 
|---|
| [551] | 1471 |   if (list) {
 | 
|---|
 | 1472 |     for (z = 0; list[z] && !ad->stopflag; z++) {
 | 
|---|
| [2] | 1473 |       ret = FALSE;
 | 
|---|
| [943] | 1474 |       for (x = 0; x < ad->afheadcnt; x++) {
 | 
|---|
| [1158] | 1475 |         if (!stricmp(list[z], ad->afhead[x].fullname)) {
 | 
|---|
 | 1476 |           ret = TRUE;
 | 
|---|
 | 1477 |           break;
 | 
|---|
 | 1478 |         }
 | 
|---|
| [2] | 1479 |       }
 | 
|---|
| [551] | 1480 |       if (ret) {
 | 
|---|
| [1158] | 1481 |         didone = TRUE;
 | 
|---|
 | 1482 |         hdir = HDIR_CREATE;
 | 
|---|
 | 1483 |         ulFindCnt = 1;
 | 
|---|
 | 1484 |         if (!xDosFindFirst(list[z], &hdir, FILE_NORMAL | FILE_ARCHIVED |
 | 
|---|
 | 1485 |                            FILE_DIRECTORY | FILE_READONLY | FILE_SYSTEM |
 | 
|---|
 | 1486 |                            FILE_HIDDEN, &ffb, sizeof(ffb), &ulFindCnt,
 | 
|---|
 | 1487 |                            FIL_STANDARDL)) {
 | 
|---|
 | 1488 |           DosFindClose(hdir);
 | 
|---|
 | 1489 |           if (!(ffb.attrFile & FILE_DIRECTORY)) {
 | 
|---|
 | 1490 |             ad->afhead[x].attrFile = (USHORT) ffb.attrFile;
 | 
|---|
 | 1491 |             ad->afhead[x].cbFile = ffb.cbFile;
 | 
|---|
 | 1492 |             ad->afhead[x].date = ffb.fdateLastWrite;
 | 
|---|
 | 1493 |             ad->afhead[x].time = ffb.ftimeLastWrite;
 | 
|---|
 | 1494 |           }
 | 
|---|
 | 1495 |           else
 | 
|---|
 | 1496 |             ad->afhead[x].flags |= AF_DELETED;
 | 
|---|
 | 1497 |         }
 | 
|---|
 | 1498 |         else
 | 
|---|
 | 1499 |           ad->afhead[x].flags |= AF_DELETED;
 | 
|---|
| [2] | 1500 |       }
 | 
|---|
| [551] | 1501 |       else if (isalpha(*list[z]) && ad->abDrvFlags[toupper(*list[z]) - 'A']) {
 | 
|---|
| [1158] | 1502 |         didone = TRUE;
 | 
|---|
 | 1503 |         hdir = HDIR_CREATE;
 | 
|---|
 | 1504 |         ulFindCnt = 1;
 | 
|---|
 | 1505 |         if (!xDosFindFirst(list[z], &hdir, FILE_NORMAL | FILE_ARCHIVED |
 | 
|---|
 | 1506 |                            FILE_DIRECTORY | FILE_READONLY | FILE_SYSTEM |
 | 
|---|
 | 1507 |                            FILE_HIDDEN, &ffb, sizeof(ffb), &ulFindCnt,
 | 
|---|
 | 1508 |                            FIL_STANDARDL)) {
 | 
|---|
 | 1509 |           DosFindClose(hdir);
 | 
|---|
 | 1510 |           if (!(ffb.attrFile & FILE_DIRECTORY)) {
 | 
|---|
 | 1511 |             if (!ad->afalloc || ad->afheadcnt > ad->afalloc - 1) {
 | 
|---|
| [2] | 1512 | 
 | 
|---|
| [1158] | 1513 |               ALLFILES *temp, **templ;
 | 
|---|
| [2] | 1514 | 
 | 
|---|
| [1158] | 1515 |               temp =
 | 
|---|
 | 1516 |                 xrealloc(ad->afhead, (ad->afalloc + 1) * sizeof(ALLFILES),
 | 
|---|
 | 1517 |                          pszSrcFile, __LINE__);
 | 
|---|
 | 1518 |               if (!temp) {
 | 
|---|
 | 1519 |                 ad->stopflag = 1;
 | 
|---|
 | 1520 |                 break;
 | 
|---|
 | 1521 |               }
 | 
|---|
 | 1522 |               else {
 | 
|---|
 | 1523 |                 ad->afhead = temp;
 | 
|---|
 | 1524 |                 templ =
 | 
|---|
 | 1525 |                   xrealloc(ad->afindex,
 | 
|---|
 | 1526 |                            (ad->afalloc + 1) * sizeof(ALLFILES *), pszSrcFile,
 | 
|---|
 | 1527 |                            __LINE__);
 | 
|---|
 | 1528 |                 if (!templ) {
 | 
|---|
 | 1529 |                   ad->stopflag = 1;
 | 
|---|
 | 1530 |                   break;
 | 
|---|
 | 1531 |                 }
 | 
|---|
 | 1532 |                 else
 | 
|---|
 | 1533 |                   ad->afindex = templ;
 | 
|---|
 | 1534 |                 ad->afalloc++;
 | 
|---|
 | 1535 |               }
 | 
|---|
 | 1536 |             }
 | 
|---|
 | 1537 |             ad->afhead[ad->afheadcnt].fullname =
 | 
|---|
 | 1538 |               xstrdup(list[z], pszSrcFile, __LINE__);
 | 
|---|
 | 1539 |             if (ad->afhead[ad->afheadcnt].fullname) {
 | 
|---|
 | 1540 |               p = strrchr(ad->afhead[ad->afheadcnt].fullname, '\\');
 | 
|---|
 | 1541 |               if (!p)
 | 
|---|
 | 1542 |                 p = ad->afhead[ad->afheadcnt].fullname;
 | 
|---|
 | 1543 |               else
 | 
|---|
 | 1544 |                 p++;
 | 
|---|
 | 1545 |               ad->afhead[ad->afheadcnt].filename = p;
 | 
|---|
 | 1546 |               ad->afhead[ad->afheadcnt].cbFile = ffb.cbFile;
 | 
|---|
 | 1547 |               ad->afhead[ad->afheadcnt].date = ffb.fdateLastWrite;
 | 
|---|
 | 1548 |               ad->afhead[ad->afheadcnt].time = ffb.ftimeLastWrite;
 | 
|---|
 | 1549 |               ad->afhead[ad->afheadcnt].attrFile = (USHORT) ffb.attrFile;
 | 
|---|
 | 1550 |               ad->afhead[ad->afheadcnt].flags = 0;
 | 
|---|
 | 1551 |               if (ad->longest < strlen(ad->afhead[ad->afheadcnt].filename))
 | 
|---|
 | 1552 |                 ad->longest = strlen(ad->afhead[ad->afheadcnt].filename);
 | 
|---|
 | 1553 |               if (ad->longestw < strlen(ad->afhead[ad->afheadcnt].fullname))
 | 
|---|
 | 1554 |                 ad->longestw = strlen(ad->afhead[ad->afheadcnt].fullname);
 | 
|---|
| [2] | 1555 | 
 | 
|---|
| [1158] | 1556 |               ad->afheadcnt++;
 | 
|---|
 | 1557 |             }
 | 
|---|
 | 1558 |             else {
 | 
|---|
 | 1559 |               // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Strdup failed.");
 | 
|---|
 | 1560 |               ad->stopflag = 1;
 | 
|---|
 | 1561 |               break;
 | 
|---|
 | 1562 |             }
 | 
|---|
 | 1563 |           }
 | 
|---|
 | 1564 |         }
 | 
|---|
| [2] | 1565 |       }
 | 
|---|
 | 1566 |     }
 | 
|---|
 | 1567 |   }
 | 
|---|
 | 1568 |   return didone;
 | 
|---|
 | 1569 | }
 | 
|---|
 | 1570 | 
 | 
|---|
| [551] | 1571 | static int comparefullnames(const void *v1, const void *v2)
 | 
|---|
| [162] | 1572 | {
 | 
|---|
| [551] | 1573 |   ALLFILES *d1 = *(ALLFILES **) v1;
 | 
|---|
 | 1574 |   ALLFILES *d2 = *(ALLFILES **) v2;
 | 
|---|
 | 1575 |   int ret;
 | 
|---|
| [2] | 1576 | 
 | 
|---|
| [551] | 1577 |   ret = stricmp(d1->fullname, d2->fullname);
 | 
|---|
| [2] | 1578 |   return ret;
 | 
|---|
 | 1579 | }
 | 
|---|
 | 1580 | 
 | 
|---|
| [551] | 1581 | static int comparenames(const void *v1, const void *v2)
 | 
|---|
| [162] | 1582 | {
 | 
|---|
| [551] | 1583 |   ALLFILES *d1 = *(ALLFILES **) v1;
 | 
|---|
 | 1584 |   ALLFILES *d2 = *(ALLFILES **) v2;
 | 
|---|
 | 1585 |   int ret;
 | 
|---|
| [2] | 1586 | 
 | 
|---|
| [551] | 1587 |   ret = stricmp(d1->filename, d2->filename);
 | 
|---|
 | 1588 |   if (!ret)
 | 
|---|
 | 1589 |     ret = comparefullnames(v1, v2);
 | 
|---|
| [2] | 1590 |   return ret;
 | 
|---|
 | 1591 | }
 | 
|---|
 | 1592 | 
 | 
|---|
| [551] | 1593 | static int compareexts(const void *v1, const void *v2)
 | 
|---|
| [162] | 1594 | {
 | 
|---|
| [551] | 1595 |   ALLFILES *d1 = *(ALLFILES **) v1;
 | 
|---|
 | 1596 |   ALLFILES *d2 = *(ALLFILES **) v2;
 | 
|---|
 | 1597 |   register CHAR *p1, *p2;
 | 
|---|
 | 1598 |   int ret;
 | 
|---|
| [2] | 1599 | 
 | 
|---|
| [551] | 1600 |   p1 = strrchr(d1->filename, '.');
 | 
|---|
 | 1601 |   p2 = strrchr(d2->filename, '.');
 | 
|---|
 | 1602 |   if (!p1)
 | 
|---|
| [2] | 1603 |     p1 = NullStr;
 | 
|---|
 | 1604 |   else
 | 
|---|
 | 1605 |     p1++;
 | 
|---|
| [551] | 1606 |   if (!p2)
 | 
|---|
| [2] | 1607 |     p2 = NullStr;
 | 
|---|
 | 1608 |   else
 | 
|---|
 | 1609 |     p2++;
 | 
|---|
| [551] | 1610 |   ret = stricmp(p1, p2);
 | 
|---|
 | 1611 |   if (!ret)
 | 
|---|
 | 1612 |     ret = comparenames(v1, v2);
 | 
|---|
| [2] | 1613 |   return ret;
 | 
|---|
 | 1614 | }
 | 
|---|
 | 1615 | 
 | 
|---|
| [551] | 1616 | static int comparesizes(const void *v1, const void *v2)
 | 
|---|
| [162] | 1617 | {
 | 
|---|
| [551] | 1618 |   ALLFILES *d1 = *(ALLFILES **) v1;
 | 
|---|
 | 1619 |   ALLFILES *d2 = *(ALLFILES **) v2;
 | 
|---|
 | 1620 |   int ret;
 | 
|---|
| [2] | 1621 | 
 | 
|---|
 | 1622 |   ret = (d1->cbFile > d2->cbFile) ? 1 : (d1->cbFile == d2->cbFile) ? 0 : -1;
 | 
|---|
| [551] | 1623 |   if (!ret)
 | 
|---|
 | 1624 |     ret = comparenames(v1, v2);
 | 
|---|
| [2] | 1625 |   return ret;
 | 
|---|
 | 1626 | }
 | 
|---|
 | 1627 | 
 | 
|---|
| [551] | 1628 | static int comparedates(const void *v1, const void *v2)
 | 
|---|
| [162] | 1629 | {
 | 
|---|
| [551] | 1630 |   ALLFILES *d1 = *(ALLFILES **) v1;
 | 
|---|
 | 1631 |   ALLFILES *d2 = *(ALLFILES **) v2;
 | 
|---|
| [2] | 1632 |   int ret;
 | 
|---|
 | 1633 | 
 | 
|---|
| [897] | 1634 |   ret = TestFDates(NULL, NULL,
 | 
|---|
 | 1635 |                   &d2->date, &d2->time,
 | 
|---|
 | 1636 |                   &d1->date, &d1->time);
 | 
|---|
 | 1637 |     /*(d1->date.year > d2->date.year) ? 1 :
 | 
|---|
| [551] | 1638 |     (d1->date.year < d2->date.year) ? -1 :
 | 
|---|
 | 1639 |     (d1->date.month > d2->date.month) ? 1 :
 | 
|---|
 | 1640 |     (d1->date.month < d2->date.month) ? -1 :
 | 
|---|
 | 1641 |     (d1->date.day > d2->date.day) ? 1 :
 | 
|---|
 | 1642 |     (d1->date.day < d2->date.day) ? -1 :
 | 
|---|
 | 1643 |     (d1->time.hours > d2->time.hours) ? 1 :
 | 
|---|
 | 1644 |     (d1->time.hours < d2->time.hours) ? -1 :
 | 
|---|
 | 1645 |     (d1->time.minutes > d2->time.minutes) ? 1 :
 | 
|---|
 | 1646 |     (d1->time.minutes < d2->time.minutes) ? -1 :
 | 
|---|
 | 1647 |     (d1->time.twosecs > d2->time.twosecs) ? 1 :
 | 
|---|
| [897] | 1648 |     (d1->time.twosecs < d2->time.twosecs) ? -1 : 0;*/
 | 
|---|
| [2] | 1649 | 
 | 
|---|
| [551] | 1650 |   if (!ret)
 | 
|---|
 | 1651 |     ret = comparenames(v1, v2);
 | 
|---|
| [2] | 1652 |   return ret;
 | 
|---|
 | 1653 | }
 | 
|---|
 | 1654 | 
 | 
|---|
| [551] | 1655 | static VOID ReSort(HWND hwnd)
 | 
|---|
| [162] | 1656 | {
 | 
|---|
| [551] | 1657 |   ALLDATA *pAD = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
 | 1658 |   register ULONG x, y;
 | 
|---|
| [2] | 1659 | 
 | 
|---|
| [84] | 1660 |   pAD->selected = 0;
 | 
|---|
| [162] | 1661 |   pAD->ullSelectedBytes = 0;
 | 
|---|
| [943] | 1662 |   for (x = 0, y = 0; x < pAD->afheadcnt; x++) {
 | 
|---|
| [551] | 1663 |     if (!(pAD->afhead[x].flags & (AF_DELETED | AF_FILTERED))) {
 | 
|---|
| [84] | 1664 |       if (pAD->afhead[x].flags & AF_SELECTED) {
 | 
|---|
| [1158] | 1665 |         pAD->selected++;
 | 
|---|
 | 1666 |         pAD->ullSelectedBytes += pAD->afhead[x].cbFile;
 | 
|---|
| [2] | 1667 |       }
 | 
|---|
| [84] | 1668 |       pAD->afindex[y++] = &(pAD->afhead[x]);
 | 
|---|
| [2] | 1669 |     }
 | 
|---|
| [1158] | 1670 |   }                                     // for x
 | 
|---|
| [943] | 1671 |   pAD->afindexcnt = y;
 | 
|---|
| [551] | 1672 |   PostMsg(hwnd, UM_SETUP3, MPVOID, MPVOID);
 | 
|---|
| [943] | 1673 |   if (!pAD->stopflag && pAD->pfnCompare && pAD->afindexcnt) {
 | 
|---|
| [766] | 1674 |     WinSendMsg(hwnd, UM_RESCAN, MPFROMLONG(1), MPVOID);
 | 
|---|
| [943] | 1675 |     qsort(pAD->afindex, pAD->afindexcnt, sizeof(ALLFILES *), pAD->pfnCompare);
 | 
|---|
| [2] | 1676 |   }
 | 
|---|
 | 1677 | }
 | 
|---|
 | 1678 | 
 | 
|---|
| [787] | 1679 | VOID FindDupesThread(VOID * args)
 | 
|---|
| [162] | 1680 | {
 | 
|---|
| [551] | 1681 |   register ULONG x, z;
 | 
|---|
 | 1682 |   register CHAR *px, *pz;
 | 
|---|
 | 1683 |   CHAR s[80];
 | 
|---|
 | 1684 |   INT error;
 | 
|---|
 | 1685 |   HWND hwnd = (HWND) args;
 | 
|---|
 | 1686 |   HAB hab2 = (HAB) 0;
 | 
|---|
 | 1687 |   HMQ hmq2 = (HMQ) 0;
 | 
|---|
 | 1688 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [2] | 1689 | 
 | 
|---|
| [1038] | 1690 | # ifdef FORTIFY
 | 
|---|
 | 1691 |   Fortify_EnterScope();
 | 
|---|
| [1063] | 1692 | #  endif
 | 
|---|
| [551] | 1693 |   if (!DosRequestMutexSem(ad->hmtxScan, SEM_INDEFINITE_WAIT)) {
 | 
|---|
| [2] | 1694 |     priority_normal();
 | 
|---|
 | 1695 |     hab2 = WinInitialize(0);
 | 
|---|
| [551] | 1696 |     if (hab2) {
 | 
|---|
 | 1697 |       hmq2 = WinCreateMsgQueue(hab2, 0);
 | 
|---|
 | 1698 |       if (hmq2) {
 | 
|---|
| [1158] | 1699 |         WinCancelShutdown(hmq2, TRUE);
 | 
|---|
 | 1700 |         IncrThreadUsage();
 | 
|---|
 | 1701 |         if (ad->cursored <= ad->afindexcnt) {
 | 
|---|
 | 1702 |           for (x = 0; x < ad->afheadcnt; x++)
 | 
|---|
 | 1703 |             ad->afhead[x].flags &= (~(AF_DUPE | AF_SELECTED));
 | 
|---|
 | 1704 |           DosSleep(0);  //26 Aug 07 GKY 1
 | 
|---|
 | 1705 |           for (x = 0; x < ad->afheadcnt && !ad->stopflag; x++) {
 | 
|---|
 | 1706 |             if (!(ad->afhead[x].flags & (AF_DUPE | AF_FILTERED))) {
 | 
|---|
 | 1707 |               if (!(x % 50)) {
 | 
|---|
 | 1708 |                 sprintf(s,
 | 
|---|
 | 1709 |                         GetPString(IDS_DUPECHECKINGOFTEXT), x, ad->afheadcnt);
 | 
|---|
 | 1710 |                 WinSetWindowText(ad->hwndStatus, s);
 | 
|---|
 | 1711 |               }
 | 
|---|
 | 1712 |               for (z = 0; z < ad->afheadcnt && !ad->stopflag; z++) {
 | 
|---|
 | 1713 |                 if (x != z &&
 | 
|---|
 | 1714 |                     !(ad->afhead[z].flags & (AF_DUPE | AF_FILTERED)))
 | 
|---|
 | 1715 |                 {
 | 
|---|
 | 1716 |                   if (ad->dupeflags & DP_SIZES) {
 | 
|---|
 | 1717 |                     if (ad->afhead[x].cbFile != ad->afhead[z].cbFile)
 | 
|---|
 | 1718 |                       goto SkipNonDupe;
 | 
|---|
 | 1719 |                   }
 | 
|---|
 | 1720 |                   if (ad->dupeflags & DP_DATES) {
 | 
|---|
 | 1721 |                     if (*(INT *) & ad->afhead[x].date !=
 | 
|---|
 | 1722 |                         *(INT *) & ad->afhead[z].date ||
 | 
|---|
 | 1723 |                         *(INT *) & ad->afhead[x].time !=
 | 
|---|
 | 1724 |                         *(INT *) & ad->afhead[z].time)
 | 
|---|
 | 1725 |                       goto SkipNonDupe;
 | 
|---|
 | 1726 |                   }
 | 
|---|
 | 1727 |                   if (ad->dupeflags & DP_NAMES) {
 | 
|---|
 | 1728 |                     if (ad->dupeflags & DP_EXTS) {
 | 
|---|
 | 1729 |                       px = strrchr(ad->afhead[x].filename, '.');
 | 
|---|
 | 1730 |                       pz = strrchr(ad->afhead[z].filename, '.');
 | 
|---|
 | 1731 |                       if ((px || pz) && (!px || !pz))
 | 
|---|
 | 1732 |                         goto SkipNonDupe;
 | 
|---|
 | 1733 |                       if (px) {
 | 
|---|
 | 1734 |                         *px = 0;
 | 
|---|
 | 1735 |                         *pz = 0;
 | 
|---|
 | 1736 |                       }
 | 
|---|
 | 1737 |                     }
 | 
|---|
 | 1738 |                     if (stricmp(ad->afhead[x].filename,
 | 
|---|
 | 1739 |                                 ad->afhead[z].filename)) {
 | 
|---|
 | 1740 |                       if (ad->dupeflags & DP_EXTS) {
 | 
|---|
 | 1741 |                         if (px) {
 | 
|---|
 | 1742 |                           *px = '.';
 | 
|---|
 | 1743 |                           *pz = '.';
 | 
|---|
 | 1744 |                         }
 | 
|---|
 | 1745 |                       }
 | 
|---|
 | 1746 |                       goto SkipNonDupe;
 | 
|---|
 | 1747 |                     }
 | 
|---|
 | 1748 |                     if (ad->dupeflags & DP_EXTS) {
 | 
|---|
 | 1749 |                       if (px) {
 | 
|---|
 | 1750 |                         *px = '.';
 | 
|---|
 | 1751 |                         *pz = '.';
 | 
|---|
 | 1752 |                       }
 | 
|---|
 | 1753 |                     }
 | 
|---|
 | 1754 |                   }
 | 
|---|
 | 1755 |                   if (ad->dupeflags & DP_CRCS) {
 | 
|---|
 | 1756 |                     if (!(ad->afhead[x].flags & AF_CRCED)) {
 | 
|---|
 | 1757 |                       ad->afhead[x].CRC = CRCFile(ad->afhead[x].fullname,
 | 
|---|
 | 1758 |                                                   &error);
 | 
|---|
 | 1759 |                       if (!error)
 | 
|---|
 | 1760 |                         ad->afhead[x].flags |= AF_CRCED;
 | 
|---|
 | 1761 |                     }
 | 
|---|
 | 1762 |                     if (!(ad->afhead[z].flags & AF_CRCED)) {
 | 
|---|
 | 1763 |                       ad->afhead[z].CRC = CRCFile(ad->afhead[z].fullname,
 | 
|---|
 | 1764 |                                                   &error);
 | 
|---|
 | 1765 |                       if (!error)
 | 
|---|
 | 1766 |                         ad->afhead[z].flags |= AF_CRCED;
 | 
|---|
 | 1767 |                     }
 | 
|---|
 | 1768 |                     if ((ad->afhead[x].flags & AF_CRCED) &&
 | 
|---|
 | 1769 |                         (ad->afhead[z].flags & AF_CRCED)) {
 | 
|---|
 | 1770 |                       if (ad->afhead[x].CRC != ad->afhead[z].CRC)
 | 
|---|
 | 1771 |                         goto SkipNonDupe;
 | 
|---|
 | 1772 |                     }
 | 
|---|
 | 1773 |                     DosSleep(0);
 | 
|---|
 | 1774 |                   }
 | 
|---|
 | 1775 |                   ad->afhead[x].flags |= AF_DUPE;
 | 
|---|
 | 1776 |                   ad->afhead[z].flags |= AF_DUPE;
 | 
|---|
 | 1777 |                 SkipNonDupe:
 | 
|---|
 | 1778 |                   ;
 | 
|---|
 | 1779 |                 }
 | 
|---|
 | 1780 |               } // for
 | 
|---|
 | 1781 |               DosSleep(0);
 | 
|---|
 | 1782 |             }
 | 
|---|
 | 1783 |           } // for
 | 
|---|
 | 1784 |           for (x = 0; x < ad->afheadcnt && !ad->stopflag; x++) {
 | 
|---|
 | 1785 |             if (!(ad->afhead[x].flags & AF_DUPE))
 | 
|---|
 | 1786 |               ad->afhead[x].flags |= AF_FILTERED;
 | 
|---|
 | 1787 |           }
 | 
|---|
 | 1788 |           ReSort(hwnd);
 | 
|---|
 | 1789 |           WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 1790 |         }
 | 
|---|
| [2] | 1791 |       }
 | 
|---|
 | 1792 |     }
 | 
|---|
| [551] | 1793 |     PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
| [162] | 1794 |     DosReleaseMutexSem(ad->hmtxScan);
 | 
|---|
| [787] | 1795 |   } // if got sem
 | 
|---|
| [551] | 1796 |   if (hmq2) {
 | 
|---|
 | 1797 |     PostMsg(hwnd, UM_CONTAINER_FILLED, MPVOID, MPVOID);
 | 
|---|
| [533] | 1798 |     WinDestroyMsgQueue(hmq2);
 | 
|---|
| [2] | 1799 |   }
 | 
|---|
| [551] | 1800 |   if (hab2) {
 | 
|---|
| [533] | 1801 |     DecrThreadUsage();
 | 
|---|
| [2] | 1802 |     WinTerminate(hab2);
 | 
|---|
| [533] | 1803 |   }
 | 
|---|
| [1038] | 1804 | # ifdef FORTIFY
 | 
|---|
| [1063] | 1805 |   Fortify_LeaveScope();
 | 
|---|
 | 1806 | #  endif
 | 
|---|
| [2] | 1807 | }
 | 
|---|
 | 1808 | 
 | 
|---|
| [961] | 1809 | static VOID FilterAll(HWND hwnd, ALLDATA *ad);
 | 
|---|
 | 1810 | 
 | 
|---|
| [551] | 1811 | static VOID FilterList(HWND hwnd)
 | 
|---|
| [162] | 1812 | {
 | 
|---|
| [958] | 1813 |   ULONG x;
 | 
|---|
| [551] | 1814 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
 | 1815 |   CHAR *p;
 | 
|---|
| [2] | 1816 | 
 | 
|---|
| [943] | 1817 |   if (ad->cursored <= ad->afindexcnt) {
 | 
|---|
| [2] | 1818 |     x = ad->cursored - 1;
 | 
|---|
| [943] | 1819 |     x = (ad->invertsort) ? (ad->afindexcnt - 1) - x : x;
 | 
|---|
| [551] | 1820 |     p = strrchr(ad->afindex[x]->filename, '.');
 | 
|---|
 | 1821 |     if (p) {
 | 
|---|
 | 1822 |       strcpy(ad->mask.szMask, "*");
 | 
|---|
 | 1823 |       strcat(ad->mask.szMask, p);
 | 
|---|
| [2] | 1824 |     }
 | 
|---|
 | 1825 |   }
 | 
|---|
 | 1826 |   *(ad->mask.prompt) = 0;
 | 
|---|
 | 1827 |   ad->mask.fIsSeeAll = TRUE;
 | 
|---|
| [551] | 1828 |   if (WinDlgBox(HWND_DESKTOP, hwnd, PickMaskDlgProc,
 | 
|---|
| [958] | 1829 |                 FM3ModHandle, MSK_FRAME, MPFROMP(&ad->mask)))
 | 
|---|
 | 1830 |     FilterAll(hwnd, ad);
 | 
|---|
 | 1831 | }
 | 
|---|
 | 1832 | 
 | 
|---|
 | 1833 | static VOID FilterAll(HWND hwnd, ALLDATA *ad)
 | 
|---|
 | 1834 | {
 | 
|---|
 | 1835 |   ULONG x, z;
 | 
|---|
 | 1836 |   BOOL ret;
 | 
|---|
 | 1837 | 
 | 
|---|
 | 1838 |   if (ad) {
 | 
|---|
| [943] | 1839 |     for (x = 0; x < ad->afheadcnt; x++) {
 | 
|---|
| [2] | 1840 |       ret = FALSE;
 | 
|---|
| [551] | 1841 |       if (ad->mask.pszMasks[1]) {
 | 
|---|
| [1158] | 1842 |         for (z = 0; ad->mask.pszMasks[z]; z++) {
 | 
|---|
 | 1843 |           if (*ad->mask.pszMasks[z]) {
 | 
|---|
 | 1844 |             if (*ad->mask.pszMasks[z] != '/') {
 | 
|---|
 | 1845 |               if (wildcard((strchr(ad->mask.pszMasks[z], '\\') ||
 | 
|---|
 | 1846 |                             strchr(ad->mask.pszMasks[z], ':')) ?
 | 
|---|
 | 1847 |                            ad->afhead[x].fullname : ad->afhead[x].filename,
 | 
|---|
 | 1848 |                            ad->mask.pszMasks[z], FALSE))
 | 
|---|
 | 1849 |                 ret = TRUE;
 | 
|---|
 | 1850 |             }
 | 
|---|
 | 1851 |             else {
 | 
|---|
 | 1852 |               if (wildcard((strchr(ad->mask.pszMasks[z], '\\') ||
 | 
|---|
 | 1853 |                             strchr(ad->mask.pszMasks[z], ':')) ?
 | 
|---|
 | 1854 |                            ad->afhead[x].fullname : ad->afhead[x].filename,
 | 
|---|
 | 1855 |                            ad->mask.pszMasks[z] + 1, FALSE)) {
 | 
|---|
 | 1856 |                 ret = FALSE;
 | 
|---|
 | 1857 |                 break;
 | 
|---|
 | 1858 |               }
 | 
|---|
 | 1859 |             }
 | 
|---|
 | 1860 |           }
 | 
|---|
 | 1861 |         }
 | 
|---|
| [2] | 1862 |       }
 | 
|---|
| [551] | 1863 |       else if (*ad->mask.szMask) {
 | 
|---|
| [1158] | 1864 |         if (wildcard((strchr(ad->mask.szMask, '\\') ||
 | 
|---|
 | 1865 |                       strchr(ad->mask.szMask, ':')) ?
 | 
|---|
 | 1866 |                      ad->afhead[x].fullname : ad->afhead[x].filename,
 | 
|---|
 | 1867 |                      ad->mask.szMask, FALSE))
 | 
|---|
 | 1868 |           ret = TRUE;
 | 
|---|
| [2] | 1869 |       }
 | 
|---|
 | 1870 |       else
 | 
|---|
| [1158] | 1871 |         ret = TRUE;
 | 
|---|
| [2] | 1872 | 
 | 
|---|
| [551] | 1873 |       if (ret) {
 | 
|---|
| [1158] | 1874 |         if ((!(ad->mask.attrFile & FILE_HIDDEN)
 | 
|---|
 | 1875 |              && (ad->afhead[x].attrFile & FILE_HIDDEN))
 | 
|---|
 | 1876 |             || (!(ad->mask.attrFile & FILE_SYSTEM)
 | 
|---|
 | 1877 |                 && (ad->afhead[x].attrFile & FILE_SYSTEM))
 | 
|---|
 | 1878 |             || (!(ad->mask.attrFile & FILE_READONLY)
 | 
|---|
 | 1879 |                 && (ad->afhead[x].attrFile & FILE_READONLY))
 | 
|---|
 | 1880 |             || (!(ad->mask.attrFile & FILE_ARCHIVED)
 | 
|---|
 | 1881 |                 && (ad->afhead[x].attrFile & FILE_ARCHIVED)))
 | 
|---|
 | 1882 |           ret = FALSE;
 | 
|---|
 | 1883 |         else
 | 
|---|
 | 1884 |           if (((ad->mask.antiattr & FILE_HIDDEN)
 | 
|---|
 | 1885 |                && !(ad->afhead[x].attrFile & FILE_HIDDEN))
 | 
|---|
 | 1886 |               || ((ad->mask.antiattr & FILE_SYSTEM)
 | 
|---|
 | 1887 |                   && !(ad->afhead[x].attrFile & FILE_SYSTEM))
 | 
|---|
 | 1888 |               || ((ad->mask.antiattr & FILE_READONLY)
 | 
|---|
 | 1889 |                   && !(ad->afhead[x].attrFile & FILE_READONLY))
 | 
|---|
 | 1890 |               || ((ad->mask.antiattr & FILE_ARCHIVED)
 | 
|---|
 | 1891 |                   && !(ad->afhead[x].attrFile & FILE_ARCHIVED)))
 | 
|---|
 | 1892 |           ret = FALSE;
 | 
|---|
| [2] | 1893 |       }
 | 
|---|
 | 1894 | 
 | 
|---|
| [551] | 1895 |       if (!ret)
 | 
|---|
| [1158] | 1896 |         ad->afhead[x].flags |= AF_FILTERED;
 | 
|---|
| [2] | 1897 |       else
 | 
|---|
| [1158] | 1898 |         ad->afhead[x].flags &= (~AF_FILTERED);
 | 
|---|
| [2] | 1899 |     }
 | 
|---|
 | 1900 |     ReSort(hwnd);
 | 
|---|
| [551] | 1901 |     PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 1902 |     WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
| [2] | 1903 |   }
 | 
|---|
 | 1904 | }
 | 
|---|
 | 1905 | 
 | 
|---|
| [551] | 1906 | static ULONG RemoveDeleted(HWND hwnd)
 | 
|---|
| [162] | 1907 | {
 | 
|---|
| [551] | 1908 |   ALLDATA *pAD = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [943] | 1909 |   ULONG oldafheadcnt = pAD->afheadcnt;
 | 
|---|
| [551] | 1910 |   register ULONG x, y;
 | 
|---|
| [2] | 1911 | 
 | 
|---|
| [943] | 1912 |   for (x = 0; x < pAD->afheadcnt; x++) {
 | 
|---|
| [84] | 1913 |     if (pAD->afhead[x].flags & AF_DELETED) {
 | 
|---|
| [943] | 1914 |       for (y = x; y < pAD->afheadcnt; y++) {
 | 
|---|
| [1158] | 1915 |         if (~pAD->afhead[y].flags & AF_DELETED)
 | 
|---|
 | 1916 |           break;
 | 
|---|
 | 1917 |         if (pAD->afhead[y].flags & AF_SELECTED &&
 | 
|---|
 | 1918 |             ~pAD->afhead[y].flags & AF_FILTERED) {
 | 
|---|
 | 1919 |           pAD->selected--;
 | 
|---|
 | 1920 |           pAD->ullSelectedBytes -= pAD->afhead[y].cbFile;
 | 
|---|
 | 1921 |         }
 | 
|---|
 | 1922 |         xfree(pAD->afhead[y].fullname, pszSrcFile, __LINE__);
 | 
|---|
| [2] | 1923 |       }
 | 
|---|
| [551] | 1924 |       memmove(&(pAD->afhead[x]), &(pAD->afhead[y]),
 | 
|---|
| [1158] | 1925 |               (pAD->afheadcnt - y) * sizeof(ALLFILES));
 | 
|---|
| [943] | 1926 |       pAD->afheadcnt -= (y - x);
 | 
|---|
| [2] | 1927 |     }
 | 
|---|
| [1158] | 1928 |   }                                     // for x
 | 
|---|
| [943] | 1929 |   if (pAD->afheadcnt != oldafheadcnt) {
 | 
|---|
| [2] | 1930 | 
 | 
|---|
| [551] | 1931 |     ALLFILES *tempa, **templ;
 | 
|---|
| [2] | 1932 | 
 | 
|---|
| [943] | 1933 |     if (!pAD->afheadcnt)
 | 
|---|
| [2] | 1934 |       FreeAllFilesList(hwnd);
 | 
|---|
 | 1935 |     else {
 | 
|---|
| [551] | 1936 |       tempa =
 | 
|---|
| [1158] | 1937 |         xrealloc(pAD->afhead, pAD->afheadcnt * sizeof(ALLFILES), pszSrcFile,
 | 
|---|
 | 1938 |                  __LINE__);
 | 
|---|
| [335] | 1939 |       if (tempa) {
 | 
|---|
| [1158] | 1940 |         pAD->afhead = tempa;
 | 
|---|
 | 1941 |         pAD->afalloc = pAD->afheadcnt;
 | 
|---|
| [2] | 1942 |       }
 | 
|---|
| [551] | 1943 |       templ =
 | 
|---|
| [1158] | 1944 |         xrealloc(pAD->afindex, pAD->afheadcnt * sizeof(ALLFILES *), pszSrcFile,
 | 
|---|
 | 1945 |                  __LINE__);
 | 
|---|
| [335] | 1946 |       if (templ)
 | 
|---|
| [1158] | 1947 |         pAD->afindex = templ;
 | 
|---|
| [2] | 1948 |       DosPostEventSem(CompactSem);
 | 
|---|
 | 1949 |       ReSort(hwnd);
 | 
|---|
 | 1950 |     }
 | 
|---|
 | 1951 |   }
 | 
|---|
| [943] | 1952 |   return pAD->afheadcnt;
 | 
|---|
| [2] | 1953 | }
 | 
|---|
 | 1954 | 
 | 
|---|
| [551] | 1955 | static VOID DoADir(HWND hwnd, CHAR * pathname)
 | 
|---|
| [162] | 1956 | {
 | 
|---|
| [551] | 1957 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
 | 1958 |   CHAR *filename, *enddir;
 | 
|---|
| [841] | 1959 |   PFILEFINDBUF3L pffbArray, pffbFile;
 | 
|---|
| [551] | 1960 |   HDIR hdir = HDIR_CREATE;
 | 
|---|
| [783] | 1961 |   ULONG ulFindCnt;
 | 
|---|
 | 1962 |   ULONG ulFindMax;
 | 
|---|
 | 1963 |   ULONG ulBufBytes;
 | 
|---|
 | 1964 |   ULONG x;
 | 
|---|
 | 1965 |   APIRET rc;
 | 
|---|
| [955] | 1966 |   static BOOL fDone;
 | 
|---|
| [2] | 1967 | 
 | 
|---|
| [955] | 1968 |   filename = xmalloc(CCHMAXPATH + 100, pszSrcFile, __LINE__);
 | 
|---|
| [551] | 1969 |   if (!filename)
 | 
|---|
| [2] | 1970 |     return;
 | 
|---|
| [335] | 1971 | 
 | 
|---|
| [787] | 1972 |   ulFindMax = FilesToGet;
 | 
|---|
| [551] | 1973 |   if (fRemoteBug && isalpha(*pathname) && pathname[1] == ':' &&
 | 
|---|
 | 1974 |       pathname[2] == '\\' &&
 | 
|---|
 | 1975 |       (driveflags[toupper(*pathname) - 'A'] & DRIVE_REMOTE))
 | 
|---|
| [783] | 1976 |     ulFindMax = 1;
 | 
|---|
 | 1977 | 
 | 
|---|
| [841] | 1978 |   ulBufBytes = sizeof(FILEFINDBUF3L) * ulFindMax;
 | 
|---|
| [783] | 1979 |   pffbArray = xmalloc(ulBufBytes, pszSrcFile, __LINE__);
 | 
|---|
 | 1980 |   if (!pffbArray) {
 | 
|---|
| [1039] | 1981 |     free(filename);
 | 
|---|
| [2] | 1982 |     return;
 | 
|---|
 | 1983 |   }
 | 
|---|
| [783] | 1984 | 
 | 
|---|
| [551] | 1985 |   strcpy(filename, pathname);
 | 
|---|
| [2] | 1986 |   enddir = &filename[strlen(filename) - 1];
 | 
|---|
| [551] | 1987 |   if (*enddir != '\\') {
 | 
|---|
| [2] | 1988 |     enddir++;
 | 
|---|
 | 1989 |     *enddir = '\\';
 | 
|---|
 | 1990 |   }
 | 
|---|
 | 1991 |   enddir++;
 | 
|---|
| [551] | 1992 |   strcpy(enddir, "*");
 | 
|---|
| [2] | 1993 |   DosError(FERR_DISABLEHARDERR);
 | 
|---|
| [783] | 1994 |   ulFindCnt = ulFindMax;
 | 
|---|
| [838] | 1995 |   rc = xDosFindFirst(filename, &hdir, FILE_NORMAL | FILE_ARCHIVED |
 | 
|---|
| [1158] | 1996 |                      FILE_READONLY | FILE_DIRECTORY | FILE_SYSTEM |
 | 
|---|
 | 1997 |                      FILE_HIDDEN,
 | 
|---|
 | 1998 |                      pffbArray, ulBufBytes, &ulFindCnt, FIL_STANDARDL);
 | 
|---|
| [783] | 1999 |   if (!rc) {
 | 
|---|
| [2] | 2000 |     do {
 | 
|---|
 | 2001 |       priority_normal();
 | 
|---|
| [783] | 2002 |       pffbFile = pffbArray;
 | 
|---|
 | 2003 |       for (x = 0; x < ulFindCnt; x++) {
 | 
|---|
| [1158] | 2004 |         if (pffbFile->attrFile & FILE_DIRECTORY) {
 | 
|---|
 | 2005 |           // Skip . and ..
 | 
|---|
 | 2006 |           if (pffbFile->achName[0] != '.' ||
 | 
|---|
 | 2007 |               (pffbFile->achName[1] &&
 | 
|---|
 | 2008 |                (pffbFile->achName[1] != '.' || pffbFile->achName[2]))) {
 | 
|---|
 | 2009 |             strcpy(enddir, pffbFile->achName);
 | 
|---|
 | 2010 |             DoADir(hwnd, filename);
 | 
|---|
 | 2011 |           }
 | 
|---|
 | 2012 |         }
 | 
|---|
 | 2013 |         else {
 | 
|---|
 | 2014 |           *enddir = 0;
 | 
|---|
| [955] | 2015 |           strcpy(enddir, pffbFile->achName);
 | 
|---|
 | 2016 |           if (strlen(filename) > CCHMAXPATH) {
 | 
|---|
| [1158] | 2017 |             // Complain if pathnames exceeds max
 | 
|---|
 | 2018 |             DosFindClose(hdir);
 | 
|---|
| [1039] | 2019 |             free(pffbArray);
 | 
|---|
 | 2020 |             free(filename);
 | 
|---|
| [1158] | 2021 |             if (!fDone) {
 | 
|---|
 | 2022 |               fDone = TRUE;
 | 
|---|
 | 2023 |               saymsg(MB_OK | MB_ICONASTERISK,
 | 
|---|
 | 2024 |                      HWND_DESKTOP,
 | 
|---|
 | 2025 |                      GetPString(IDS_WARNINGTEXT),
 | 
|---|
 | 2026 |                      "One or more of your files has a full path name that exceeds the OS/2 maximum");
 | 
|---|
| [955] | 2027 |             }
 | 
|---|
 | 2028 |             return;
 | 
|---|
| [1158] | 2029 |           }
 | 
|---|
 | 2030 |           if (!ad->afalloc || ad->afheadcnt > ad->afalloc - 1) {
 | 
|---|
| [2] | 2031 | 
 | 
|---|
| [1158] | 2032 |             ALLFILES *temp;
 | 
|---|
| [2] | 2033 | 
 | 
|---|
| [1158] | 2034 |             temp = xrealloc(ad->afhead, (ad->afalloc + 1000) *
 | 
|---|
 | 2035 |                             sizeof(ALLFILES), pszSrcFile, __LINE__);
 | 
|---|
 | 2036 |             if (!temp) {
 | 
|---|
 | 2037 |               ad->stopflag = 1;
 | 
|---|
 | 2038 |               break;
 | 
|---|
 | 2039 |             }
 | 
|---|
 | 2040 |             else {
 | 
|---|
 | 2041 |               ad->afhead = temp;
 | 
|---|
 | 2042 |               if (ad->stopflag)
 | 
|---|
 | 2043 |                 break;
 | 
|---|
 | 2044 |               ad->afalloc += 1000;
 | 
|---|
 | 2045 |             }
 | 
|---|
 | 2046 |           }
 | 
|---|
 | 2047 |           ad->afhead[ad->afheadcnt].fullname =
 | 
|---|
 | 2048 |             xstrdup(filename, pszSrcFile, __LINE__);
 | 
|---|
 | 2049 |           if (!ad->afhead[ad->afheadcnt].fullname) {
 | 
|---|
 | 2050 |             ad->stopflag = 1;
 | 
|---|
 | 2051 |             break;
 | 
|---|
 | 2052 |           }
 | 
|---|
 | 2053 |           else {
 | 
|---|
 | 2054 |             ad->afhead[ad->afheadcnt].filename =
 | 
|---|
 | 2055 |               ad->afhead[ad->afheadcnt].fullname + (enddir - filename);
 | 
|---|
 | 2056 |             ad->afhead[ad->afheadcnt].cbFile = pffbFile->cbFile;
 | 
|---|
 | 2057 |             ad->afhead[ad->afheadcnt].date = pffbFile->fdateLastWrite;
 | 
|---|
 | 2058 |             ad->afhead[ad->afheadcnt].time = pffbFile->ftimeLastWrite;
 | 
|---|
 | 2059 |             ad->afhead[ad->afheadcnt].attrFile = (USHORT) pffbFile->attrFile;
 | 
|---|
 | 2060 |             ad->afhead[ad->afheadcnt].flags = 0;
 | 
|---|
 | 2061 |             ad->afheadcnt++;
 | 
|---|
 | 2062 |             if (ad->longest < pffbFile->cchName)
 | 
|---|
 | 2063 |               ad->longest = pffbFile->cchName;
 | 
|---|
 | 2064 |             if (ad->longestw < pffbFile->cchName + (enddir - filename))
 | 
|---|
 | 2065 |               ad->longestw = pffbFile->cchName + (enddir - filename);
 | 
|---|
 | 2066 |           }
 | 
|---|
 | 2067 |         }
 | 
|---|
 | 2068 |         pffbFile = (PFILEFINDBUF3L)((PBYTE)pffbFile + pffbFile->oNextEntryOffset);
 | 
|---|
| [783] | 2069 |       } // for
 | 
|---|
 | 2070 |       if (ad->stopflag)
 | 
|---|
| [1158] | 2071 |         break;
 | 
|---|
| [783] | 2072 |       ulFindCnt = ulFindMax;
 | 
|---|
| [850] | 2073 |       rc = xDosFindNext(hdir,
 | 
|---|
| [1158] | 2074 |                         pffbArray,
 | 
|---|
 | 2075 |                         sizeof(FILEFINDBUF3L) * ulFindCnt,
 | 
|---|
 | 2076 |                         &ulFindCnt,
 | 
|---|
 | 2077 |                         FIL_STANDARDL);
 | 
|---|
| [783] | 2078 |     } while (!rc);
 | 
|---|
| [2] | 2079 |     DosFindClose(hdir);
 | 
|---|
 | 2080 |   }
 | 
|---|
| [783] | 2081 | 
 | 
|---|
 | 2082 |   if (rc && rc != ERROR_NO_MORE_FILES) {
 | 
|---|
 | 2083 |     Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
 | 
|---|
| [1158] | 2084 |               GetPString(IDS_CANTFINDDIRTEXT), filename);
 | 
|---|
| [783] | 2085 |   }
 | 
|---|
 | 2086 | 
 | 
|---|
| [1039] | 2087 |   free(pffbArray);
 | 
|---|
 | 2088 |   free(filename);
 | 
|---|
| [2] | 2089 | }
 | 
|---|
 | 2090 | 
 | 
|---|
| [551] | 2091 | static VOID FindAllThread(VOID * args)
 | 
|---|
| [162] | 2092 | {
 | 
|---|
| [551] | 2093 |   ULONG ulDriveNum, ulDriveMap, x;
 | 
|---|
 | 2094 |   CHAR startname[] = " :\\";
 | 
|---|
 | 2095 |   HWND hwnd = (HWND) args;
 | 
|---|
 | 2096 |   HAB hab2 = (HAB) 0;
 | 
|---|
 | 2097 |   HMQ hmq2 = (HMQ) 0;
 | 
|---|
 | 2098 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [2] | 2099 | 
 | 
|---|
| [1038] | 2100 | # ifdef FORTIFY
 | 
|---|
 | 2101 |   Fortify_EnterScope();
 | 
|---|
| [1063] | 2102 | #  endif
 | 
|---|
| [551] | 2103 |   if (!DosRequestMutexSem(ad->hmtxScan, SEM_INDEFINITE_WAIT)) {
 | 
|---|
| [2] | 2104 |     priority_normal();
 | 
|---|
 | 2105 |     hab2 = WinInitialize(0);
 | 
|---|
| [551] | 2106 |     if (hab2) {
 | 
|---|
 | 2107 |       hmq2 = WinCreateMsgQueue(hab2, 0);
 | 
|---|
 | 2108 |       if (hmq2) {
 | 
|---|
| [1158] | 2109 |         WinCancelShutdown(hmq2, TRUE);
 | 
|---|
 | 2110 |         IncrThreadUsage();
 | 
|---|
 | 2111 |         if (!*ad->szFindPath) {
 | 
|---|
 | 2112 |           DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 2113 |           if (!DosQCurDisk(&ulDriveNum, &ulDriveMap)) {
 | 
|---|
 | 2114 |             for (x = 2; x < 26 && !ad->stopflag; x++) {
 | 
|---|
 | 2115 |               if ((ulDriveMap & (1 << x)) && ad->abDrvFlags[x]) {
 | 
|---|
 | 2116 |                 *startname = (CHAR) (x + 'A');
 | 
|---|
 | 2117 |                 DoADir(hwnd, startname);
 | 
|---|
 | 2118 |                 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 2119 |                 DosSleep(0); //26 Aug 07 GKY 1
 | 
|---|
 | 2120 |               }
 | 
|---|
 | 2121 |             }
 | 
|---|
 | 2122 |           }
 | 
|---|
 | 2123 |         }
 | 
|---|
 | 2124 |         else
 | 
|---|
 | 2125 |           DoADir(hwnd, ad->szFindPath);
 | 
|---|
 | 2126 |         DosPostEventSem(CompactSem);
 | 
|---|
| [2] | 2127 |       }
 | 
|---|
 | 2128 |     }
 | 
|---|
| [943] | 2129 |     if (ad->afalloc != ad->afheadcnt) {
 | 
|---|
| [2] | 2130 | 
 | 
|---|
| [551] | 2131 |       ALLFILES *tempa, **templ;
 | 
|---|
| [2] | 2132 | 
 | 
|---|
| [551] | 2133 |       tempa =
 | 
|---|
| [1158] | 2134 |         xrealloc(ad->afhead, sizeof(ALLFILES) * ad->afheadcnt, pszSrcFile,
 | 
|---|
 | 2135 |                  __LINE__);
 | 
|---|
| [335] | 2136 |       if (tempa) {
 | 
|---|
| [1158] | 2137 |         ad->afhead = tempa;
 | 
|---|
 | 2138 |         ad->afalloc = ad->afheadcnt;
 | 
|---|
| [2] | 2139 |       }
 | 
|---|
| [551] | 2140 |       templ =
 | 
|---|
| [1158] | 2141 |         xrealloc(ad->afindex, sizeof(ALLFILES *) * ad->afheadcnt, pszSrcFile,
 | 
|---|
 | 2142 |                  __LINE__);
 | 
|---|
| [335] | 2143 |       if (templ)
 | 
|---|
| [1158] | 2144 |         ad->afindex = templ;
 | 
|---|
| [2] | 2145 |       DosPostEventSem(CompactSem);
 | 
|---|
 | 2146 |     }
 | 
|---|
 | 2147 | 
 | 
|---|
| [335] | 2148 |     if (!ad->stopflag) {
 | 
|---|
| [766] | 2149 |       PostMsg(hwnd, UM_RESCAN, MPFROMLONG(1), MPVOID);
 | 
|---|
| [2] | 2150 |       ReSort(hwnd);
 | 
|---|
 | 2151 |     }
 | 
|---|
| [162] | 2152 |     DosReleaseMutexSem(ad->hmtxScan);
 | 
|---|
| [2] | 2153 |   }
 | 
|---|
| [551] | 2154 |   if (hmq2) {
 | 
|---|
 | 2155 |     PostMsg(hwnd, UM_CONTAINER_FILLED, MPVOID, MPVOID);
 | 
|---|
| [2] | 2156 |     WinDestroyMsgQueue(hmq2);
 | 
|---|
| [533] | 2157 |   }
 | 
|---|
| [551] | 2158 |   if (hab2) {
 | 
|---|
| [533] | 2159 |     DecrThreadUsage();
 | 
|---|
| [2] | 2160 |     WinTerminate(hab2);
 | 
|---|
| [533] | 2161 |   }
 | 
|---|
| [1038] | 2162 | # ifdef FORTIFY
 | 
|---|
| [1063] | 2163 |   Fortify_LeaveScope();
 | 
|---|
 | 2164 | #  endif
 | 
|---|
| [2] | 2165 | }
 | 
|---|
 | 2166 | 
 | 
|---|
| [551] | 2167 | MRESULT EXPENTRY AFDrvsWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 | 
|---|
| [162] | 2168 | {
 | 
|---|
| [551] | 2169 |   switch (msg) {
 | 
|---|
 | 2170 |   case WM_INITDLG:
 | 
|---|
 | 2171 |     if (mp2) {
 | 
|---|
| [2] | 2172 | 
 | 
|---|
| [551] | 2173 |       ULONG ulDriveNum, ulDriveMap, x;
 | 
|---|
 | 2174 |       CHAR startname[] = " :";
 | 
|---|
 | 2175 |       SHORT sSelect;
 | 
|---|
 | 2176 |       ALLDATA *ad;
 | 
|---|
| [2] | 2177 | 
 | 
|---|
| [551] | 2178 |       ad = (ALLDATA *) mp2;
 | 
|---|
 | 2179 |       WinSetWindowPtr(hwnd, QWL_USER, mp2);
 | 
|---|
 | 2180 |       DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 2181 |       if (!DosQCurDisk(&ulDriveNum, &ulDriveMap)) {
 | 
|---|
| [1158] | 2182 |         for (x = 2; x < 26 && !ad->stopflag; x++) {
 | 
|---|
 | 2183 |           if (!(driveflags[x] & (DRIVE_IGNORE | DRIVE_INVALID))) {
 | 
|---|
 | 2184 |             if (ulDriveMap & (1 << x)) {
 | 
|---|
 | 2185 |               *startname = (CHAR) (x + 'A');
 | 
|---|
 | 2186 |               sSelect = (SHORT) WinSendDlgItemMsg(hwnd, DRVS_LISTBOX,
 | 
|---|
 | 2187 |                                                   LM_INSERTITEM,
 | 
|---|
 | 2188 |                                                   MPFROM2SHORT(LIT_END, 0),
 | 
|---|
 | 2189 |                                                   MPFROMP(startname));
 | 
|---|
 | 2190 |               if (sSelect >= 0 && ad->abDrvFlags[x])
 | 
|---|
 | 2191 |                 WinSendDlgItemMsg(hwnd, DRVS_LISTBOX, LM_SELECTITEM,
 | 
|---|
 | 2192 |                                   MPFROM2SHORT(sSelect, 0), MPFROMLONG(TRUE));
 | 
|---|
 | 2193 |             }
 | 
|---|
 | 2194 |           }
 | 
|---|
 | 2195 |         }
 | 
|---|
| [2] | 2196 |       }
 | 
|---|
| [551] | 2197 |     }
 | 
|---|
 | 2198 |     else
 | 
|---|
 | 2199 |       WinDismissDlg(hwnd, 0);
 | 
|---|
 | 2200 |     break;
 | 
|---|
| [2] | 2201 | 
 | 
|---|
| [551] | 2202 |   case WM_CONTROL:
 | 
|---|
 | 2203 |     switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 2204 |     case DRVS_LISTBOX:
 | 
|---|
 | 2205 |       switch (SHORT2FROMMP(mp1)) {
 | 
|---|
 | 2206 |       case LN_ENTER:
 | 
|---|
| [1158] | 2207 |         PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(DID_OK, 0), MPVOID);
 | 
|---|
 | 2208 |         break;
 | 
|---|
| [2] | 2209 |       }
 | 
|---|
| [551] | 2210 |       break;
 | 
|---|
 | 2211 |     }
 | 
|---|
 | 2212 |     return 0;
 | 
|---|
| [2] | 2213 | 
 | 
|---|
| [551] | 2214 |   case WM_COMMAND:
 | 
|---|
 | 2215 |     switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 2216 |     case DID_OK:
 | 
|---|
 | 2217 |       {
 | 
|---|
| [1158] | 2218 |         INT x;
 | 
|---|
 | 2219 |         SHORT sSelect;
 | 
|---|
 | 2220 |         CHAR filename[3];
 | 
|---|
 | 2221 |         ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [2] | 2222 | 
 | 
|---|
| [1158] | 2223 |         memset(ad->abDrvFlags, 0, sizeof(ad->abDrvFlags));
 | 
|---|
 | 2224 |         sSelect = (SHORT) WinSendDlgItemMsg(hwnd, DRVS_LISTBOX,
 | 
|---|
 | 2225 |                                             LM_QUERYSELECTION,
 | 
|---|
 | 2226 |                                             MPFROM2SHORT(LIT_FIRST, 0),
 | 
|---|
 | 2227 |                                             MPVOID);
 | 
|---|
 | 2228 |         while (sSelect >= 0) {
 | 
|---|
 | 2229 |           *filename = 0;
 | 
|---|
 | 2230 |           if (WinSendDlgItemMsg(hwnd, DRVS_LISTBOX, LM_QUERYITEMTEXT,
 | 
|---|
 | 2231 |                                 MPFROM2SHORT(sSelect, 2),
 | 
|---|
 | 2232 |                                 MPFROMP(filename)) && *filename)
 | 
|---|
 | 2233 |             ad->abDrvFlags[*filename - 'A'] = 1;
 | 
|---|
 | 2234 |           sSelect = (SHORT) WinSendDlgItemMsg(hwnd, DRVS_LISTBOX,
 | 
|---|
 | 2235 |                                               LM_QUERYSELECTION,
 | 
|---|
 | 2236 |                                               MPFROM2SHORT(sSelect, 0),
 | 
|---|
 | 2237 |                                               MPVOID);
 | 
|---|
 | 2238 |         }
 | 
|---|
 | 2239 |         for (x = 2; x < 26; x++) {
 | 
|---|
 | 2240 |           if (ad->abDrvFlags[x]) {
 | 
|---|
 | 2241 |             WinDismissDlg(hwnd, 1);
 | 
|---|
 | 2242 |             return 0;
 | 
|---|
 | 2243 |           }
 | 
|---|
 | 2244 |         }
 | 
|---|
| [551] | 2245 |       }
 | 
|---|
 | 2246 |       WinDismissDlg(hwnd, 0);
 | 
|---|
 | 2247 |       break;
 | 
|---|
| [2] | 2248 | 
 | 
|---|
| [551] | 2249 |     case IDM_HELP:
 | 
|---|
 | 2250 |       if (hwndHelp)
 | 
|---|
| [1158] | 2251 |         WinSendMsg(hwndHelp, HM_DISPLAY_HELP,
 | 
|---|
 | 2252 |                    MPFROM2SHORT(HELP_DRVSWND, 0), MPFROMSHORT(HM_RESOURCEID));
 | 
|---|
| [551] | 2253 |       break;
 | 
|---|
| [2] | 2254 | 
 | 
|---|
| [551] | 2255 |     case DID_CANCEL:
 | 
|---|
 | 2256 |       WinDismissDlg(hwnd, 0);
 | 
|---|
 | 2257 |       break;
 | 
|---|
 | 2258 |     }
 | 
|---|
 | 2259 |     return 0;
 | 
|---|
| [2] | 2260 |   }
 | 
|---|
| [551] | 2261 |   return WinDefDlgProc(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 2262 | }
 | 
|---|
 | 2263 | 
 | 
|---|
| [551] | 2264 | static HPS InitWindow(HWND hwnd)
 | 
|---|
| [162] | 2265 | {
 | 
|---|
| [551] | 2266 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
 | 2267 |   HPS hps = (HPS) 0;
 | 
|---|
 | 2268 |   SIZEL sizel;
 | 
|---|
 | 2269 |   FONTMETRICS FontMetrics;
 | 
|---|
| [2] | 2270 | 
 | 
|---|
| [551] | 2271 |   if (ad) {
 | 
|---|
| [2] | 2272 |     sizel.cx = sizel.cy = 0;
 | 
|---|
| [551] | 2273 |     hps = GpiCreatePS(WinQueryAnchorBlock(hwnd), WinOpenWindowDC(hwnd),
 | 
|---|
| [1158] | 2274 |                       (PSIZEL) & sizel, PU_PELS | GPIF_DEFAULT | GPIT_MICRO |
 | 
|---|
 | 2275 |                       GPIA_ASSOC);
 | 
|---|
| [551] | 2276 |     if (hps) {
 | 
|---|
 | 2277 |       GpiSetCp(hps, (ULONG) ad->fattrs.usCodePage);
 | 
|---|
 | 2278 |       GpiCreateLogFont(hps, NULL, FIXED_FONT_LCID, &ad->fattrs);
 | 
|---|
 | 2279 |       GpiSetCharSet(hps, FIXED_FONT_LCID);
 | 
|---|
 | 2280 |       GpiQueryFontMetrics(hps, sizeof(FontMetrics), &FontMetrics);
 | 
|---|
 | 2281 |       ad->fattrs.lAveCharWidth = FontMetrics.lAveCharWidth;
 | 
|---|
| [2] | 2282 |       ad->fattrs.lMaxBaselineExt = FontMetrics.lMaxBaselineExt;
 | 
|---|
| [551] | 2283 |       ad->lMaxAscender = max(FontMetrics.lMaxAscender, 0);
 | 
|---|
 | 2284 |       ad->lMaxDescender = max(FontMetrics.lMaxDescender, 0);
 | 
|---|
| [2] | 2285 |       ad->lMaxHeight = ad->lMaxDescender + ad->lMaxAscender;
 | 
|---|
| [551] | 2286 |       if (ad->fattrs.usCodePage != FontMetrics.usCodePage) {
 | 
|---|
| [1158] | 2287 |         ad->fattrs.usCodePage = FontMetrics.usCodePage;
 | 
|---|
 | 2288 |         Codepage = ad->fattrs.usCodePage;
 | 
|---|
 | 2289 |         PrfWriteProfileData(fmprof,
 | 
|---|
 | 2290 |                             appname,
 | 
|---|
 | 2291 |                             "Seeall.Codepage",
 | 
|---|
 | 2292 |                             &ad->fattrs.usCodePage, sizeof(USHORT));
 | 
|---|
| [2] | 2293 |       }
 | 
|---|
| [551] | 2294 |       else if (ad->fattrs.usCodePage) {
 | 
|---|
| [2] | 2295 | 
 | 
|---|
| [1158] | 2296 |         HMQ hmq;
 | 
|---|
 | 2297 |         ULONG cps[50], len, x;
 | 
|---|
| [2] | 2298 | 
 | 
|---|
| [1158] | 2299 |         if (!DosQueryCp(sizeof(cps), cps, &len)) {
 | 
|---|
 | 2300 |           for (x = 0; x < len / sizeof(ULONG); x++) {
 | 
|---|
 | 2301 |             if (cps[x] == (ULONG) ad->fattrs.usCodePage) {
 | 
|---|
 | 2302 |               hmq = WinQueryWindowULong(hwnd, QWL_HMQ);
 | 
|---|
 | 2303 |               WinSetCp(hmq, ad->fattrs.usCodePage);
 | 
|---|
 | 2304 |               break;
 | 
|---|
 | 2305 |             }
 | 
|---|
 | 2306 |           }
 | 
|---|
 | 2307 |         }
 | 
|---|
 | 2308 |         DosSetProcessCp((ULONG) ad->fattrs.usCodePage);
 | 
|---|
| [2] | 2309 |       }
 | 
|---|
| [551] | 2310 |       GpiSetBackMix(hps, BM_OVERPAINT);
 | 
|---|
| [2] | 2311 |     }
 | 
|---|
 | 2312 |   }
 | 
|---|
 | 2313 |   return (hps);
 | 
|---|
 | 2314 | }
 | 
|---|
 | 2315 | 
 | 
|---|
| [551] | 2316 | static VOID PaintLine(HWND hwnd, HPS hps, ULONG whichfile, ULONG topfile,
 | 
|---|
| [1158] | 2317 |                       RECTL * Rectl)
 | 
|---|
| [551] | 2318 | {
 | 
|---|
 | 2319 |   ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
 | 2320 |   POINTL ptl;
 | 
|---|
| [897] | 2321 |   CHAR szBuff[CCHMAXPATH + 80], szCmmaFmtFileSize[81];
 | 
|---|
| [551] | 2322 |   ULONG len, y;
 | 
|---|
| [2] | 2323 | 
 | 
|---|
| [943] | 2324 |   y = (ad->invertsort) ? (ad->afindexcnt - 1) - whichfile : whichfile;
 | 
|---|
| [2] | 2325 |   ptl.y = (Rectl->yTop -
 | 
|---|
| [1158] | 2326 |            (ad->lMaxHeight * (((whichfile + 1) - topfile) + 1)));
 | 
|---|
| [2] | 2327 |   ptl.x = ad->horzscroll;
 | 
|---|
| [943] | 2328 |   if (ptl.y < Rectl->yBottom || ptl.y > Rectl->yTop || y > ad->afindexcnt)
 | 
|---|
| [2] | 2329 |     return;
 | 
|---|
| [551] | 2330 |   GpiSetBackMix(hps, BM_OVERPAINT);
 | 
|---|
 | 2331 |   if (ad->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 2332 |     GpiSetColor(hps, standardcolors[Colors[COLORS_SELECTEDNORMALFORE]]);
 | 
|---|
 | 2333 |     GpiSetBackColor(hps, (whichfile == ad->cursored - 1) ?
 | 
|---|
| [1158] | 2334 |                     standardcolors[Colors[COLORS_CURSOREDSELECTEDBACK]] :
 | 
|---|
 | 2335 |                     standardcolors[Colors[COLORS_SELECTEDBACK]]);
 | 
|---|
| [2] | 2336 |   }
 | 
|---|
 | 2337 |   else {
 | 
|---|
 | 2338 |     GpiSetColor(hps,
 | 
|---|
| [1158] | 2339 |                 ((ad->afindex[y]->attrFile & (FILE_SYSTEM | FILE_HIDDEN)) !=
 | 
|---|
 | 2340 |                  0) ? standardcolors[Colors[COLORS_SYSTEMFORE]] : ((ad->
 | 
|---|
 | 2341 |                                                                     afindex
 | 
|---|
 | 2342 |                                                                     [y]->
 | 
|---|
 | 2343 |                                                                     attrFile &
 | 
|---|
 | 2344 |                                                                     FILE_READONLY)
 | 
|---|
 | 2345 |                                                                    !=
 | 
|---|
 | 2346 |                                                                    0) ?
 | 
|---|
 | 2347 |                 standardcolors[Colors[COLORS_READONLYFORE]] :
 | 
|---|
 | 2348 |                 standardcolors[Colors[COLORS_NORMALFORE]]);
 | 
|---|
| [551] | 2349 |     GpiSetBackColor(hps,
 | 
|---|
| [1158] | 2350 |                     (whichfile ==
 | 
|---|
 | 2351 |                      ad->cursored -
 | 
|---|
 | 2352 |                      1) ? standardcolors[Colors[COLORS_CURSOREDNORMALBACK]] :
 | 
|---|
 | 2353 |                     standardcolors[Colors[COLORS_NORMALBACK]]);
 | 
|---|
| [2] | 2354 |   }
 | 
|---|
| [897] | 2355 |   CommaFmtULL(szCmmaFmtFileSize,
 | 
|---|
 | 2356 |               sizeof(szCmmaFmtFileSize), ad->afindex[y]->cbFile, ' ');
 | 
|---|
| [2] | 2357 |   len = sprintf(szBuff,
 | 
|---|
| [1158] | 2358 |                 "%c%-*.*s  %-12s  %c%c%c%c%c  %04u/%02u/%02u %02u:%02u:%02u ",
 | 
|---|
 | 2359 |                 whichfile == ad->cursored - 1 ? '>' : ' ',
 | 
|---|
 | 2360 |                 ad->fullnames ? ad->longestw : ad->longest,
 | 
|---|
 | 2361 |                 ad->fullnames ? ad->longestw : ad->longest,
 | 
|---|
 | 2362 |                 ad->fullnames ? ad->afindex[y]->fullname :
 | 
|---|
 | 2363 |                 ad->afindex[y]->filename,
 | 
|---|
 | 2364 |                 szCmmaFmtFileSize,
 | 
|---|
 | 2365 |                 "-A"[((ad->afindex[y]->attrFile & FILE_ARCHIVED) != 0)],
 | 
|---|
 | 2366 |                 "-R"[((ad->afindex[y]->attrFile & FILE_READONLY) != 0)],
 | 
|---|
 | 2367 |                 "-H"[((ad->afindex[y]->attrFile & FILE_HIDDEN) != 0)],
 | 
|---|
 | 2368 |                 "-S"[((ad->afindex[y]->attrFile & FILE_SYSTEM) != 0)],
 | 
|---|
 | 2369 |                 "-D"[((ad->afindex[y]->attrFile & FILE_DIRECTORY) != 0)],
 | 
|---|
 | 2370 |                 ad->afindex[y]->date.year + 1980,
 | 
|---|
 | 2371 |                 ad->afindex[y]->date.month,
 | 
|---|
 | 2372 |                 ad->afindex[y]->date.day,
 | 
|---|
 | 2373 |                 ad->afindex[y]->time.hours,
 | 
|---|
 | 2374 |                 ad->afindex[y]->time.minutes,
 | 
|---|
 | 2375 |                 ad->afindex[y]->time.twosecs * 2);
 | 
|---|
| [551] | 2376 |   GpiCharStringAt(hps, &ptl, len, szBuff);
 | 
|---|
 | 2377 |   GpiQueryCurrentPosition(hps, &ptl);
 | 
|---|
 | 2378 |   if (ptl.x + abs(ad->horzscroll) > ad->maxx) {
 | 
|---|
| [2] | 2379 |     ad->maxx = ptl.x + abs(ad->horzscroll);
 | 
|---|
| [551] | 2380 |     WinSendMsg(ad->hhscroll, SBM_SETTHUMBSIZE,
 | 
|---|
| [1158] | 2381 |                MPFROM2SHORT((SHORT) Rectl->xRight, (SHORT) ad->maxx), MPVOID);
 | 
|---|
| [2] | 2382 |   }
 | 
|---|
 | 2383 | }
 | 
|---|
 | 2384 | 
 | 
|---|
| [551] | 2385 | MRESULT EXPENTRY SeeStatusProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 | 
|---|
| [162] | 2386 | {
 | 
|---|
| [551] | 2387 |   switch (msg) {
 | 
|---|
 | 2388 |   case WM_CREATE:
 | 
|---|
 | 2389 |     return CommonTextProc(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 2390 | 
 | 
|---|
| [551] | 2391 |   case WM_SETFOCUS:
 | 
|---|
 | 2392 |     if (mp2)
 | 
|---|
 | 2393 |       PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);
 | 
|---|
 | 2394 |     break;
 | 
|---|
| [2] | 2395 | 
 | 
|---|
| [551] | 2396 |   case WM_PAINT:
 | 
|---|
 | 2397 |     {
 | 
|---|
 | 2398 |       SWP swp;
 | 
|---|
 | 2399 |       POINTL ptl;
 | 
|---|
 | 2400 |       HPS hps;
 | 
|---|
| [2] | 2401 | 
 | 
|---|
| [551] | 2402 |       PaintRecessedWindow(hwnd, (HPS) 0, FALSE, FALSE);
 | 
|---|
 | 2403 |       hps = WinGetPS(WinQueryWindow(hwnd, QW_PARENT));
 | 
|---|
 | 2404 |       if (hps) {
 | 
|---|
| [1158] | 2405 |         WinQueryWindowPos(hwnd, &swp);
 | 
|---|
 | 2406 |         ptl.x = swp.x - 1;
 | 
|---|
 | 2407 |         ptl.y = swp.y + swp.cy + 2;
 | 
|---|
 | 2408 |         GpiMove(hps, &ptl);
 | 
|---|
 | 2409 |         GpiSetColor(hps, CLR_WHITE);
 | 
|---|
 | 2410 |         ptl.x = swp.x + swp.cx;
 | 
|---|
 | 2411 |         GpiLine(hps, &ptl);
 | 
|---|
 | 2412 |         WinReleasePS(hps);
 | 
|---|
| [2] | 2413 |       }
 | 
|---|
| [551] | 2414 |     }
 | 
|---|
 | 2415 |     break;
 | 
|---|
| [2] | 2416 | 
 | 
|---|
| [551] | 2417 |   case UM_FOCUSME:
 | 
|---|
 | 2418 |     WinSetFocus(HWND_DESKTOP, WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
 | 
|---|
| [1158] | 2419 |                                               FID_CLIENT));
 | 
|---|
| [551] | 2420 |     return 0;
 | 
|---|
| [2] | 2421 |   }
 | 
|---|
| [551] | 2422 |   return PFNWPStatic(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 2423 | }
 | 
|---|
 | 2424 | 
 | 
|---|
| [551] | 2425 | MRESULT EXPENTRY SeeFrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 | 
|---|
| [162] | 2426 | {
 | 
|---|
| [551] | 2427 |   PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [2] | 2428 | 
 | 
|---|
| [551] | 2429 |   switch (msg) {
 | 
|---|
 | 2430 |   case WM_BUTTON1UP:
 | 
|---|
 | 2431 |   case WM_BUTTON2UP:
 | 
|---|
 | 2432 |   case WM_BUTTON3UP:
 | 
|---|
 | 2433 |   case WM_MOUSEMOVE:
 | 
|---|
 | 2434 |   case WM_CHORD:
 | 
|---|
 | 2435 |     shiftstate = (SHORT2FROMMP(mp2) & (KC_SHIFT | KC_ALT | KC_CTRL));
 | 
|---|
 | 2436 |     break;
 | 
|---|
| [2] | 2437 | 
 | 
|---|
| [551] | 2438 |   case WM_CHAR:
 | 
|---|
 | 2439 |     shiftstate = (SHORT1FROMMP(mp1) & (KC_SHIFT | KC_ALT | KC_CTRL));
 | 
|---|
 | 2440 |     break;
 | 
|---|
| [2] | 2441 | 
 | 
|---|
| [551] | 2442 |   case WM_CALCFRAMERECT:
 | 
|---|
 | 2443 |     {
 | 
|---|
 | 2444 |       MRESULT mr;
 | 
|---|
 | 2445 |       PRECTL prectl;
 | 
|---|
| [2] | 2446 | 
 | 
|---|
| [551] | 2447 |       mr = oldproc(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 2448 | 
 | 
|---|
| [551] | 2449 |       /*
 | 
|---|
 | 2450 |        * Calculate the position of the client rectangle.
 | 
|---|
 | 2451 |        * Otherwise,  we'll see a lot of redraw when we move the
 | 
|---|
 | 2452 |        * client during WM_FORMATFRAME.
 | 
|---|
 | 2453 |        */
 | 
|---|
| [2] | 2454 | 
 | 
|---|
| [551] | 2455 |       if (mr && mp2) {
 | 
|---|
| [1158] | 2456 |         prectl = (PRECTL) mp1;
 | 
|---|
 | 2457 |         prectl->yBottom += 22;
 | 
|---|
 | 2458 |         prectl->yTop -= 24;
 | 
|---|
| [2] | 2459 |       }
 | 
|---|
| [551] | 2460 |       return mr;
 | 
|---|
 | 2461 |     }
 | 
|---|
| [2] | 2462 | 
 | 
|---|
| [551] | 2463 |   case WM_FORMATFRAME:
 | 
|---|
 | 2464 |     {
 | 
|---|
 | 2465 |       SHORT sCount;
 | 
|---|
 | 2466 |       PSWP pswp, pswpClient, pswpNew;
 | 
|---|
| [2] | 2467 | 
 | 
|---|
| [551] | 2468 |       sCount = (SHORT) oldproc(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 2469 | 
 | 
|---|
| [551] | 2470 |       /*
 | 
|---|
 | 2471 |        * Reformat the frame to "squeeze" the client
 | 
|---|
 | 2472 |        * and make room for status window sibling beneath
 | 
|---|
 | 2473 |        */
 | 
|---|
| [2] | 2474 | 
 | 
|---|
| [551] | 2475 |       pswp = (PSWP) mp1;
 | 
|---|
 | 2476 |       {
 | 
|---|
| [1158] | 2477 |         SHORT x;
 | 
|---|
| [2] | 2478 | 
 | 
|---|
| [1158] | 2479 |         for (x = 0; x < sCount; x++) {
 | 
|---|
 | 2480 |           if (WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_CLIENT) {
 | 
|---|
 | 2481 |             pswpClient = pswp;
 | 
|---|
 | 2482 |             break;
 | 
|---|
 | 2483 |           }
 | 
|---|
 | 2484 |           pswp++;
 | 
|---|
 | 2485 |         }
 | 
|---|
| [2] | 2486 |       }
 | 
|---|
| [551] | 2487 |       pswpNew = (PSWP) mp1 + sCount;
 | 
|---|
 | 2488 |       *pswpNew = *pswpClient;
 | 
|---|
 | 2489 |       pswpNew->hwnd = WinWindowFromID(hwnd, SEEALL_STATUS);
 | 
|---|
 | 2490 |       pswpNew->x = pswpClient->x + 2;
 | 
|---|
 | 2491 |       pswpNew->y = pswpClient->y + 2;
 | 
|---|
 | 2492 |       pswpNew->cx = pswpClient->cx - 3;
 | 
|---|
 | 2493 |       pswpNew->cy = 20;
 | 
|---|
 | 2494 |       pswpClient->y = pswpNew->y + pswpNew->cy + 3;
 | 
|---|
 | 2495 |       pswpClient->cy = (pswpClient->cy - pswpNew->cy) - 5;
 | 
|---|
 | 2496 |       sCount++;
 | 
|---|
 | 2497 |       return MRFROMSHORT(sCount);
 | 
|---|
 | 2498 |     }
 | 
|---|
| [2] | 2499 | 
 | 
|---|
| [551] | 2500 |   case WM_QUERYFRAMECTLCOUNT:
 | 
|---|
 | 2501 |     {
 | 
|---|
 | 2502 |       SHORT sCount;
 | 
|---|
| [2] | 2503 | 
 | 
|---|
| [551] | 2504 |       sCount = (SHORT) oldproc(hwnd, msg, mp1, mp2);
 | 
|---|
 | 2505 |       sCount++;
 | 
|---|
 | 2506 |       return MRFROMSHORT(sCount);
 | 
|---|
 | 2507 |     }
 | 
|---|
| [2] | 2508 |   }
 | 
|---|
| [551] | 2509 |   return oldproc(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 2510 | }
 | 
|---|
 | 2511 | 
 | 
|---|
| [551] | 2512 | MRESULT EXPENTRY SeeAllWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 | 
|---|
| [162] | 2513 | {
 | 
|---|
| [551] | 2514 |   ALLDATA *pAD = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
| [2] | 2515 | 
 | 
|---|
 | 2516 |   switch (msg) {
 | 
|---|
| [551] | 2517 |   case WM_CREATE:
 | 
|---|
 | 2518 |     // fprintf(stderr,"Seeall: WM_CREATE\n");
 | 
|---|
 | 2519 |     WinSetWindowPtr(hwnd, QWL_USER, NULL);
 | 
|---|
| [1063] | 2520 | #   ifdef FORTIFY
 | 
|---|
 | 2521 |     Fortify_EnterScope();
 | 
|---|
 | 2522 | #    endif
 | 
|---|
| [551] | 2523 |     pAD = xmallocz(sizeof(ALLDATA), pszSrcFile, __LINE__);
 | 
|---|
 | 2524 |     if (pAD) {
 | 
|---|
 | 2525 |       HWND hwndFrame;
 | 
|---|
 | 2526 | 
 | 
|---|
 | 2527 |       pAD->size = sizeof(ALLDATA);
 | 
|---|
 | 2528 |       hwndFrame = WinQueryWindow(hwnd, QW_PARENT);
 | 
|---|
 | 2529 |       pAD->hwndFrame = hwndFrame;
 | 
|---|
 | 2530 |       pAD->mask.attrFile = FILE_READONLY | FILE_HIDDEN |
 | 
|---|
| [1158] | 2531 |         FILE_SYSTEM | FILE_ARCHIVED;
 | 
|---|
| [551] | 2532 |       pAD->mask.fNoDirs = TRUE;
 | 
|---|
 | 2533 |       *(pAD->mask.prompt) = 0;
 | 
|---|
 | 2534 |       WinSetWindowPtr(hwnd, QWL_USER, (PVOID) pAD);
 | 
|---|
 | 2535 |       pAD->pfnCompare = comparenames;
 | 
|---|
 | 2536 |       if (Firsttime) {
 | 
|---|
 | 2537 | 
 | 
|---|
| [1158] | 2538 |         ULONG size;
 | 
|---|
| [551] | 2539 | 
 | 
|---|
| [1158] | 2540 |         size = sizeof(USHORT);
 | 
|---|
 | 2541 |         PrfQueryProfileData(fmprof,
 | 
|---|
 | 2542 |                             appname,
 | 
|---|
 | 2543 |                             "Seeall.Codepage", (PVOID) & Codepage, &size);
 | 
|---|
 | 2544 |         size = sizeof(BOOL);
 | 
|---|
 | 2545 |         PrfQueryProfileData(fmprof,
 | 
|---|
 | 2546 |                             appname,
 | 
|---|
 | 2547 |                             "Seeall.Fullnames", (PVOID) & Fullnames, &size);
 | 
|---|
 | 2548 |         size = sizeof(USHORT);
 | 
|---|
 | 2549 |         PrfQueryProfileData(fmprof,
 | 
|---|
 | 2550 |                             appname,
 | 
|---|
 | 2551 |                             "Seeall.Sort", (PVOID) & SortType, &size);
 | 
|---|
 | 2552 |         size = sizeof(BOOL);
 | 
|---|
 | 2553 |         PrfQueryProfileData(fmprof,
 | 
|---|
 | 2554 |                             appname,
 | 
|---|
 | 2555 |                             "Seeall.SortReverse",
 | 
|---|
 | 2556 |                             (PVOID) & SortReverse, &size);
 | 
|---|
 | 2557 |         memset(&Fattrs, 0, sizeof(Fattrs));
 | 
|---|
 | 2558 |         size = sizeof(Fattrs);
 | 
|---|
 | 2559 |         Fattrs.usRecordLength = sizeof(Fattrs);
 | 
|---|
 | 2560 |         Fattrs.lMaxBaselineExt = 16;
 | 
|---|
 | 2561 |         Fattrs.lAveCharWidth = 8;
 | 
|---|
 | 2562 |         Fattrs.usCodePage = Codepage;
 | 
|---|
 | 2563 |         strcpy(Fattrs.szFacename, GetPString(IDS_SYSMONOTEXT));
 | 
|---|
 | 2564 |         PrfQueryProfileData(fmprof,
 | 
|---|
 | 2565 |                             appname,
 | 
|---|
 | 2566 |                             "Seeall.Fattrs", (PVOID) & Fattrs, &size);
 | 
|---|
 | 2567 |         size = sizeof(LONG) * COLORS_MAX;
 | 
|---|
 | 2568 |         PrfQueryProfileData(fmprof,
 | 
|---|
 | 2569 |                             appname, "Seeall.Colors", (PVOID) Colors, &size);
 | 
|---|
 | 2570 |         Firsttime = FALSE;
 | 
|---|
| [551] | 2571 |       }
 | 
|---|
 | 2572 |       switch (SortType) {
 | 
|---|
 | 2573 |       case IDM_SORTEASIZE:
 | 
|---|
| [1158] | 2574 |         pAD->pfnCompare = (PFNSORT) NULL;
 | 
|---|
 | 2575 |         break;
 | 
|---|
| [551] | 2576 |       case IDM_SORTNAME:
 | 
|---|
| [1158] | 2577 |         pAD->pfnCompare = comparefullnames;
 | 
|---|
 | 2578 |         break;
 | 
|---|
| [551] | 2579 |       case IDM_SORTFILENAME:
 | 
|---|
| [1158] | 2580 |         pAD->pfnCompare = comparenames;
 | 
|---|
 | 2581 |         break;
 | 
|---|
| [551] | 2582 |       case IDM_SORTSIZE:
 | 
|---|
| [1158] | 2583 |         pAD->pfnCompare = comparesizes;
 | 
|---|
 | 2584 |         break;
 | 
|---|
| [551] | 2585 |       case IDM_SORTLWDATE:
 | 
|---|
| [1158] | 2586 |         pAD->pfnCompare = comparedates;
 | 
|---|
 | 2587 |         break;
 | 
|---|
| [551] | 2588 |       case IDM_SORTFIRST:
 | 
|---|
| [1158] | 2589 |         pAD->pfnCompare = compareexts;
 | 
|---|
 | 2590 |         break;
 | 
|---|
| [551] | 2591 |       }
 | 
|---|
 | 2592 |       pAD->invertsort = SortReverse;
 | 
|---|
 | 2593 |       pAD->fattrs = Fattrs;
 | 
|---|
 | 2594 |       pAD->fullnames = Fullnames;
 | 
|---|
 | 2595 |       pAD->stopflag = 0;
 | 
|---|
 | 2596 |       pAD->cursored = pAD->topfile = 1;
 | 
|---|
 | 2597 |       pAD->fattrs.usCodePage = Codepage;
 | 
|---|
 | 2598 |       memcpy(pAD->aulColors, Colors, sizeof(LONG) * COLORS_MAX);
 | 
|---|
 | 2599 |       pAD->hwndMenu = WinWindowFromID(hwndFrame, FID_MENU);
 | 
|---|
 | 2600 |       SetConditionalCascade(pAD->hwndMenu, IDM_DELETESUBMENU,
 | 
|---|
| [1158] | 2601 |                             (fDefaultDeletePerm) ?
 | 
|---|
 | 2602 |                             IDM_PERMDELETE : IDM_DELETE);
 | 
|---|
| [551] | 2603 |       SetConditionalCascade(pAD->hwndMenu, IDM_MOVEMENU, IDM_MOVE);
 | 
|---|
 | 2604 |       SetConditionalCascade(pAD->hwndMenu, IDM_COPYMENU, IDM_COPY);
 | 
|---|
 | 2605 |       SetConditionalCascade(pAD->hwndMenu, IDM_OPENSUBMENU, IDM_OPENDEFAULT);
 | 
|---|
 | 2606 |       SetConditionalCascade(pAD->hwndMenu, IDM_OBJECTSUBMENU, IDM_SHADOW);
 | 
|---|
 | 2607 |       if (fWorkPlace) {
 | 
|---|
| [1158] | 2608 |         WinSendMsg(pAD->hwndMenu, MM_DELETEITEM,
 | 
|---|
 | 2609 |                    MPFROM2SHORT(IDM_OPENSUBMENU, TRUE), MPVOID);
 | 
|---|
 | 2610 |         WinSendMsg(pAD->hwndMenu, MM_DELETEITEM,
 | 
|---|
 | 2611 |                    MPFROM2SHORT(IDM_OBJECTSUBMENU, TRUE), MPVOID);
 | 
|---|
| [551] | 2612 |       }
 | 
|---|
 | 2613 |       pAD->hwndClient = hwnd;
 | 
|---|
 | 2614 |       pAD->hps = InitWindow(hwnd);
 | 
|---|
 | 2615 |       pAD->hvscroll = WinWindowFromID(hwndFrame, FID_VERTSCROLL);
 | 
|---|
 | 2616 |       pAD->hhscroll = WinWindowFromID(hwndFrame, FID_HORZSCROLL);
 | 
|---|
 | 2617 |       pAD->multiplier = 1;
 | 
|---|
 | 2618 |       if (_beginthread(MakeSeeObjWinThread, NULL, 122880, (PVOID) pAD) == -1)
 | 
|---|
| [1158] | 2619 |         Runtime_Error(pszSrcFile, __LINE__,
 | 
|---|
 | 2620 |                       GetPString(IDS_COULDNTSTARTTHREADTEXT));
 | 
|---|
| [551] | 2621 |       else {
 | 
|---|
| [1158] | 2622 |         if (!DosCreateMutexSem(NULL, &pAD->hmtxScan, 0, FALSE)) {
 | 
|---|
 | 2623 |           pAD->hwndStatus = WinCreateWindow(hwndFrame,
 | 
|---|
 | 2624 |                                             WC_SEESTATUS,
 | 
|---|
 | 2625 |                                             NullStr,
 | 
|---|
 | 2626 |                                             WS_VISIBLE | SS_TEXT |
 | 
|---|
 | 2627 |                                             DT_LEFT | DT_VCENTER,
 | 
|---|
 | 2628 |                                             0,
 | 
|---|
 | 2629 |                                             0,
 | 
|---|
 | 2630 |                                             0,
 | 
|---|
 | 2631 |                                             0,
 | 
|---|
 | 2632 |                                             hwndFrame,
 | 
|---|
 | 2633 |                                             HWND_TOP,
 | 
|---|
 | 2634 |                                             SEEALL_STATUS, NULL, NULL);
 | 
|---|
 | 2635 |           if (!pAD->hwndStatus)
 | 
|---|
 | 2636 |             Win_Error2(hwndFrame, hwnd, pszSrcFile, __LINE__,
 | 
|---|
 | 2637 |                        IDS_WINCREATEWINDOW);
 | 
|---|
 | 2638 |           else {
 | 
|---|
 | 2639 |             PFNWP oldproc;
 | 
|---|
| [2] | 2640 | 
 | 
|---|
| [1158] | 2641 |             oldproc = WinSubclassWindow(hwndFrame, SeeFrameWndProc);
 | 
|---|
 | 2642 |             WinSetWindowPtr(hwndFrame, QWL_USER, (PVOID) oldproc);
 | 
|---|
 | 2643 |           }
 | 
|---|
 | 2644 |           break;
 | 
|---|
 | 2645 |         }
 | 
|---|
| [2] | 2646 |       }
 | 
|---|
| [551] | 2647 |     }
 | 
|---|
 | 2648 |     PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
 | 
|---|
 | 2649 |     break;
 | 
|---|
| [2] | 2650 | 
 | 
|---|
| [551] | 2651 |   case UM_SETUP5:
 | 
|---|
 | 2652 |     // fprintf(stderr,"Seeall: UM_SETUP5\n");
 | 
|---|
 | 2653 |     if (pAD) {
 | 
|---|
| [1009] | 2654 |       if (mp1 && *((CHAR *)mp1))
 | 
|---|
| [1158] | 2655 |         strcpy(pAD->szFindPath, (CHAR *)mp1);
 | 
|---|
| [551] | 2656 |       else {
 | 
|---|
| [1158] | 2657 |         if (!WinDlgBox(HWND_DESKTOP, hwnd, AFDrvsWndProc,
 | 
|---|
 | 2658 |                        FM3ModHandle, DRVS_FRAME, (PVOID) pAD)) {
 | 
|---|
 | 2659 |           PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
 | 
|---|
 | 2660 |           return 0;
 | 
|---|
 | 2661 |         }
 | 
|---|
| [2] | 2662 |       }
 | 
|---|
| [551] | 2663 |       if (_beginthread(FindAllThread, NULL, 524288, (PVOID) hwnd) == -1) {
 | 
|---|
| [1158] | 2664 |         Runtime_Error(pszSrcFile, __LINE__,
 | 
|---|
 | 2665 |                       GetPString(IDS_COULDNTSTARTTHREADTEXT));
 | 
|---|
 | 2666 |         PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
 | 
|---|
| [551] | 2667 |       }
 | 
|---|
 | 2668 |       else {
 | 
|---|
| [1158] | 2669 |         DosSleep(50);//05 Aug 07 GKY 100
 | 
|---|
 | 2670 |         PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
 | 
|---|
 | 2671 |         PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID);
 | 
|---|
| [551] | 2672 |       }
 | 
|---|
 | 2673 |     }
 | 
|---|
 | 2674 |     else
 | 
|---|
 | 2675 |       PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
 | 
|---|
 | 2676 |     return 0;
 | 
|---|
| [2] | 2677 | 
 | 
|---|
| [551] | 2678 |   case UM_UPDATERECORDLIST:
 | 
|---|
 | 2679 |     if (mp1) {
 | 
|---|
| [2] | 2680 | 
 | 
|---|
| [551] | 2681 |       APIRET rc;
 | 
|---|
| [2] | 2682 | 
 | 
|---|
| [551] | 2683 |       rc = DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN);
 | 
|---|
 | 2684 |       if (!rc) {
 | 
|---|
| [1158] | 2685 |         WinSetPointer(HWND_DESKTOP, hptrBusy);
 | 
|---|
 | 2686 |         if (UpdateList(hwnd, mp1)) {
 | 
|---|
 | 2687 |           FreeList(mp1);
 | 
|---|
 | 2688 |           RemoveDeleted(hwnd);
 | 
|---|
 | 2689 |           ReSort(hwnd);
 | 
|---|
 | 2690 |           WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 2691 |         }
 | 
|---|
 | 2692 |         DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 2693 |         WinSetPointer(HWND_DESKTOP, hptrArrow);
 | 
|---|
| [2] | 2694 |       }
 | 
|---|
| [551] | 2695 |     }
 | 
|---|
 | 2696 |     return 0;
 | 
|---|
| [2] | 2697 | 
 | 
|---|
| [551] | 2698 |   case UM_SETUP2:
 | 
|---|
| [2] | 2699 | // fprintf(stderr,"Seeall: UM_SETUP2\n");
 | 
|---|
| [551] | 2700 |     if (pAD) {
 | 
|---|
| [2] | 2701 | 
 | 
|---|
| [551] | 2702 |       CHAR s[256];
 | 
|---|
 | 2703 |       BOOL once = FALSE;
 | 
|---|
 | 2704 |       ULONG x, ulDriveNum, ulDriveMap;
 | 
|---|
| [2] | 2705 | 
 | 
|---|
| [551] | 2706 |       strcpy(s, GetPString(IDS_SEEALLTITLETEXT));
 | 
|---|
 | 2707 |       if (!*pAD->szFindPath) {
 | 
|---|
| [1158] | 2708 |         DosError(FERR_DISABLEHARDERR);
 | 
|---|
 | 2709 |         if (!DosQCurDisk(&ulDriveNum, &ulDriveMap)) {
 | 
|---|
 | 2710 |           for (x = 2; x < 26 && !pAD->stopflag; x++) {
 | 
|---|
 | 2711 |             if ((ulDriveMap & (1 << x)) && pAD->abDrvFlags[x]) {
 | 
|---|
 | 2712 |               sprintf(&s[strlen(s)], "%s%c:", (once) ? ", " : " (", x + 'A');
 | 
|---|
 | 2713 |               once = TRUE;
 | 
|---|
 | 2714 |             }
 | 
|---|
 | 2715 |           }
 | 
|---|
 | 2716 |           if (once)
 | 
|---|
 | 2717 |             strcat(s, ")");
 | 
|---|
 | 2718 |         }
 | 
|---|
| [2] | 2719 |       }
 | 
|---|
| [551] | 2720 |       else {
 | 
|---|
| [1158] | 2721 |         strcat(s, " (");
 | 
|---|
 | 2722 |         strcat(s, pAD->szFindPath);
 | 
|---|
 | 2723 |         strcat(s, ")");
 | 
|---|
| [551] | 2724 |       }
 | 
|---|
 | 2725 |       WinSetWindowText(WinQueryWindow(hwnd, QW_PARENT), s);
 | 
|---|
 | 2726 |     }
 | 
|---|
 | 2727 |     return 0;
 | 
|---|
| [2] | 2728 | 
 | 
|---|
| [551] | 2729 |   case UM_SETUP3:
 | 
|---|
| [2] | 2730 | // fprintf(stderr,"Seeall: UM_SETUP3\n");
 | 
|---|
| [551] | 2731 |     if (pAD) {
 | 
|---|
| [943] | 2732 |       pAD->multiplier = pAD->afindexcnt / 32767;
 | 
|---|
 | 2733 |       if (pAD->multiplier * 32767 != pAD->afindexcnt)
 | 
|---|
| [1158] | 2734 |         pAD->multiplier++;
 | 
|---|
| [551] | 2735 |       if (!pAD->multiplier)
 | 
|---|
| [1158] | 2736 |         pAD->multiplier++;
 | 
|---|
| [551] | 2737 |       {
 | 
|---|
| [1158] | 2738 |         RECTL Rectl;
 | 
|---|
 | 2739 |         ULONG numlines;
 | 
|---|
| [2] | 2740 | 
 | 
|---|
| [1158] | 2741 |         WinQueryWindowRect(hwnd, &Rectl);
 | 
|---|
 | 2742 |         numlines = NumLines(&Rectl, pAD);
 | 
|---|
 | 2743 |         if (numlines) {
 | 
|---|
 | 2744 |           WinSendMsg(pAD->hhscroll, SBM_SETTHUMBSIZE,
 | 
|---|
 | 2745 |                      MPFROM2SHORT((SHORT) Rectl.xRight, (SHORT) pAD->maxx),
 | 
|---|
 | 2746 |                      MPVOID);
 | 
|---|
 | 2747 |           WinSendMsg(pAD->hvscroll, SBM_SETTHUMBSIZE,
 | 
|---|
 | 2748 |                      MPFROM2SHORT((SHORT) numlines,
 | 
|---|
 | 2749 |                                   (SHORT) min(pAD->afindexcnt, 32767)),
 | 
|---|
 | 2750 |                      MPFROM2SHORT(1, pAD->afindexcnt + 1));
 | 
|---|
 | 2751 |           WinSendMsg(pAD->hhscroll, SBM_SETSCROLLBAR,
 | 
|---|
 | 2752 |                      MPFROMSHORT((SHORT) abs(pAD->horzscroll)),
 | 
|---|
 | 2753 |                      MPFROM2SHORT(0, (SHORT) (pAD->maxx - Rectl.xRight)));
 | 
|---|
 | 2754 |           WinSendMsg(pAD->hvscroll, SBM_SETSCROLLBAR,
 | 
|---|
 | 2755 |                      MPFROMSHORT((SHORT) (pAD->topfile / pAD->multiplier)),
 | 
|---|
 | 2756 |                      MPFROM2SHORT(1,
 | 
|---|
 | 2757 |                                   (SHORT) (pAD->afindexcnt / pAD->multiplier) -
 | 
|---|
 | 2758 |                                   (numlines - 1)));
 | 
|---|
 | 2759 |           if (pAD->afindexcnt - pAD->topfile < numlines) {
 | 
|---|
 | 2760 |             pAD->topfile = ((pAD->afindexcnt - pAD->topfile) - numlines);
 | 
|---|
 | 2761 |             WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 2762 |           }
 | 
|---|
 | 2763 |         }
 | 
|---|
| [2] | 2764 |       }
 | 
|---|
| [551] | 2765 |     }
 | 
|---|
 | 2766 |     return 0;
 | 
|---|
| [2] | 2767 | 
 | 
|---|
| [551] | 2768 |   case UM_SETUP4:
 | 
|---|
 | 2769 |     // fprintf(stderr,"Seeall: UM_SETUP4\n");
 | 
|---|
 | 2770 |     if (pAD)
 | 
|---|
 | 2771 |       pAD->killme = TRUE;
 | 
|---|
 | 2772 |     else
 | 
|---|
 | 2773 |       PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
 | 
|---|
 | 2774 |     return 0;
 | 
|---|
| [2] | 2775 | 
 | 
|---|
| [551] | 2776 |   case UM_RESCAN:
 | 
|---|
 | 2777 |     // fprintf(stderr,"Seeall: UM_RESCAN\n");
 | 
|---|
 | 2778 |     if (pAD && !pAD->stopflag) {
 | 
|---|
 | 2779 |       if (DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
| [1158] | 2780 |         CHAR s[CCHMAXPATH + 80], tm[34];
 | 
|---|
| [2] | 2781 | 
 | 
|---|
| [1158] | 2782 |         if (mp1) {
 | 
|---|
 | 2783 |           strcpy(s, GetPString(IDS_SORTINGTEXT));
 | 
|---|
 | 2784 |           if (pAD->afindexcnt) {
 | 
|---|
 | 2785 |             commafmt(tm, sizeof(tm), pAD->afindexcnt);
 | 
|---|
 | 2786 |             strcat(s, tm);
 | 
|---|
 | 2787 |           }
 | 
|---|
 | 2788 |         }
 | 
|---|
 | 2789 |         else {
 | 
|---|
 | 2790 |           strcpy(s, GetPString(IDS_WORKINGTEXT));
 | 
|---|
 | 2791 |           if (pAD->afheadcnt) {
 | 
|---|
 | 2792 |             commafmt(tm, sizeof(tm), pAD->afheadcnt);
 | 
|---|
 | 2793 |             strcat(s, tm);
 | 
|---|
 | 2794 |           }
 | 
|---|
 | 2795 |         }
 | 
|---|
 | 2796 |         if (mp2) {
 | 
|---|
 | 2797 |           strcat(s, " ");
 | 
|---|
 | 2798 |           strcat(s, (CHAR *)mp2);
 | 
|---|
 | 2799 |         }
 | 
|---|
 | 2800 |         WinSetWindowText(pAD->hwndStatus, s);
 | 
|---|
| [551] | 2801 |       }
 | 
|---|
 | 2802 |       else {
 | 
|---|
| [1158] | 2803 |         CHAR s[(CCHMAXPATH * 2) + 80], tm[34], ts[34], tb[34];
 | 
|---|
 | 2804 |         ULONG y;
 | 
|---|
| [2] | 2805 | 
 | 
|---|
| [1158] | 2806 |         if (mp1) {
 | 
|---|
 | 2807 |           strcpy(s, GetPString(IDS_SORTINGTEXT));
 | 
|---|
 | 2808 |           if (pAD->afindexcnt) {
 | 
|---|
 | 2809 |             commafmt(tm, sizeof(tm), pAD->afindexcnt);
 | 
|---|
 | 2810 |             strcat(s, tm);
 | 
|---|
 | 2811 |           }
 | 
|---|
 | 2812 |           if (mp2) {
 | 
|---|
 | 2813 |             strcat(s, " ");
 | 
|---|
 | 2814 |             strcat(s, (CHAR *)mp2);
 | 
|---|
 | 2815 |           }
 | 
|---|
 | 2816 |         }
 | 
|---|
 | 2817 |         else if (pAD->afindexcnt) {
 | 
|---|
 | 2818 |           y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - (pAD->cursored - 1) :
 | 
|---|
 | 2819 |             pAD->cursored - 1;
 | 
|---|
 | 2820 |           commafmt(tm, sizeof(tm), pAD->afindexcnt);
 | 
|---|
 | 2821 |           commafmt(ts, sizeof(ts), pAD->selected);
 | 
|---|
 | 2822 |           CommaFmtULL(tb, sizeof(tb), pAD->ullSelectedBytes, ' ');
 | 
|---|
 | 2823 |           sprintf(s,
 | 
|---|
 | 2824 |                   " %s %s%s%s  %s %s (%s)  %s %s",
 | 
|---|
 | 2825 |                   tm,
 | 
|---|
 | 2826 |                   GetPString(IDS_FILETEXT),
 | 
|---|
 | 2827 |                   &"s"[pAD->afindexcnt == 1],
 | 
|---|
 | 2828 |                   (*pAD->mask.szMask ||
 | 
|---|
 | 2829 |                    (pAD->mask.attrFile & (~FILE_DIRECTORY)) !=
 | 
|---|
 | 2830 |                    (ALLATTRS & (~FILE_DIRECTORY)) ||
 | 
|---|
 | 2831 |                    pAD->mask.antiattr) ?
 | 
|---|
 | 2832 |                   GetPString(IDS_FILTEREDTEXT) :
 | 
|---|
 | 2833 |                   NullStr,
 | 
|---|
 | 2834 |                   ts,
 | 
|---|
 | 2835 |                   GetPString(IDS_SELECTEDTEXT),
 | 
|---|
 | 2836 |                   tb, GetPString(IDS_CURRTEXT), pAD->afindex[y]->fullname);
 | 
|---|
 | 2837 |         }
 | 
|---|
 | 2838 |         else
 | 
|---|
 | 2839 |           sprintf(s,
 | 
|---|
 | 2840 |                   GetPString(IDS_NOFILESPSTEXT),
 | 
|---|
 | 2841 |                   (*pAD->mask.szMask ||
 | 
|---|
 | 2842 |                    (pAD->mask.attrFile & (~FILE_DIRECTORY)) !=
 | 
|---|
 | 2843 |                    (ALLATTRS & (~FILE_DIRECTORY)) ||
 | 
|---|
 | 2844 |                    pAD->mask.antiattr) ?
 | 
|---|
 | 2845 |                   GetPString(IDS_FILTEREDTEXT) : NullStr);
 | 
|---|
 | 2846 |         WinSetWindowText(pAD->hwndStatus, s);
 | 
|---|
 | 2847 |         DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
| [2] | 2848 |       }
 | 
|---|
| [551] | 2849 |     }
 | 
|---|
 | 2850 |     return 0;
 | 
|---|
| [2] | 2851 | 
 | 
|---|
| [551] | 2852 |   case UM_SETUP:
 | 
|---|
 | 2853 |     // fprintf(stderr,"Seeall: UM_SETUP\n");
 | 
|---|
 | 2854 |     if (pAD) {
 | 
|---|
 | 2855 |       WinSendMsg(pAD->hvscroll, SBM_SETTHUMBSIZE, MPFROM2SHORT(1, 1), MPVOID);
 | 
|---|
 | 2856 |       WinSendMsg(pAD->hhscroll, SBM_SETTHUMBSIZE, MPFROM2SHORT(1, 1), MPVOID);
 | 
|---|
 | 2857 |       WinSetActiveWindow(HWND_DESKTOP, WinQueryWindow(hwnd, QW_PARENT));
 | 
|---|
 | 2858 |     }
 | 
|---|
 | 2859 |     return 0;
 | 
|---|
| [2] | 2860 | 
 | 
|---|
| [551] | 2861 |   case WM_CHAR:
 | 
|---|
 | 2862 |     shiftstate = (SHORT1FROMMP(mp1) & (KC_SHIFT | KC_ALT | KC_CTRL));
 | 
|---|
 | 2863 |     if (pAD && !(SHORT1FROMMP(mp1) & KC_KEYUP)) {
 | 
|---|
| [2] | 2864 | 
 | 
|---|
| [551] | 2865 |       register ULONG x;
 | 
|---|
 | 2866 |       ULONG numlines, y, wascursored = pAD->cursored, thistime, len;
 | 
|---|
 | 2867 |       BOOL found = FALSE;
 | 
|---|
 | 2868 |       RECTL rcl;
 | 
|---|
| [2] | 2869 | 
 | 
|---|
| [551] | 2870 |       WinQueryWindowRect(hwnd, &rcl);
 | 
|---|
 | 2871 |       numlines = NumLines(&rcl, pAD);
 | 
|---|
 | 2872 |       if (numlines) {
 | 
|---|
| [1158] | 2873 |         if (SHORT1FROMMP(mp1) & KC_VIRTUALKEY) {
 | 
|---|
 | 2874 |           pAD->lasttime = 0;
 | 
|---|
 | 2875 |           *pAD->szCommonName = 0;
 | 
|---|
 | 2876 |           switch (SHORT2FROMMP(mp2)) {
 | 
|---|
 | 2877 |           case VK_DELETE:
 | 
|---|
 | 2878 |             if ((shiftstate & KC_CTRL) == KC_CTRL)
 | 
|---|
 | 2879 |               PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_PERMDELETE, 0),
 | 
|---|
 | 2880 |                       MPVOID);
 | 
|---|
 | 2881 |             else if ((shiftstate & KC_SHIFT) == KC_SHIFT)
 | 
|---|
 | 2882 |               PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_SAVETOCLIP, 0),
 | 
|---|
 | 2883 |                       MPVOID);
 | 
|---|
 | 2884 |             else
 | 
|---|
 | 2885 |               PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_DELETE, 0), MPVOID);
 | 
|---|
 | 2886 |             break;
 | 
|---|
 | 2887 |           case VK_LEFT:
 | 
|---|
 | 2888 |             WinSendMsg(hwnd, WM_HSCROLL, MPFROM2SHORT(FID_HORZSCROLL, 0),
 | 
|---|
 | 2889 |                        MPFROM2SHORT(0, SB_LINELEFT));
 | 
|---|
 | 2890 |             break;
 | 
|---|
 | 2891 |           case VK_RIGHT:
 | 
|---|
 | 2892 |             WinSendMsg(hwnd, WM_HSCROLL, MPFROM2SHORT(FID_HORZSCROLL, 0),
 | 
|---|
 | 2893 |                        MPFROM2SHORT(0, SB_LINERIGHT));
 | 
|---|
 | 2894 |             break;
 | 
|---|
 | 2895 |           case VK_PAGEUP:
 | 
|---|
 | 2896 |             WinSendMsg(hwnd, WM_VSCROLL, MPFROM2SHORT(FID_VERTSCROLL, 0),
 | 
|---|
 | 2897 |                        MPFROM2SHORT(0, SB_PAGEUP));
 | 
|---|
 | 2898 |             break;
 | 
|---|
 | 2899 |           case VK_PAGEDOWN:
 | 
|---|
 | 2900 |             WinSendMsg(hwnd, WM_VSCROLL, MPFROM2SHORT(FID_VERTSCROLL, 0),
 | 
|---|
 | 2901 |                        MPFROM2SHORT(0, SB_PAGEDOWN));
 | 
|---|
 | 2902 |             break;
 | 
|---|
 | 2903 |           case VK_UP:
 | 
|---|
 | 2904 |             if (pAD->cursored > 1) {
 | 
|---|
 | 2905 |               if (shiftstate & KC_SHIFT)
 | 
|---|
 | 2906 |                 WinSendMsg(hwnd, WM_BUTTON1CLICK,
 | 
|---|
 | 2907 |                            MPFROM2SHORT(pAD->fattrs.lAveCharWidth + 2,
 | 
|---|
 | 2908 |                                         ((rcl.yTop - (pAD->lMaxHeight *
 | 
|---|
 | 2909 |                                                       ((pAD->cursored) -
 | 
|---|
 | 2910 |                                                        pAD->topfile))) -
 | 
|---|
 | 2911 |                                          pAD->lMaxDescender) - 1),
 | 
|---|
 | 2912 |                            MPFROM2SHORT(TRUE, 0));
 | 
|---|
 | 2913 |               pAD->cursored--;
 | 
|---|
 | 2914 |               if (pAD->cursored < pAD->topfile) {
 | 
|---|
 | 2915 |                 PaintLine(hwnd, pAD->hps, pAD->cursored, pAD->topfile, &rcl);
 | 
|---|
 | 2916 |                 WinSendMsg(hwnd, WM_VSCROLL, MPFROM2SHORT(FID_VERTSCROLL, 0),
 | 
|---|
 | 2917 |                            MPFROM2SHORT(0, SB_LINEUP));
 | 
|---|
 | 2918 |               }
 | 
|---|
 | 2919 |               else {
 | 
|---|
 | 2920 |                 PaintLine(hwnd, pAD->hps, pAD->cursored - 1, pAD->topfile,
 | 
|---|
 | 2921 |                           &rcl);
 | 
|---|
 | 2922 |                 PaintLine(hwnd, pAD->hps, pAD->cursored, pAD->topfile, &rcl);
 | 
|---|
 | 2923 |               }
 | 
|---|
 | 2924 |               PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 2925 |             }
 | 
|---|
 | 2926 |             break;
 | 
|---|
 | 2927 |           case VK_DOWN:
 | 
|---|
 | 2928 |             if (pAD->cursored < pAD->afindexcnt
 | 
|---|
 | 2929 |                 && pAD->cursored < pAD->topfile + numlines) {
 | 
|---|
 | 2930 |               if (shiftstate & KC_SHIFT)
 | 
|---|
 | 2931 |                 WinSendMsg(hwnd, WM_BUTTON1CLICK,
 | 
|---|
 | 2932 |                            MPFROM2SHORT(pAD->fattrs.lAveCharWidth + 2,
 | 
|---|
 | 2933 |                                         ((rcl.yTop - (pAD->lMaxHeight *
 | 
|---|
 | 2934 |                                                       ((pAD->cursored) -
 | 
|---|
 | 2935 |                                                        pAD->topfile))) -
 | 
|---|
 | 2936 |                                          pAD->lMaxDescender) - 1),
 | 
|---|
 | 2937 |                            MPFROM2SHORT(TRUE, 0));
 | 
|---|
 | 2938 |               pAD->cursored++;
 | 
|---|
 | 2939 |               if (pAD->cursored >= pAD->topfile + numlines) {
 | 
|---|
 | 2940 |                 PaintLine(hwnd, pAD->hps, pAD->cursored - 2, pAD->topfile,
 | 
|---|
 | 2941 |                           &rcl);
 | 
|---|
 | 2942 |                 WinSendMsg(hwnd, WM_VSCROLL, MPFROM2SHORT(FID_VERTSCROLL, 0),
 | 
|---|
 | 2943 |                            MPFROM2SHORT(0, SB_LINEDOWN));
 | 
|---|
 | 2944 |               }
 | 
|---|
 | 2945 |               else {
 | 
|---|
 | 2946 |                 PaintLine(hwnd, pAD->hps, pAD->cursored - 1, pAD->topfile,
 | 
|---|
 | 2947 |                           &rcl);
 | 
|---|
 | 2948 |                 PaintLine(hwnd, pAD->hps, pAD->cursored - 2, pAD->topfile,
 | 
|---|
 | 2949 |                           &rcl);
 | 
|---|
 | 2950 |               }
 | 
|---|
 | 2951 |               PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 2952 |             }
 | 
|---|
 | 2953 |             break;
 | 
|---|
 | 2954 |           case VK_END:
 | 
|---|
 | 2955 |             if ((shiftstate & KC_CTRL) ||
 | 
|---|
 | 2956 |                 pAD->cursored == (pAD->topfile - 1) + numlines) {
 | 
|---|
 | 2957 |               pAD->cursored = pAD->afindexcnt;
 | 
|---|
 | 2958 |               pAD->topfile = (pAD->afindexcnt + 1) - numlines;
 | 
|---|
 | 2959 |               if (pAD->topfile > pAD->afindexcnt)
 | 
|---|
 | 2960 |                 pAD->topfile = 1;
 | 
|---|
 | 2961 |               WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 2962 |             }
 | 
|---|
 | 2963 |             else {
 | 
|---|
 | 2964 |               pAD->cursored = (pAD->topfile - 1) + numlines;
 | 
|---|
 | 2965 |               if (pAD->cursored > pAD->afindexcnt)
 | 
|---|
 | 2966 |                 pAD->cursored = pAD->afindexcnt;
 | 
|---|
 | 2967 |               PaintLine(hwnd, pAD->hps, pAD->cursored - 1, pAD->topfile,
 | 
|---|
 | 2968 |                         &rcl);
 | 
|---|
 | 2969 |               PaintLine(hwnd, pAD->hps, wascursored - 1, pAD->topfile, &rcl);
 | 
|---|
 | 2970 |               PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 2971 |             }
 | 
|---|
 | 2972 |             break;
 | 
|---|
 | 2973 |           case VK_HOME:
 | 
|---|
 | 2974 |             if ((shiftstate & KC_CTRL) || pAD->cursored == pAD->topfile) {
 | 
|---|
 | 2975 |               pAD->topfile = 1;
 | 
|---|
 | 2976 |               pAD->cursored = 1;
 | 
|---|
 | 2977 |               WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 2978 |             }
 | 
|---|
 | 2979 |             else {
 | 
|---|
 | 2980 |               pAD->cursored = pAD->topfile;
 | 
|---|
 | 2981 |               PaintLine(hwnd, pAD->hps, pAD->cursored - 1, pAD->topfile,
 | 
|---|
 | 2982 |                         &rcl);
 | 
|---|
 | 2983 |               PaintLine(hwnd, pAD->hps, wascursored - 1, pAD->topfile, &rcl);
 | 
|---|
 | 2984 |               PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 2985 |             }
 | 
|---|
 | 2986 |             break;
 | 
|---|
 | 2987 |           case VK_SPACE:
 | 
|---|
 | 2988 |             WinSendMsg(hwnd, WM_BUTTON1CLICK,
 | 
|---|
 | 2989 |                        MPFROM2SHORT(pAD->fattrs.lAveCharWidth + 2,
 | 
|---|
 | 2990 |                                     ((rcl.yTop - (pAD->lMaxHeight *
 | 
|---|
 | 2991 |                                                   ((pAD->cursored) -
 | 
|---|
 | 2992 |                                                    pAD->topfile))) -
 | 
|---|
 | 2993 |                                      pAD->lMaxDescender) - 1),
 | 
|---|
 | 2994 |                        MPFROM2SHORT(TRUE, 0));
 | 
|---|
 | 2995 |             break;
 | 
|---|
 | 2996 |           case VK_NEWLINE:
 | 
|---|
 | 2997 |           case VK_ENTER:
 | 
|---|
 | 2998 |             WinSendMsg(hwnd, WM_BUTTON1DBLCLK,
 | 
|---|
 | 2999 |                        MPFROM2SHORT(pAD->fattrs.lAveCharWidth + 2,
 | 
|---|
 | 3000 |                                     ((rcl.yTop - (pAD->lMaxHeight *
 | 
|---|
 | 3001 |                                                   ((pAD->cursored) -
 | 
|---|
 | 3002 |                                                    pAD->topfile))) -
 | 
|---|
 | 3003 |                                      pAD->lMaxDescender) - 1), MPFROM2SHORT(0,
 | 
|---|
 | 3004 |                                                                             0));
 | 
|---|
 | 3005 |             break;
 | 
|---|
 | 3006 |           }
 | 
|---|
 | 3007 |         }
 | 
|---|
 | 3008 |         else if (SHORT1FROMMP(mp1) & KC_CHAR) {
 | 
|---|
 | 3009 |           switch (SHORT1FROMMP(mp2)) {
 | 
|---|
 | 3010 |           case '\x1b':
 | 
|---|
 | 3011 |           case '\r':
 | 
|---|
 | 3012 |           case '\n':
 | 
|---|
 | 3013 |             WinSendMsg(hwnd, WM_BUTTON1DBLCLK,
 | 
|---|
 | 3014 |                        MPFROM2SHORT(pAD->fattrs.lAveCharWidth + 2,
 | 
|---|
 | 3015 |                                     (rcl.yTop - (pAD->lMaxHeight *
 | 
|---|
 | 3016 |                                                  ((pAD->cursored) -
 | 
|---|
 | 3017 |                                                   pAD->topfile))) - 1),
 | 
|---|
 | 3018 |                        MPFROM2SHORT(0, 0));
 | 
|---|
 | 3019 |             pAD->lasttime = 0;
 | 
|---|
 | 3020 |             *pAD->szCommonName = 0;
 | 
|---|
 | 3021 |             break;
 | 
|---|
 | 3022 |           default:
 | 
|---|
 | 3023 |             thistime = WinQueryMsgTime(WinQueryAnchorBlock(hwnd));
 | 
|---|
 | 3024 |             if (thistime > pAD->lasttime + 1000)
 | 
|---|
 | 3025 |               *pAD->szCommonName = 0;
 | 
|---|
 | 3026 |             pAD->lasttime = thistime;
 | 
|---|
 | 3027 |           KbdRetry:
 | 
|---|
 | 3028 |             len = strlen(pAD->szCommonName);
 | 
|---|
 | 3029 |             if (len >= CCHMAXPATH - 1) {
 | 
|---|
 | 3030 |               *pAD->szCommonName = 0;
 | 
|---|
 | 3031 |               len = 0;
 | 
|---|
 | 3032 |             }
 | 
|---|
 | 3033 |             pAD->szCommonName[len] = toupper(SHORT1FROMMP(mp2));
 | 
|---|
 | 3034 |             pAD->szCommonName[len + 1] = 0;
 | 
|---|
 | 3035 |             for (x = pAD->cursored - (len > 0); x < pAD->afindexcnt; x++) {
 | 
|---|
 | 3036 |               y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - x : x;
 | 
|---|
 | 3037 |               if (pAD->fullnames) {
 | 
|---|
 | 3038 |                 if (!strnicmp(pAD->afindex[y]->fullname, pAD->szCommonName,
 | 
|---|
 | 3039 |                               len + 1)) {
 | 
|---|
 | 3040 |                   found = TRUE;
 | 
|---|
 | 3041 |                   break;
 | 
|---|
 | 3042 |                 }
 | 
|---|
 | 3043 |               }
 | 
|---|
 | 3044 |               else {
 | 
|---|
 | 3045 |                 if (!strnicmp(pAD->afindex[y]->filename, pAD->szCommonName,
 | 
|---|
 | 3046 |                               len + 1)) {
 | 
|---|
 | 3047 |                   found = TRUE;
 | 
|---|
 | 3048 |                   break;
 | 
|---|
 | 3049 |                 }
 | 
|---|
 | 3050 |               }
 | 
|---|
 | 3051 |             }
 | 
|---|
 | 3052 |             if (!found) {
 | 
|---|
 | 3053 |               for (x = 0; x < pAD->cursored - (len > 0); x++) {
 | 
|---|
 | 3054 |                 y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - x : x;
 | 
|---|
 | 3055 |                 if (pAD->fullnames) {
 | 
|---|
 | 3056 |                   if (!strnicmp(pAD->afindex[y]->fullname, pAD->szCommonName,
 | 
|---|
 | 3057 |                                 len + 1)) {
 | 
|---|
 | 3058 |                     found = TRUE;
 | 
|---|
 | 3059 |                     break;
 | 
|---|
 | 3060 |                   }
 | 
|---|
 | 3061 |                 }
 | 
|---|
 | 3062 |                 else {
 | 
|---|
 | 3063 |                   if (!strnicmp(pAD->afindex[y]->filename, pAD->szCommonName,
 | 
|---|
 | 3064 |                                 len + 1)) {
 | 
|---|
 | 3065 |                     found = TRUE;
 | 
|---|
 | 3066 |                     break;
 | 
|---|
 | 3067 |                   }
 | 
|---|
 | 3068 |                 }
 | 
|---|
 | 3069 |               }
 | 
|---|
 | 3070 |             }
 | 
|---|
 | 3071 |             if (found) {
 | 
|---|
 | 3072 |               if (x + 1 != pAD->cursored) {
 | 
|---|
 | 3073 |                 pAD->cursored = x + 1;
 | 
|---|
 | 3074 |                 if (pAD->cursored >= pAD->topfile &&
 | 
|---|
 | 3075 |                     pAD->cursored < pAD->topfile + numlines &&
 | 
|---|
 | 3076 |                     wascursored != pAD->cursored) {
 | 
|---|
 | 3077 |                   PaintLine(hwnd, pAD->hps, pAD->cursored - 1, pAD->topfile,
 | 
|---|
 | 3078 |                             &rcl);
 | 
|---|
 | 3079 |                   PaintLine(hwnd, pAD->hps, wascursored - 1, pAD->topfile,
 | 
|---|
 | 3080 |                             &rcl);
 | 
|---|
 | 3081 |                 }
 | 
|---|
 | 3082 |                 else {
 | 
|---|
 | 3083 |                   if (pAD->cursored < numlines)
 | 
|---|
 | 3084 |                     pAD->topfile = 1;
 | 
|---|
 | 3085 |                   else if (pAD->cursored >
 | 
|---|
 | 3086 |                            (pAD->afindexcnt + 1) - (numlines / 2))
 | 
|---|
 | 3087 |                     pAD->topfile = (pAD->afindexcnt + 1) - numlines;
 | 
|---|
 | 3088 |                   else
 | 
|---|
 | 3089 |                     pAD->topfile = pAD->cursored - (numlines / 2);
 | 
|---|
 | 3090 |                   WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 3091 |                 }
 | 
|---|
 | 3092 |               }
 | 
|---|
 | 3093 |             }
 | 
|---|
 | 3094 |             else {
 | 
|---|
 | 3095 |               *pAD->szCommonName = 0;
 | 
|---|
 | 3096 |               pAD->lasttime = 0;
 | 
|---|
 | 3097 |               if (len)                  // retry as first letter if no match
 | 
|---|
 | 3098 |                 goto KbdRetry;
 | 
|---|
 | 3099 |             }
 | 
|---|
 | 3100 |             break;
 | 
|---|
 | 3101 |           }
 | 
|---|
 | 3102 |         }
 | 
|---|
| [2] | 3103 |       }
 | 
|---|
| [551] | 3104 |     }
 | 
|---|
 | 3105 |     break;
 | 
|---|
| [2] | 3106 | 
 | 
|---|
| [551] | 3107 |   case DM_PRINTOBJECT:
 | 
|---|
 | 3108 |     return MRFROMLONG(DRR_TARGET);
 | 
|---|
| [2] | 3109 | 
 | 
|---|
| [551] | 3110 |   case DM_DISCARDOBJECT:
 | 
|---|
 | 3111 |     return MRFROMLONG(DRR_TARGET);
 | 
|---|
| [2] | 3112 | 
 | 
|---|
| [551] | 3113 |   case WM_BEGINDRAG:
 | 
|---|
 | 3114 |     {
 | 
|---|
 | 3115 |       CHAR **list;
 | 
|---|
| [2] | 3116 | 
 | 
|---|
| [551] | 3117 |       list = BuildAList(hwnd);
 | 
|---|
 | 3118 |       if (!list)
 | 
|---|
| [1158] | 3119 |         Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
 | 
|---|
| [551] | 3120 |       else {
 | 
|---|
| [1158] | 3121 |         WinSetWindowText(pAD->hwndStatus, GetPString(IDS_DRAGGINGFILESTEXT));
 | 
|---|
 | 3122 |         DragList(hwnd, (HWND) 0, list, TRUE);
 | 
|---|
 | 3123 |         FreeList(list);
 | 
|---|
 | 3124 |         PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
| [2] | 3125 |       }
 | 
|---|
| [551] | 3126 |     }
 | 
|---|
 | 3127 |     break;
 | 
|---|
| [2] | 3128 | 
 | 
|---|
| [551] | 3129 |   case WM_BUTTON1MOTIONSTART:
 | 
|---|
 | 3130 |     if (pAD && !pAD->stopflag &&
 | 
|---|
| [1158] | 3131 |         !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
| [551] | 3132 |       pAD->mousecaptured = TRUE;
 | 
|---|
 | 3133 |       pAD->lastselected = (ULONG) - 1;
 | 
|---|
 | 3134 |       pAD->lastdirection = 0;
 | 
|---|
 | 3135 |       WinSetCapture(HWND_DESKTOP, hwnd);
 | 
|---|
 | 3136 |       DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 3137 |       WinSendMsg(hwnd, WM_BUTTON1CLICK, mp1, MPFROM2SHORT(TRUE, 0));
 | 
|---|
 | 3138 |     }
 | 
|---|
 | 3139 |     break;
 | 
|---|
| [2] | 3140 | 
 | 
|---|
| [551] | 3141 |   case WM_MOUSEMOVE:
 | 
|---|
 | 3142 |     shiftstate = (SHORT2FROMMP(mp2) & (KC_SHIFT | KC_ALT | KC_CTRL));
 | 
|---|
 | 3143 |     if (pAD && pAD->mousecaptured) {
 | 
|---|
| [2] | 3144 | 
 | 
|---|
| [551] | 3145 |       ULONG numlines, whichfile, y, x;
 | 
|---|
 | 3146 |       LONG inc;
 | 
|---|
 | 3147 |       RECTL Rectl;
 | 
|---|
 | 3148 |       POINTS pts;
 | 
|---|
 | 3149 |       BOOL outofwindow = FALSE;
 | 
|---|
| [2] | 3150 | 
 | 
|---|
| [551] | 3151 |       WinQueryWindowRect(hwnd, &Rectl);
 | 
|---|
 | 3152 |       numlines = NumLines(&Rectl, pAD);
 | 
|---|
 | 3153 |       if (numlines) {
 | 
|---|
| [1158] | 3154 |         pts.x = SHORT1FROMMP(mp1);
 | 
|---|
 | 3155 |         pts.y = SHORT2FROMMP(mp1);
 | 
|---|
 | 3156 |         if (pts.y < 0) {
 | 
|---|
 | 3157 |           WinSendMsg(hwnd, WM_VSCROLL, MPFROM2SHORT(FID_VERTSCROLL, 0),
 | 
|---|
 | 3158 |                      MPFROM2SHORT(0, SB_LINEDOWN));
 | 
|---|
 | 3159 |           pts.y = 1;
 | 
|---|
 | 3160 |           outofwindow = TRUE;
 | 
|---|
 | 3161 |         }
 | 
|---|
 | 3162 |         else if (pts.y > Rectl.yTop - Rectl.yBottom) {
 | 
|---|
 | 3163 |           WinSendMsg(hwnd, WM_VSCROLL, MPFROM2SHORT(FID_VERTSCROLL, 0),
 | 
|---|
 | 3164 |                      MPFROM2SHORT(0, SB_LINEUP));
 | 
|---|
 | 3165 |           pts.y = (Rectl.yTop - Rectl.yBottom) - 1;
 | 
|---|
 | 3166 |           outofwindow = TRUE;
 | 
|---|
 | 3167 |         }
 | 
|---|
 | 3168 |         whichfile = ((Rectl.yTop - Rectl.yBottom) -
 | 
|---|
 | 3169 |                      ((LONG) pts.y + pAD->lMaxDescender)) / pAD->lMaxHeight;
 | 
|---|
 | 3170 |         if (whichfile > numlines - 1)
 | 
|---|
 | 3171 |           whichfile = numlines - 1;
 | 
|---|
 | 3172 |         whichfile += (pAD->topfile - 1);
 | 
|---|
 | 3173 |         y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - whichfile : whichfile;
 | 
|---|
 | 3174 |         if (y < pAD->afindexcnt && pAD->lastselected != whichfile) {
 | 
|---|
 | 3175 |           if (pAD->lastselected != (ULONG) - 1) {
 | 
|---|
 | 3176 |             inc = (pAD->lastselected < whichfile) ? 1 : -1;
 | 
|---|
 | 3177 |             for (x = pAD->lastselected + inc;
 | 
|---|
 | 3178 |                  x != whichfile && x < pAD->afindexcnt;
 | 
|---|
 | 3179 |                  (pAD->lastselected < whichfile) ? x++ : x--) {
 | 
|---|
 | 3180 |               y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - x : x;
 | 
|---|
 | 3181 |               if (pAD->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 3182 |                 pAD->afindex[y]->flags &= ~AF_SELECTED;
 | 
|---|
 | 3183 |                 pAD->selected--;
 | 
|---|
 | 3184 |                 pAD->ullSelectedBytes -= pAD->afindex[y]->cbFile;
 | 
|---|
 | 3185 |               }
 | 
|---|
 | 3186 |               else {
 | 
|---|
 | 3187 |                 pAD->afindex[y]->flags |= AF_SELECTED;
 | 
|---|
 | 3188 |                 pAD->selected++;
 | 
|---|
 | 3189 |                 pAD->ullSelectedBytes += pAD->afindex[y]->cbFile;
 | 
|---|
 | 3190 |               }
 | 
|---|
 | 3191 |               PaintLine(hwnd, pAD->hps, x, pAD->topfile, &Rectl);
 | 
|---|
 | 3192 |             }
 | 
|---|
 | 3193 |           }
 | 
|---|
 | 3194 |           WinSendMsg(hwnd, WM_BUTTON1CLICK, MPFROM2SHORT(pts.x, pts.y),
 | 
|---|
 | 3195 |                      MPFROM2SHORT(TRUE, 0));
 | 
|---|
 | 3196 |         }
 | 
|---|
| [2] | 3197 |       }
 | 
|---|
| [551] | 3198 |       if (outofwindow) {
 | 
|---|
| [2] | 3199 | 
 | 
|---|
| [1158] | 3200 |         POINTL ptl;
 | 
|---|
| [2] | 3201 | 
 | 
|---|
| [1158] | 3202 |         WinQueryPointerPos(HWND_DESKTOP, &ptl);
 | 
|---|
 | 3203 |         WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1);
 | 
|---|
 | 3204 |         if ((SHORT) ptl.y == (SHORT) SHORT2FROMMP(mp1) &&
 | 
|---|
 | 3205 |             (SHORT) ptl.x == (SHORT) SHORT1FROMMP(mp1) &&
 | 
|---|
 | 3206 |             ((SHORT) ptl.y < 0 || ptl.y > (Rectl.yTop - Rectl.yBottom))) {
 | 
|---|
 | 3207 |           PostMsg(hwnd, UM_MOUSEMOVE, mp1, MPVOID);
 | 
|---|
 | 3208 |           DosSleep(1);
 | 
|---|
 | 3209 |         }
 | 
|---|
| [2] | 3210 |       }
 | 
|---|
| [551] | 3211 |     }
 | 
|---|
 | 3212 |     break;
 | 
|---|
| [2] | 3213 | 
 | 
|---|
| [551] | 3214 |   case UM_MOUSEMOVE:
 | 
|---|
 | 3215 |     if (pAD && pAD->mousecaptured) {
 | 
|---|
 | 3216 | 
 | 
|---|
 | 3217 |       POINTL ptl;
 | 
|---|
 | 3218 |       RECTL Rectl;
 | 
|---|
 | 3219 | 
 | 
|---|
 | 3220 |       WinQueryWindowRect(hwnd, &Rectl);
 | 
|---|
 | 3221 |       WinQueryPointerPos(HWND_DESKTOP, &ptl);
 | 
|---|
| [766] | 3222 |       WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1);
 | 
|---|
| [551] | 3223 |       if ((SHORT) ptl.y == (SHORT) SHORT2FROMMP(mp1) &&
 | 
|---|
| [1158] | 3224 |           (SHORT) ptl.x == (SHORT) SHORT1FROMMP(mp1) &&
 | 
|---|
 | 3225 |           ((SHORT) ptl.y < 0 || ptl.y > (Rectl.yTop - Rectl.yBottom))) {
 | 
|---|
 | 3226 |         DosSleep(1);
 | 
|---|
 | 3227 |         PostMsg(hwnd, WM_MOUSEMOVE, mp1, MPFROM2SHORT(TRUE, 0));
 | 
|---|
| [2] | 3228 |       }
 | 
|---|
| [551] | 3229 |     }
 | 
|---|
 | 3230 |     return 0;
 | 
|---|
| [2] | 3231 | 
 | 
|---|
| [551] | 3232 |   case WM_BUTTON1UP:
 | 
|---|
 | 3233 |   case WM_BUTTON1MOTIONEND:
 | 
|---|
 | 3234 |     if (pAD) {
 | 
|---|
 | 3235 |       pAD->mousecaptured = FALSE;
 | 
|---|
 | 3236 |       pAD->lastselected = (ULONG) - 1;
 | 
|---|
 | 3237 |       pAD->lastdirection = 0;
 | 
|---|
 | 3238 |       WinSetCapture(HWND_DESKTOP, NULLHANDLE);
 | 
|---|
 | 3239 |     }
 | 
|---|
 | 3240 |     break;
 | 
|---|
| [2] | 3241 | 
 | 
|---|
| [551] | 3242 |   case WM_BUTTON1CLICK:
 | 
|---|
 | 3243 |   case WM_BUTTON1DBLCLK:
 | 
|---|
 | 3244 |     shiftstate = (SHORT2FROMMP(mp2) & (KC_SHIFT | KC_ALT | KC_CTRL));
 | 
|---|
 | 3245 |     if (pAD && !pAD->stopflag &&
 | 
|---|
| [1158] | 3246 |         !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
| [2] | 3247 | 
 | 
|---|
| [551] | 3248 |       ULONG numlines, whichfile, y, wascursored;
 | 
|---|
 | 3249 |       RECTL Rectl;
 | 
|---|
 | 3250 |       POINTS pts;
 | 
|---|
 | 3251 | 
 | 
|---|
| [943] | 3252 |       if (pAD->afindexcnt) {
 | 
|---|
| [1158] | 3253 |         WinQueryWindowRect(hwnd, &Rectl);
 | 
|---|
 | 3254 |         numlines = NumLines(&Rectl, pAD);
 | 
|---|
 | 3255 |         if (numlines) {
 | 
|---|
 | 3256 |           pts.x = SHORT1FROMMP(mp1);
 | 
|---|
 | 3257 |           pts.y = SHORT2FROMMP(mp1);
 | 
|---|
 | 3258 |           whichfile = ((Rectl.yTop - Rectl.yBottom) -
 | 
|---|
 | 3259 |                        ((LONG) pts.y + pAD->lMaxDescender)) / pAD->lMaxHeight;
 | 
|---|
 | 3260 |           if (whichfile > numlines - 1)
 | 
|---|
 | 3261 |             whichfile = numlines - 1;
 | 
|---|
 | 3262 |           whichfile += (pAD->topfile - 1);
 | 
|---|
 | 3263 |           if (whichfile + 1 > pAD->afindexcnt)
 | 
|---|
 | 3264 |             break;
 | 
|---|
 | 3265 |           y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - whichfile : whichfile;
 | 
|---|
 | 3266 |           wascursored = pAD->cursored;
 | 
|---|
 | 3267 |           pAD->cursored = whichfile + 1;
 | 
|---|
 | 3268 |           if (pAD->cursored != wascursored)
 | 
|---|
 | 3269 |             PaintLine(hwnd, pAD->hps, wascursored - 1, pAD->topfile, &Rectl);
 | 
|---|
 | 3270 |           if (y < pAD->afindexcnt) {
 | 
|---|
 | 3271 |             if (msg == WM_BUTTON1CLICK || fUnHilite) {
 | 
|---|
 | 3272 |               if (pAD->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 3273 |                 pAD->afindex[y]->flags &= ~AF_SELECTED;
 | 
|---|
 | 3274 |                 pAD->selected--;
 | 
|---|
 | 3275 |                 pAD->ullSelectedBytes -= pAD->afindex[y]->cbFile;
 | 
|---|
 | 3276 |               }
 | 
|---|
 | 3277 |               else {
 | 
|---|
 | 3278 |                 pAD->afindex[y]->flags |= AF_SELECTED;
 | 
|---|
 | 3279 |                 pAD->selected++;
 | 
|---|
 | 3280 |                 pAD->ullSelectedBytes += pAD->afindex[y]->cbFile;
 | 
|---|
 | 3281 |               }
 | 
|---|
 | 3282 |               PaintLine(hwnd, pAD->hps, whichfile, pAD->topfile, &Rectl);
 | 
|---|
 | 3283 |               PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 3284 |             }
 | 
|---|
 | 3285 |           }
 | 
|---|
 | 3286 |           if (msg == WM_BUTTON1CLICK) {
 | 
|---|
 | 3287 |             if (pAD->lastselected != (ULONG) - 1) {
 | 
|---|
 | 3288 |               if (whichfile > pAD->lastselected)
 | 
|---|
 | 3289 |                 pAD->lastdirection = 1;
 | 
|---|
 | 3290 |               else
 | 
|---|
 | 3291 |                 pAD->lastdirection = 2;
 | 
|---|
 | 3292 |             }
 | 
|---|
 | 3293 |             else
 | 
|---|
 | 3294 |               pAD->lastdirection = 0;
 | 
|---|
 | 3295 |             pAD->lastselected = whichfile;
 | 
|---|
 | 3296 |           }
 | 
|---|
 | 3297 |           else
 | 
|---|
 | 3298 |             DefaultViewKeys(hwnd, pAD->hwndFrame, HWND_DESKTOP, NULL,
 | 
|---|
 | 3299 |                             pAD->afindex[y]->fullname);
 | 
|---|
 | 3300 |         }
 | 
|---|
| [2] | 3301 |       }
 | 
|---|
| [551] | 3302 |       DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 3303 |     }
 | 
|---|
 | 3304 |     break;
 | 
|---|
| [2] | 3305 | 
 | 
|---|
| [551] | 3306 |   case WM_MENUEND:
 | 
|---|
 | 3307 |     if (pAD && (HWND) mp2 == pAD->hwndPopup) {
 | 
|---|
 | 3308 |       WinDestroyWindow(pAD->hwndPopup);
 | 
|---|
 | 3309 |       pAD->hwndPopup = (HWND) 0;
 | 
|---|
 | 3310 |     }
 | 
|---|
 | 3311 |     break;
 | 
|---|
| [2] | 3312 | 
 | 
|---|
| [551] | 3313 |   case WM_CONTEXTMENU:
 | 
|---|
 | 3314 |     if (pAD) {
 | 
|---|
 | 3315 |       if (!pAD->hwndPopup) {
 | 
|---|
| [1158] | 3316 |         pAD->hwndPopup =
 | 
|---|
 | 3317 |           WinLoadMenu(HWND_DESKTOP, FM3ModHandle, SEEALL_POPUP);
 | 
|---|
| [872] | 3318 |         if (pAD->hwndPopup) {
 | 
|---|
| [1158] | 3319 |           WinSetPresParam(pAD->hwndPopup, PP_FONTNAMESIZE,
 | 
|---|
 | 3320 |                           (ULONG) strlen(GetPString(IDS_8HELVTEXT)) + 1,
 | 
|---|
 | 3321 |                           (PVOID) GetPString(IDS_8HELVTEXT));
 | 
|---|
 | 3322 |           SetConditionalCascade(pAD->hwndPopup,
 | 
|---|
 | 3323 |                                 IDM_DELETESUBMENU,
 | 
|---|
 | 3324 |                                 (fDefaultDeletePerm) ?
 | 
|---|
 | 3325 |                                 IDM_PERMDELETE : IDM_DELETE);
 | 
|---|
 | 3326 |           SetConditionalCascade(pAD->hwndPopup, IDM_MOVEMENU, IDM_MOVE);
 | 
|---|
 | 3327 |           SetConditionalCascade(pAD->hwndPopup, IDM_COPYMENU, IDM_COPY);
 | 
|---|
 | 3328 |           SetConditionalCascade(pAD->hwndPopup, IDM_OPENSUBMENU,
 | 
|---|
 | 3329 |                                 IDM_OPENDEFAULT);
 | 
|---|
 | 3330 |           SetConditionalCascade(pAD->hwndMenu, IDM_OBJECTSUBMENU, IDM_SHADOW);
 | 
|---|
 | 3331 |           if (fWorkPlace) {
 | 
|---|
 | 3332 |             WinSendMsg(pAD->hwndPopup, MM_DELETEITEM,
 | 
|---|
 | 3333 |                        MPFROM2SHORT(IDM_OPENSUBMENU, TRUE), MPVOID);
 | 
|---|
 | 3334 |             WinSendMsg(pAD->hwndPopup, MM_DELETEITEM,
 | 
|---|
 | 3335 |                        MPFROM2SHORT(IDM_OBJECTSUBMENU, TRUE), MPVOID);
 | 
|---|
 | 3336 |           }
 | 
|---|
 | 3337 |         }
 | 
|---|
| [551] | 3338 |       }
 | 
|---|
 | 3339 |       if (pAD->hwndPopup) {
 | 
|---|
| [2] | 3340 | 
 | 
|---|
| [1158] | 3341 |         APIRET rc;
 | 
|---|
| [2] | 3342 | 
 | 
|---|
| [1158] | 3343 |         rc = DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN);
 | 
|---|
 | 3344 |         WinEnableMenuItem(pAD->hwndPopup, IDM_EAS, (rc == 0 &&
 | 
|---|
 | 3345 |                                                     pAD->selected != 0));
 | 
|---|
 | 3346 |         WinEnableMenuItem(pAD->hwndPopup, IDM_UUDECODE, (rc == 0 &&
 | 
|---|
 | 3347 |                                                          pAD->selected != 0));
 | 
|---|
 | 3348 |         WinEnableMenuItem(pAD->hwndPopup, IDM_EXTRACT, (rc == 0 &&
 | 
|---|
 | 3349 |                                                         pAD->selected != 0));
 | 
|---|
 | 3350 |         WinEnableMenuItem(pAD->hwndPopup, IDM_ARCHIVE, (rc == 0 &&
 | 
|---|
 | 3351 |                                                         pAD->selected != 0));
 | 
|---|
 | 3352 |         WinEnableMenuItem(pAD->hwndPopup, IDM_MOVEMENU, (rc == 0 &&
 | 
|---|
 | 3353 |                                                          pAD->selected != 0));
 | 
|---|
 | 3354 |         WinEnableMenuItem(pAD->hwndPopup, IDM_COPYMENU, (rc == 0 &&
 | 
|---|
 | 3355 |                                                          pAD->selected != 0));
 | 
|---|
 | 3356 |         WinEnableMenuItem(pAD->hwndPopup, IDM_RENAME, (rc == 0 &&
 | 
|---|
 | 3357 |                                                        pAD->selected != 0));
 | 
|---|
 | 3358 |         WinEnableMenuItem(pAD->hwndPopup, IDM_PRINT, (rc == 0 &&
 | 
|---|
 | 3359 |                                                       pAD->selected != 0));
 | 
|---|
 | 3360 |         WinEnableMenuItem(pAD->hwndPopup, IDM_SUBJECT, (rc == 0 &&
 | 
|---|
 | 3361 |                                                         pAD->selected != 0));
 | 
|---|
 | 3362 |         WinEnableMenuItem(pAD->hwndPopup, IDM_OPENSUBMENU, (rc == 0 &&
 | 
|---|
 | 3363 |                                                             pAD->selected !=
 | 
|---|
 | 3364 |                                                             0));
 | 
|---|
 | 3365 |         WinEnableMenuItem(pAD->hwndPopup, IDM_OBJECTSUBMENU,
 | 
|---|
| [1084] | 3366 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
| [1158] | 3367 |         WinEnableMenuItem(pAD->hwndPopup, IDM_DELETESUBMENU,
 | 
|---|
 | 3368 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3369 |         WinEnableMenuItem(pAD->hwndPopup, IDM_INFO,
 | 
|---|
 | 3370 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3371 |         WinEnableMenuItem(pAD->hwndPopup, IDM_ATTRS,
 | 
|---|
 | 3372 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3373 |         WinEnableMenuItem(pAD->hwndPopup, IDM_COLLECT,
 | 
|---|
 | 3374 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3375 |         WinEnableMenuItem(pAD->hwndPopup, IDM_SAVETOCLIP,
 | 
|---|
 | 3376 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
| [1084] | 3377 |         WinEnableMenuItem(pAD->hwndPopup, IDM_SAVETOCLIPFILENAME,
 | 
|---|
 | 3378 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
| [1158] | 3379 |         WinEnableMenuItem(pAD->hwndPopup, IDM_APPENDTOCLIP,
 | 
|---|
 | 3380 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
| [1084] | 3381 |         WinEnableMenuItem(pAD->hwndPopup, IDM_APPENDTOCLIPFILENAME,
 | 
|---|
| [1158] | 3382 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3383 |         WinEnableMenuItem(pAD->hwndPopup, IDM_SAVETOLIST,
 | 
|---|
 | 3384 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3385 |         WinEnableMenuItem(pAD->hwndPopup, IDM_REMOVE,
 | 
|---|
 | 3386 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3387 |         WinEnableMenuItem(pAD->hwndPopup, IDM_HIDEALL,
 | 
|---|
 | 3388 |                           (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3389 |         WinEnableMenuItem(pAD->hwndPopup, IDM_SELECTALL,
 | 
|---|
 | 3390 |                           (rc == 0 && pAD->afindexcnt != 0));
 | 
|---|
 | 3391 |         WinEnableMenuItem(pAD->hwndPopup, IDM_SELECTMASK,
 | 
|---|
 | 3392 |                           (rc == 0 && pAD->afindexcnt != 0));
 | 
|---|
 | 3393 |         WinEnableMenuItem(pAD->hwndPopup, IDM_DESELECTALL,
 | 
|---|
 | 3394 |                           (rc == 0 && pAD->afindexcnt != 0));
 | 
|---|
 | 3395 |         WinEnableMenuItem(pAD->hwndPopup, IDM_DESELECTMASK,
 | 
|---|
 | 3396 |                           (rc == 0 && pAD->afindexcnt != 0));
 | 
|---|
 | 3397 |         WinEnableMenuItem(pAD->hwndPopup, IDM_INVERT,
 | 
|---|
 | 3398 |                           (rc == 0 && pAD->afindexcnt != 0));
 | 
|---|
 | 3399 |         WinEnableMenuItem(pAD->hwndPopup, IDM_FILTER,
 | 
|---|
 | 3400 |                           (rc == 0 && pAD->afheadcnt != 0));
 | 
|---|
 | 3401 |         if (!rc)
 | 
|---|
 | 3402 |           DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 3403 |         if (WinPopupMenu(hwnd, hwnd, pAD->hwndPopup, SHORT1FROMMP(mp1),
 | 
|---|
 | 3404 |                          SHORT2FROMMP(mp1), 0,
 | 
|---|
 | 3405 |                          PU_HCONSTRAIN | PU_VCONSTRAIN |
 | 
|---|
 | 3406 |                          PU_KEYBOARD | PU_MOUSEBUTTON1))
 | 
|---|
 | 3407 |           CenterOverWindow(pAD->hwndPopup);
 | 
|---|
| [2] | 3408 |       }
 | 
|---|
| [551] | 3409 |     }
 | 
|---|
 | 3410 |     break;
 | 
|---|
| [2] | 3411 | 
 | 
|---|
| [551] | 3412 |   case UM_CONTAINER_FILLED:
 | 
|---|
 | 3413 |     if (pAD) {
 | 
|---|
 | 3414 |       pAD->stopflag = 0;
 | 
|---|
 | 3415 |       pAD->topfile = 1;
 | 
|---|
 | 3416 |       pAD->cursored = 1;
 | 
|---|
 | 3417 |       pAD->multiplier = 1;
 | 
|---|
| [943] | 3418 |       if (!pAD->afindexcnt) {
 | 
|---|
| [1158] | 3419 |         DosBeep(250, 50);
 | 
|---|
 | 3420 |         PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
| [2] | 3421 |       }
 | 
|---|
| [551] | 3422 |       else {
 | 
|---|
| [1158] | 3423 |         DosBeep(1000, 25);
 | 
|---|
 | 3424 |         WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 3425 |         PostMsg(hwnd, UM_SETUP3, MPVOID, MPVOID);
 | 
|---|
| [551] | 3426 |       }
 | 
|---|
 | 3427 |       WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0,
 | 
|---|
| [1158] | 3428 |                       SWP_SHOW | SWP_RESTORE | SWP_ACTIVATE | SWP_ZORDER);
 | 
|---|
| [551] | 3429 |     }
 | 
|---|
 | 3430 |     return 0;
 | 
|---|
| [2] | 3431 | 
 | 
|---|
| [551] | 3432 |   case WM_ERASEBACKGROUND:
 | 
|---|
 | 3433 |     WinFillRect((HPS) mp1, (PRECTL) mp2,
 | 
|---|
| [1158] | 3434 |                 standardcolors[Colors[COLORS_NORMALBACK]]);
 | 
|---|
| [551] | 3435 |     return 0;
 | 
|---|
| [2] | 3436 | 
 | 
|---|
| [551] | 3437 |   case WM_PAINT:
 | 
|---|
 | 3438 |     // fprintf(stderr,"Seeall: WM_PAINT\n");
 | 
|---|
 | 3439 |     if (pAD) {
 | 
|---|
| [2] | 3440 | 
 | 
|---|
| [551] | 3441 |       HPS hpsp;
 | 
|---|
 | 3442 |       RECTL Rectl;
 | 
|---|
 | 3443 |       POINTL ptl;
 | 
|---|
 | 3444 |       register ULONG x;
 | 
|---|
 | 3445 |       ULONG y, len, numlines;
 | 
|---|
| [897] | 3446 |       CHAR szBuff[CCHMAXPATH + 80], szCmmaFmtFileSize[81];
 | 
|---|
| [551] | 3447 |       BOOL inverted, hidsys, reado, wascursored;
 | 
|---|
| [2] | 3448 | 
 | 
|---|
| [551] | 3449 |       hpsp = WinBeginPaint(hwnd, pAD->hps, &Rectl);
 | 
|---|
 | 3450 |       WinFillRect(hpsp, &Rectl, standardcolors[Colors[COLORS_NORMALBACK]]);
 | 
|---|
 | 3451 |       if (!pAD->stopflag &&
 | 
|---|
| [1158] | 3452 |           !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
 | 3453 |         WinQueryWindowRect(hwnd, &Rectl);
 | 
|---|
 | 3454 |         numlines = NumLines(&Rectl, pAD);
 | 
|---|
 | 3455 |         if (pAD->afindexcnt && numlines) {
 | 
|---|
 | 3456 |           if (pAD->topfile > (pAD->afindexcnt + 1) - numlines)
 | 
|---|
 | 3457 |             pAD->topfile = (pAD->afindexcnt + 1) - numlines;
 | 
|---|
 | 3458 |           if (pAD->topfile > pAD->afindexcnt)
 | 
|---|
 | 3459 |             pAD->topfile = 1;
 | 
|---|
 | 3460 |           if (!pAD->topfile)
 | 
|---|
 | 3461 |             pAD->topfile = 1;
 | 
|---|
 | 3462 |           if (pAD->cursored < pAD->topfile)
 | 
|---|
 | 3463 |             pAD->cursored = pAD->topfile;
 | 
|---|
 | 3464 |           else if (pAD->cursored > (pAD->topfile + numlines) - 1)
 | 
|---|
 | 3465 |             pAD->cursored = (pAD->topfile + numlines) - 1;
 | 
|---|
 | 3466 |           if (pAD->cursored > pAD->afindexcnt)
 | 
|---|
 | 3467 |             pAD->cursored = pAD->afindexcnt;
 | 
|---|
 | 3468 |         }
 | 
|---|
 | 3469 |         else
 | 
|---|
 | 3470 |           pAD->topfile = pAD->cursored = 1;
 | 
|---|
 | 3471 |         if (numlines && pAD->afindexcnt) {
 | 
|---|
 | 3472 |           GpiSetBackMix(hpsp, BM_OVERPAINT);
 | 
|---|
 | 3473 |           wascursored = TRUE;
 | 
|---|
 | 3474 |           for (x = pAD->topfile - 1; x < pAD->afindexcnt; x++) {
 | 
|---|
 | 3475 |             ptl.x = pAD->horzscroll;
 | 
|---|
 | 3476 |             if (wascursored) {          /* reestablish normal colors */
 | 
|---|
 | 3477 |               GpiSetColor(pAD->hps,
 | 
|---|
 | 3478 |                           standardcolors[Colors[COLORS_NORMALFORE]]);
 | 
|---|
 | 3479 |               GpiSetBackColor(pAD->hps,
 | 
|---|
 | 3480 |                               standardcolors[Colors[COLORS_NORMALBACK]]);
 | 
|---|
 | 3481 |               wascursored = inverted = hidsys = reado = FALSE;
 | 
|---|
 | 3482 |             }
 | 
|---|
 | 3483 |             if (x == pAD->cursored - 1)
 | 
|---|
 | 3484 |               wascursored = TRUE;
 | 
|---|
 | 3485 |             y = (pAD->invertsort) ? (pAD->afindexcnt - 1) - x : x;
 | 
|---|
 | 3486 |             ptl.y = (Rectl.yTop -
 | 
|---|
 | 3487 |                      (pAD->lMaxHeight * (((x + 1) - pAD->topfile) + 1)));
 | 
|---|
 | 3488 |             if (ptl.y - pAD->lMaxDescender <= 0)
 | 
|---|
 | 3489 |               break;
 | 
|---|
 | 3490 |             if (pAD->afindex[y]->flags & AF_SELECTED) {
 | 
|---|
 | 3491 |               if (!inverted) {
 | 
|---|
 | 3492 |                 GpiSetColor(pAD->hps,
 | 
|---|
 | 3493 |                             standardcolors[Colors
 | 
|---|
 | 3494 |                                            [COLORS_SELECTEDNORMALFORE]]);
 | 
|---|
 | 3495 |                 GpiSetBackColor(pAD->hps,
 | 
|---|
 | 3496 |                                 (wascursored) ?
 | 
|---|
 | 3497 |                                 standardcolors[Colors
 | 
|---|
 | 3498 |                                                [COLORS_CURSOREDSELECTEDBACK]]
 | 
|---|
 | 3499 |                                 :
 | 
|---|
 | 3500 |                                 standardcolors[Colors[COLORS_SELECTEDBACK]]);
 | 
|---|
 | 3501 |                 inverted = TRUE;
 | 
|---|
 | 3502 |               }
 | 
|---|
 | 3503 |             }
 | 
|---|
 | 3504 |             else if (inverted ||
 | 
|---|
 | 3505 |                      ((pAD->afindex[y]->attrFile &
 | 
|---|
 | 3506 |                        (FILE_SYSTEM | FILE_HIDDEN)) != 0) != hidsys ||
 | 
|---|
 | 3507 |                      ((pAD->afindex[y]->attrFile & FILE_READONLY) != 0) !=
 | 
|---|
 | 3508 |                      reado) {
 | 
|---|
 | 3509 |               if (pAD->afindex[y]->attrFile & (FILE_SYSTEM | FILE_HIDDEN)) {
 | 
|---|
 | 3510 |                 GpiSetColor(pAD->hps,
 | 
|---|
 | 3511 |                             standardcolors[Colors[COLORS_SYSTEMFORE]]);
 | 
|---|
 | 3512 |                 hidsys = TRUE;
 | 
|---|
 | 3513 |               }
 | 
|---|
 | 3514 |               else if ((pAD->afindex[y]->attrFile & FILE_READONLY) != 0) {
 | 
|---|
 | 3515 |                 GpiSetColor(pAD->hps,
 | 
|---|
 | 3516 |                             standardcolors[Colors[COLORS_READONLYFORE]]);
 | 
|---|
 | 3517 |                 reado = TRUE;
 | 
|---|
 | 3518 |               }
 | 
|---|
 | 3519 |               else
 | 
|---|
 | 3520 |                 GpiSetColor(pAD->hps,
 | 
|---|
 | 3521 |                             standardcolors[Colors[COLORS_NORMALFORE]]);
 | 
|---|
 | 3522 |               GpiSetBackColor(pAD->hps,
 | 
|---|
 | 3523 |                               (wascursored) ?
 | 
|---|
 | 3524 |                               standardcolors[Colors
 | 
|---|
 | 3525 |                                              [COLORS_CURSOREDNORMALBACK]] :
 | 
|---|
 | 3526 |                               standardcolors[Colors[COLORS_NORMALBACK]]);
 | 
|---|
 | 3527 |               inverted = FALSE;
 | 
|---|
 | 3528 |             }
 | 
|---|
 | 3529 |             else if (wascursored)
 | 
|---|
 | 3530 |               GpiSetBackColor(pAD->hps,
 | 
|---|
 | 3531 |                               standardcolors[Colors
 | 
|---|
 | 3532 |                                              [COLORS_CURSOREDNORMALBACK]]);
 | 
|---|
| [897] | 3533 |             CommaFmtULL(szCmmaFmtFileSize,
 | 
|---|
 | 3534 |                         sizeof(szCmmaFmtFileSize), pAD->afindex[y]->cbFile, ' ');
 | 
|---|
| [1158] | 3535 |             len =
 | 
|---|
 | 3536 |               sprintf(szBuff,
 | 
|---|
 | 3537 |                       "%c%-*.*s  %-12s  %c%c%c%c%c  %04u/%02u/%02u %02u:%02u:%02u ",
 | 
|---|
 | 3538 |                       wascursored ? '>' : ' ',
 | 
|---|
 | 3539 |                       pAD->fullnames ? pAD->longestw : pAD->longest,
 | 
|---|
 | 3540 |                       pAD->fullnames ? pAD->longestw : pAD->longest,
 | 
|---|
 | 3541 |                       (pAD->fullnames) ? pAD->afindex[y]->fullname : pAD->
 | 
|---|
 | 3542 |                       afindex[y]->filename, szCmmaFmtFileSize,
 | 
|---|
 | 3543 |                       "-A"[((pAD->afindex[y]->attrFile & FILE_ARCHIVED) !=
 | 
|---|
 | 3544 |                             0)],
 | 
|---|
 | 3545 |                       "-R"[((pAD->afindex[y]->attrFile & FILE_READONLY) !=
 | 
|---|
 | 3546 |                             0)],
 | 
|---|
 | 3547 |                       "-H"[((pAD->afindex[y]->attrFile & FILE_HIDDEN) != 0)],
 | 
|---|
 | 3548 |                       "-S"[((pAD->afindex[y]->attrFile & FILE_SYSTEM) != 0)],
 | 
|---|
 | 3549 |                       "-D"[((pAD->afindex[y]->attrFile & FILE_DIRECTORY) !=
 | 
|---|
 | 3550 |                             0)], pAD->afindex[y]->date.year + 1980,
 | 
|---|
 | 3551 |                       pAD->afindex[y]->date.month, pAD->afindex[y]->date.day,
 | 
|---|
 | 3552 |                       pAD->afindex[y]->time.hours,
 | 
|---|
 | 3553 |                       pAD->afindex[y]->time.minutes,
 | 
|---|
 | 3554 |                       pAD->afindex[y]->time.twosecs * 2);
 | 
|---|
 | 3555 |             GpiCharStringAt(hpsp, &ptl, len, szBuff);
 | 
|---|
 | 3556 |             GpiQueryCurrentPosition(hpsp, &ptl);
 | 
|---|
 | 3557 |             if (ptl.x + abs(pAD->horzscroll) > pAD->maxx) {
 | 
|---|
 | 3558 |               pAD->maxx = ptl.x + abs(pAD->horzscroll);
 | 
|---|
 | 3559 |               WinSendMsg(pAD->hhscroll, SBM_SETTHUMBSIZE,
 | 
|---|
 | 3560 |                          MPFROM2SHORT((SHORT) Rectl.xRight,
 | 
|---|
 | 3561 |                                       (SHORT) pAD->maxx), MPVOID);
 | 
|---|
 | 3562 |             }
 | 
|---|
 | 3563 |           }
 | 
|---|
 | 3564 |         }
 | 
|---|
 | 3565 |         DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
| [2] | 3566 |       }
 | 
|---|
| [551] | 3567 |       WinEndPaint(hpsp);
 | 
|---|
 | 3568 |       PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 3569 |       if (!pAD->stopflag)
 | 
|---|
| [1158] | 3570 |         WinSendMsg(pAD->hvscroll, SBM_SETSCROLLBAR,
 | 
|---|
 | 3571 |                    MPFROMSHORT((SHORT) (pAD->topfile / pAD->multiplier)),
 | 
|---|
 | 3572 |                    MPFROM2SHORT(1,
 | 
|---|
 | 3573 |                                 (SHORT) (pAD->afindexcnt / pAD->multiplier) -
 | 
|---|
 | 3574 |                                 (numlines - 1)));
 | 
|---|
| [551] | 3575 |       WinSendMsg(pAD->hhscroll, SBM_SETSCROLLBAR,
 | 
|---|
| [1158] | 3576 |                  MPFROMSHORT((SHORT) abs(pAD->horzscroll)),
 | 
|---|
 | 3577 |                  MPFROM2SHORT(0, (SHORT) (pAD->maxx - Rectl.xRight)));
 | 
|---|
| [551] | 3578 |       WinSendMsg(pAD->hhscroll, SBM_SETTHUMBSIZE,
 | 
|---|
| [1158] | 3579 |                  MPFROM2SHORT((SHORT) Rectl.xRight, (SHORT) pAD->maxx),
 | 
|---|
 | 3580 |                  MPVOID);
 | 
|---|
| [551] | 3581 |     }
 | 
|---|
 | 3582 |     break;
 | 
|---|
| [2] | 3583 | 
 | 
|---|
| [551] | 3584 |   case WM_HSCROLL:
 | 
|---|
 | 3585 |     {
 | 
|---|
 | 3586 |       RECTL rectl;
 | 
|---|
 | 3587 |       BOOL invalidate = TRUE;
 | 
|---|
| [2] | 3588 | 
 | 
|---|
| [551] | 3589 |       WinQueryWindowRect(hwnd, &rectl);
 | 
|---|
 | 3590 |       switch (SHORT2FROMMP(mp2)) {
 | 
|---|
 | 3591 |       case SB_PAGERIGHT:
 | 
|---|
| [1158] | 3592 |         if (abs(pAD->horzscroll) < pAD->maxx - rectl.xRight) {
 | 
|---|
 | 3593 |           pAD->horzscroll -= rectl.xRight;
 | 
|---|
 | 3594 |           if (abs(pAD->horzscroll) > pAD->maxx - rectl.xRight)
 | 
|---|
 | 3595 |             pAD->horzscroll = -(pAD->maxx - rectl.xRight);
 | 
|---|
 | 3596 |         }
 | 
|---|
 | 3597 |         break;
 | 
|---|
| [2] | 3598 | 
 | 
|---|
| [551] | 3599 |       case SB_PAGELEFT:
 | 
|---|
| [1158] | 3600 |         if (pAD->horzscroll < 0) {
 | 
|---|
 | 3601 |           pAD->horzscroll += rectl.xRight;
 | 
|---|
 | 3602 |           if (pAD->horzscroll > 0)
 | 
|---|
 | 3603 |             pAD->horzscroll = 0;
 | 
|---|
 | 3604 |         }
 | 
|---|
 | 3605 |         break;
 | 
|---|
| [2] | 3606 | 
 | 
|---|
| [551] | 3607 |       case SB_LINERIGHT:
 | 
|---|
| [1158] | 3608 |         if (abs(pAD->horzscroll) < pAD->maxx - rectl.xRight)
 | 
|---|
 | 3609 |           pAD->horzscroll -= pAD->fattrs.lAveCharWidth;
 | 
|---|
 | 3610 |         break;
 | 
|---|
| [2] | 3611 | 
 | 
|---|
| [551] | 3612 |       case SB_LINELEFT:
 | 
|---|
| [1158] | 3613 |         if (pAD->horzscroll < 0)
 | 
|---|
 | 3614 |           pAD->horzscroll += pAD->fattrs.lAveCharWidth;
 | 
|---|
 | 3615 |         break;
 | 
|---|
| [2] | 3616 | 
 | 
|---|
| [551] | 3617 |       case SB_SLIDERTRACK:
 | 
|---|
| [1158] | 3618 |         pAD->horzscroll = SHORT1FROMMP(mp2);
 | 
|---|
 | 3619 |         pAD->horzscroll = -(pAD->horzscroll);
 | 
|---|
 | 3620 |         if (pAD->horzscroll > 0)
 | 
|---|
 | 3621 |           pAD->horzscroll = 0;
 | 
|---|
 | 3622 |         if (abs(pAD->horzscroll) > pAD->maxx - rectl.xRight)
 | 
|---|
 | 3623 |           pAD->horzscroll = -(pAD->maxx - rectl.xRight);
 | 
|---|
 | 3624 |         break;
 | 
|---|
| [2] | 3625 | 
 | 
|---|
| [551] | 3626 |       default:
 | 
|---|
| [1158] | 3627 |         invalidate = FALSE;
 | 
|---|
 | 3628 |         break;
 | 
|---|
| [2] | 3629 |       }
 | 
|---|
| [551] | 3630 |       if (invalidate)
 | 
|---|
| [1158] | 3631 |         WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
| [551] | 3632 |     }
 | 
|---|
 | 3633 |     break;
 | 
|---|
| [2] | 3634 | 
 | 
|---|
| [551] | 3635 |   case WM_VSCROLL:
 | 
|---|
| [2] | 3636 | // fprintf(stderr,"Seeall: WM_VSCROLL\n");
 | 
|---|
| [551] | 3637 |     if (pAD && !pAD->stopflag &&
 | 
|---|
| [1158] | 3638 |         !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
| [2] | 3639 | 
 | 
|---|
| [551] | 3640 |       ULONG numlines, wascursored;
 | 
|---|
 | 3641 |       RECTL rcl;
 | 
|---|
| [2] | 3642 | 
 | 
|---|
| [943] | 3643 |       if (pAD->afindexcnt) {
 | 
|---|
| [1158] | 3644 |         WinQueryWindowRect(hwnd, &rcl);
 | 
|---|
 | 3645 |         numlines = NumLines(&rcl, pAD);
 | 
|---|
 | 3646 |         if (numlines) {
 | 
|---|
 | 3647 |           wascursored = pAD->cursored;
 | 
|---|
 | 3648 |           switch (SHORT2FROMMP(mp2)) {
 | 
|---|
 | 3649 |           case SB_PAGEUP:
 | 
|---|
 | 3650 |             if (pAD->topfile > 1) {
 | 
|---|
 | 3651 |               pAD->topfile -= numlines;
 | 
|---|
 | 3652 |               if (pAD->topfile > pAD->afindexcnt ||
 | 
|---|
 | 3653 |                   pAD->topfile > (pAD->afindexcnt + 1) - numlines)
 | 
|---|
 | 3654 |                 pAD->topfile = 1;
 | 
|---|
 | 3655 |               if (pAD->cursored > pAD->topfile + numlines)
 | 
|---|
 | 3656 |                 pAD->cursored = pAD->topfile + numlines;
 | 
|---|
 | 3657 |               if (pAD->cursored > pAD->afindexcnt)
 | 
|---|
 | 3658 |                 pAD->cursored = pAD->afindexcnt;
 | 
|---|
 | 3659 |               WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 3660 |             }
 | 
|---|
 | 3661 |             break;
 | 
|---|
 | 3662 |           case SB_PAGEDOWN:
 | 
|---|
 | 3663 |             if (pAD->topfile <= pAD->afindexcnt - numlines) {
 | 
|---|
 | 3664 |               pAD->topfile += numlines;
 | 
|---|
 | 3665 |               if (pAD->topfile > (pAD->afindexcnt + 1) - numlines)
 | 
|---|
 | 3666 |                 pAD->topfile = (pAD->afindexcnt + 1) - numlines;
 | 
|---|
 | 3667 |               if (pAD->cursored < pAD->topfile)
 | 
|---|
 | 3668 |                 pAD->cursored = pAD->topfile;
 | 
|---|
 | 3669 |               if (pAD->cursored > (pAD->topfile + numlines) - 1)
 | 
|---|
 | 3670 |                 pAD->cursored = (pAD->topfile + numlines) - 1;
 | 
|---|
 | 3671 |               if (pAD->cursored > pAD->afindexcnt)
 | 
|---|
 | 3672 |                 pAD->cursored = pAD->afindexcnt;
 | 
|---|
 | 3673 |               WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 3674 |             }
 | 
|---|
 | 3675 |             break;
 | 
|---|
 | 3676 |           case SB_LINEDOWN:
 | 
|---|
 | 3677 |             if (pAD->topfile <= pAD->afindexcnt - numlines) {
 | 
|---|
| [2] | 3678 | 
 | 
|---|
| [1158] | 3679 |               RECTL Rectl, iRectl;
 | 
|---|
| [2] | 3680 | 
 | 
|---|
| [1158] | 3681 |               pAD->topfile++;
 | 
|---|
 | 3682 |               if (pAD->cursored < pAD->topfile)
 | 
|---|
 | 3683 |                 pAD->cursored = pAD->topfile;
 | 
|---|
 | 3684 |               else if (pAD->cursored > (pAD->topfile + numlines) - 1)
 | 
|---|
 | 3685 |                 pAD->cursored = (pAD->topfile + numlines) - 1;
 | 
|---|
 | 3686 |               if (pAD->cursored > pAD->afindexcnt)
 | 
|---|
 | 3687 |                 pAD->cursored = pAD->afindexcnt;
 | 
|---|
 | 3688 |               WinQueryWindowRect(hwnd, &Rectl);
 | 
|---|
 | 3689 |               WinScrollWindow(hwnd, 0, pAD->lMaxHeight,
 | 
|---|
 | 3690 |                               NULL, NULL, NULLHANDLE, &iRectl, 0);
 | 
|---|
 | 3691 |               WinFillRect(pAD->hps, &iRectl,
 | 
|---|
 | 3692 |                           standardcolors[Colors[COLORS_NORMALBACK]]);
 | 
|---|
 | 3693 |               PaintLine(hwnd, pAD->hps, (pAD->topfile + numlines) - 2,
 | 
|---|
 | 3694 |                         pAD->topfile, &Rectl);
 | 
|---|
 | 3695 |               if (pAD->cursored != pAD->topfile + numlines)
 | 
|---|
 | 3696 |                 PaintLine(hwnd, pAD->hps, pAD->cursored - 1, pAD->topfile,
 | 
|---|
 | 3697 |                           &Rectl);
 | 
|---|
 | 3698 |               if (wascursored != pAD->cursored
 | 
|---|
 | 3699 |                   && wascursored < pAD->topfile + numlines
 | 
|---|
 | 3700 |                   && wascursored >= pAD->topfile)
 | 
|---|
 | 3701 |                 PaintLine(hwnd, pAD->hps, wascursored - 1, pAD->topfile,
 | 
|---|
 | 3702 |                           &Rectl);
 | 
|---|
 | 3703 |               if (wascursored != pAD->cursored)
 | 
|---|
 | 3704 |                 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 3705 |               WinSendMsg(pAD->hhscroll, SBM_SETSCROLLBAR,
 | 
|---|
 | 3706 |                          MPFROMSHORT((SHORT) abs(pAD->horzscroll)),
 | 
|---|
 | 3707 |                          MPFROM2SHORT(0, (SHORT) (pAD->maxx - Rectl.xRight)));
 | 
|---|
 | 3708 |               WinSendMsg(pAD->hvscroll, SBM_SETSCROLLBAR,
 | 
|---|
 | 3709 |                          MPFROMSHORT((SHORT) (pAD->topfile /
 | 
|---|
 | 3710 |                                               pAD->multiplier)),
 | 
|---|
 | 3711 |                          MPFROM2SHORT(1, (SHORT) (pAD->afindexcnt /
 | 
|---|
 | 3712 |                                                   pAD->multiplier) -
 | 
|---|
 | 3713 |                                       (numlines - 1)));
 | 
|---|
 | 3714 |             }
 | 
|---|
 | 3715 |             break;
 | 
|---|
 | 3716 |           case SB_LINEUP:
 | 
|---|
 | 3717 |             if (pAD->topfile > 1) {
 | 
|---|
| [2] | 3718 | 
 | 
|---|
| [1158] | 3719 |               RECTL Rectl, iRectl;
 | 
|---|
| [2] | 3720 | 
 | 
|---|
| [1158] | 3721 |               pAD->topfile--;
 | 
|---|
 | 3722 |               if (pAD->cursored < pAD->topfile)
 | 
|---|
 | 3723 |                 pAD->cursored = pAD->topfile;
 | 
|---|
 | 3724 |               else if (pAD->cursored > (pAD->topfile + numlines) - 1)
 | 
|---|
 | 3725 |                 pAD->cursored = (pAD->topfile + numlines) - 1;
 | 
|---|
 | 3726 |               if (pAD->cursored > pAD->afindexcnt)
 | 
|---|
 | 3727 |                 pAD->cursored = pAD->afindexcnt;
 | 
|---|
 | 3728 |               WinQueryWindowRect(hwnd, &Rectl);
 | 
|---|
 | 3729 |               WinScrollWindow(hwnd, 0, -pAD->lMaxHeight,
 | 
|---|
 | 3730 |                               NULL, NULL, NULLHANDLE, &iRectl, 0);
 | 
|---|
 | 3731 |               WinFillRect(pAD->hps, &iRectl,
 | 
|---|
 | 3732 |                           standardcolors[Colors[COLORS_NORMALBACK]]);
 | 
|---|
 | 3733 |               iRectl = Rectl;
 | 
|---|
 | 3734 |               iRectl.yTop -= ((numlines * pAD->lMaxHeight) +
 | 
|---|
 | 3735 |                               pAD->lMaxDescender);
 | 
|---|
 | 3736 |               WinFillRect(pAD->hps, &iRectl,
 | 
|---|
 | 3737 |                           standardcolors[pAD->aulColors[COLORS_NORMALBACK]]);
 | 
|---|
 | 3738 |               PaintLine(hwnd, pAD->hps, pAD->topfile - 1, pAD->topfile,
 | 
|---|
 | 3739 |                         &Rectl);
 | 
|---|
 | 3740 |               if (pAD->cursored != pAD->topfile)
 | 
|---|
 | 3741 |                 PaintLine(hwnd, pAD->hps, pAD->cursored - 1, pAD->topfile,
 | 
|---|
 | 3742 |                           &Rectl);
 | 
|---|
 | 3743 |               if (pAD->cursored != wascursored && wascursored >= pAD->topfile
 | 
|---|
 | 3744 |                   && wascursored < pAD->topfile + numlines)
 | 
|---|
 | 3745 |                 PaintLine(hwnd, pAD->hps, wascursored - 1, pAD->topfile,
 | 
|---|
 | 3746 |                           &Rectl);
 | 
|---|
 | 3747 |               if (pAD->cursored != wascursored)
 | 
|---|
 | 3748 |                 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 3749 |               WinSendMsg(pAD->hhscroll, SBM_SETSCROLLBAR,
 | 
|---|
 | 3750 |                          MPFROMSHORT((SHORT) abs(pAD->horzscroll)),
 | 
|---|
 | 3751 |                          MPFROM2SHORT(0, (SHORT) (pAD->maxx - Rectl.xRight)));
 | 
|---|
 | 3752 |               WinSendMsg(pAD->hvscroll, SBM_SETSCROLLBAR,
 | 
|---|
 | 3753 |                          MPFROMSHORT((SHORT) (pAD->topfile /
 | 
|---|
 | 3754 |                                               pAD->multiplier)),
 | 
|---|
 | 3755 |                          MPFROM2SHORT(1, (SHORT) (pAD->afindexcnt /
 | 
|---|
 | 3756 |                                                   pAD->multiplier) -
 | 
|---|
 | 3757 |                                       (numlines - 1)));
 | 
|---|
 | 3758 |             }
 | 
|---|
 | 3759 |             break;
 | 
|---|
 | 3760 |           case SB_SLIDERTRACK:
 | 
|---|
 | 3761 |             if ((SHORT1FROMMP(mp2) >= 1) ||
 | 
|---|
 | 3762 |                 (SHORT1FROMMP(mp2)) <= pAD->afindexcnt) {
 | 
|---|
 | 3763 |               pAD->topfile = (ULONG) SHORT1FROMMP(mp2) * pAD->multiplier;
 | 
|---|
 | 3764 |               if (pAD->topfile > (pAD->afindexcnt + 1) - numlines)
 | 
|---|
 | 3765 |                 pAD->topfile = (pAD->afindexcnt + 1) - numlines;
 | 
|---|
 | 3766 |               if (!pAD->topfile)
 | 
|---|
 | 3767 |                 pAD->topfile = 1;
 | 
|---|
 | 3768 |               if (pAD->cursored < pAD->topfile)
 | 
|---|
 | 3769 |                 pAD->cursored = pAD->topfile;
 | 
|---|
 | 3770 |               else if (pAD->cursored > pAD->topfile + numlines)
 | 
|---|
 | 3771 |                 pAD->cursored = pAD->topfile + numlines;
 | 
|---|
 | 3772 |               if (pAD->cursored > pAD->afindexcnt)
 | 
|---|
 | 3773 |                 pAD->cursored = pAD->afindexcnt;
 | 
|---|
 | 3774 |               WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 3775 |             }
 | 
|---|
 | 3776 |             else
 | 
|---|
 | 3777 |               WinAlarm(HWND_DESKTOP, WA_NOTE);
 | 
|---|
 | 3778 |             break;
 | 
|---|
 | 3779 |           }
 | 
|---|
 | 3780 |         }
 | 
|---|
| [2] | 3781 |       }
 | 
|---|
| [551] | 3782 |       DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 3783 |     }
 | 
|---|
 | 3784 |     break;
 | 
|---|
| [2] | 3785 | 
 | 
|---|
| [551] | 3786 |   case WM_INITMENU:
 | 
|---|
 | 3787 |     if (pAD) {
 | 
|---|
 | 3788 |       switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 3789 |       case IDM_FILESMENU:
 | 
|---|
| [1158] | 3790 |         {
 | 
|---|
 | 3791 |           APIRET rc;
 | 
|---|
| [2] | 3792 | 
 | 
|---|
| [1158] | 3793 |           rc = DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN);
 | 
|---|
 | 3794 |           WinEnableMenuItem((HWND) mp2, IDM_DUPES, (rc == 0));
 | 
|---|
 | 3795 |           WinEnableMenuItem((HWND) mp2, IDM_COLLECT, (rc == 0 &&
 | 
|---|
 | 3796 |                                                       pAD->selected != 0));
 | 
|---|
 | 3797 |           WinEnableMenuItem((HWND) mp2, IDM_SAVETOCLIP, (rc == 0 &&
 | 
|---|
| [1084] | 3798 |                                                          pAD->selected != 0));
 | 
|---|
 | 3799 |           WinEnableMenuItem((HWND) mp2, IDM_SAVETOCLIPFILENAME,
 | 
|---|
| [1158] | 3800 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
| [1084] | 3801 |           WinEnableMenuItem((HWND) mp2, IDM_APPENDTOCLIP,
 | 
|---|
 | 3802 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3803 |           WinEnableMenuItem((HWND) mp2, IDM_APPENDTOCLIPFILENAME,
 | 
|---|
| [1158] | 3804 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3805 |           WinEnableMenuItem((HWND) mp2, IDM_SAVETOLIST,
 | 
|---|
 | 3806 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3807 |           WinEnableMenuItem((HWND) mp2, IDM_REMOVE,
 | 
|---|
 | 3808 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3809 |           WinEnableMenuItem((HWND) mp2, IDM_HIDEALL,
 | 
|---|
 | 3810 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3811 |           WinEnableMenuItem((HWND) mp2, IDM_DELETESUBMENU,
 | 
|---|
 | 3812 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3813 |           WinEnableMenuItem((HWND) mp2, IDM_INFO,
 | 
|---|
 | 3814 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3815 |           WinEnableMenuItem((HWND) mp2, IDM_ATTRS,
 | 
|---|
 | 3816 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3817 |           WinEnableMenuItem((HWND) mp2, IDM_EAS,
 | 
|---|
 | 3818 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3819 |           WinEnableMenuItem((HWND) mp2, IDM_UUDECODE,
 | 
|---|
 | 3820 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3821 |           WinEnableMenuItem((HWND) mp2, IDM_EXTRACT,
 | 
|---|
 | 3822 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3823 |           WinEnableMenuItem((HWND) mp2, IDM_ARCHIVE,
 | 
|---|
 | 3824 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3825 |           WinEnableMenuItem((HWND) mp2, IDM_MOVEMENU,
 | 
|---|
 | 3826 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3827 |           WinEnableMenuItem((HWND) mp2, IDM_COPYMENU,
 | 
|---|
 | 3828 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3829 |           WinEnableMenuItem((HWND) mp2, IDM_RENAME,
 | 
|---|
 | 3830 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3831 |           WinEnableMenuItem((HWND) mp2, IDM_PRINT,
 | 
|---|
 | 3832 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3833 |           WinEnableMenuItem((HWND) mp2, IDM_SUBJECT,
 | 
|---|
 | 3834 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3835 |           WinEnableMenuItem((HWND) mp2, IDM_OPENSUBMENU,
 | 
|---|
 | 3836 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3837 |           WinEnableMenuItem((HWND) mp2, IDM_OBJECTSUBMENU,
 | 
|---|
 | 3838 |                             (rc == 0 && pAD->selected != 0));
 | 
|---|
 | 3839 |           if (!rc)
 | 
|---|
 | 3840 |             DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 3841 |         }
 | 
|---|
 | 3842 |         break;
 | 
|---|
| [2] | 3843 | 
 | 
|---|
| [551] | 3844 |       case IDM_SELECTSUBMENU:
 | 
|---|
| [1158] | 3845 |         {
 | 
|---|
 | 3846 |           APIRET rc;
 | 
|---|
| [2] | 3847 | 
 | 
|---|
| [1158] | 3848 |           rc = DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN);
 | 
|---|
 | 3849 |           WinEnableMenuItem((HWND) mp2, IDM_SELECTALL, (rc == 0 &&
 | 
|---|
 | 3850 |                                                         pAD->afindexcnt != 0 &&
 | 
|---|
 | 3851 |                                                         (pAD->afindexcnt !=
 | 
|---|
 | 3852 |                                                          pAD->selected ||
 | 
|---|
 | 3853 |                                                          !pAD->selected)));
 | 
|---|
 | 3854 |           WinEnableMenuItem((HWND) mp2, IDM_SELECTMASK, (rc == 0 &&
 | 
|---|
 | 3855 |                                                          pAD->afindexcnt != 0 &&
 | 
|---|
 | 3856 |                                                          (pAD->afindexcnt !=
 | 
|---|
 | 3857 |                                                           pAD->selected ||
 | 
|---|
 | 3858 |                                                           !pAD->selected)));
 | 
|---|
 | 3859 |           WinEnableMenuItem((HWND) mp2, IDM_DESELECTALL, (rc == 0 &&
 | 
|---|
 | 3860 |                                                           pAD->afindexcnt != 0
 | 
|---|
 | 3861 |                                                           && pAD->selected));
 | 
|---|
 | 3862 |           WinEnableMenuItem((HWND) mp2, IDM_DESELECTMASK,
 | 
|---|
 | 3863 |                             (rc == 0 && pAD->afindexcnt != 0) && pAD->selected);
 | 
|---|
 | 3864 |           WinEnableMenuItem((HWND) mp2, IDM_INVERT,
 | 
|---|
 | 3865 |                             (rc == 0 && pAD->afindexcnt != 0));
 | 
|---|
 | 3866 |           if (!rc)
 | 
|---|
 | 3867 |             DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 3868 |         }
 | 
|---|
 | 3869 |         break;
 | 
|---|
| [2] | 3870 | 
 | 
|---|
| [551] | 3871 |       case IDM_SORTSUBMENU:
 | 
|---|
| [1158] | 3872 |         {
 | 
|---|
 | 3873 |           APIRET rc;
 | 
|---|
| [2] | 3874 | 
 | 
|---|
| [1158] | 3875 |           rc = DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN);
 | 
|---|
 | 3876 |           WinEnableMenuItem((HWND) mp2, IDM_SORTNAME, (rc == 0));
 | 
|---|
 | 3877 |           WinEnableMenuItem((HWND) mp2, IDM_SORTEASIZE, (rc == 0));
 | 
|---|
 | 3878 |           WinEnableMenuItem((HWND) mp2, IDM_SORTSIZE, (rc == 0));
 | 
|---|
 | 3879 |           WinEnableMenuItem((HWND) mp2, IDM_SORTLWDATE, (rc == 0));
 | 
|---|
 | 3880 |           WinEnableMenuItem((HWND) mp2, IDM_SORTFILENAME, (rc == 0));
 | 
|---|
 | 3881 |           WinEnableMenuItem((HWND) mp2, IDM_SORTFIRST, (rc == 0));
 | 
|---|
 | 3882 |           if (!rc)
 | 
|---|
 | 3883 |             DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 3884 |         }
 | 
|---|
 | 3885 |         WinCheckMenuItem((HWND) mp2, IDM_SORTNAME,
 | 
|---|
 | 3886 |                          (pAD->pfnCompare == comparefullnames));
 | 
|---|
 | 3887 |         WinCheckMenuItem((HWND) mp2, IDM_SORTEASIZE,
 | 
|---|
 | 3888 |                          (pAD->pfnCompare == (PFNSORT) NULL));
 | 
|---|
 | 3889 |         WinCheckMenuItem((HWND) mp2, IDM_SORTSIZE,
 | 
|---|
 | 3890 |                          (pAD->pfnCompare == comparesizes));
 | 
|---|
 | 3891 |         WinCheckMenuItem((HWND) mp2, IDM_SORTLWDATE,
 | 
|---|
 | 3892 |                          (pAD->pfnCompare == comparedates));
 | 
|---|
 | 3893 |         WinCheckMenuItem((HWND) mp2, IDM_SORTFILENAME,
 | 
|---|
 | 3894 |                          (pAD->pfnCompare == comparenames));
 | 
|---|
 | 3895 |         WinCheckMenuItem((HWND) mp2, IDM_SORTREVERSE, pAD->invertsort);
 | 
|---|
 | 3896 |         WinCheckMenuItem((HWND) mp2, IDM_SORTFIRST,
 | 
|---|
 | 3897 |                          (pAD->pfnCompare == compareexts));
 | 
|---|
 | 3898 |         break;
 | 
|---|
| [2] | 3899 | 
 | 
|---|
| [551] | 3900 |       case IDM_VIEWSMENU:
 | 
|---|
| [1158] | 3901 |         {
 | 
|---|
 | 3902 |           APIRET rc;
 | 
|---|
| [2] | 3903 | 
 | 
|---|
| [1158] | 3904 |           rc = DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN);
 | 
|---|
 | 3905 |           WinEnableMenuItem((HWND) mp2, IDM_RESCAN, (rc == 0));
 | 
|---|
 | 3906 |           WinEnableMenuItem((HWND) mp2, IDM_FILTER, (rc == 0 &&
 | 
|---|
 | 3907 |                                                      pAD->afheadcnt != 0));
 | 
|---|
 | 3908 |           if (!rc)
 | 
|---|
 | 3909 |             DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 3910 |         }
 | 
|---|
 | 3911 |         WinCheckMenuItem((HWND) mp2, IDM_SHOWLNAMES, pAD->fullnames);
 | 
|---|
 | 3912 |         break;
 | 
|---|
| [2] | 3913 |       }
 | 
|---|
| [551] | 3914 |     }
 | 
|---|
 | 3915 |     break;
 | 
|---|
 | 3916 | 
 | 
|---|
 | 3917 |   case WM_COMMAND:
 | 
|---|
| [783] | 3918 |     if (!pAD) {
 | 
|---|
 | 3919 |       Runtime_Error(pszSrcFile, __LINE__, "no data");
 | 
|---|
| [551] | 3920 |       return 0;
 | 
|---|
| [783] | 3921 |     }
 | 
|---|
| [551] | 3922 |     switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 3923 |     case IDM_SETTARGET:
 | 
|---|
 | 3924 |       SetTargetDir(hwnd, FALSE);
 | 
|---|
| [2] | 3925 |       break;
 | 
|---|
 | 3926 | 
 | 
|---|
| [551] | 3927 |     case IDM_DUPES:
 | 
|---|
 | 3928 |       if (!pAD->stopflag &&
 | 
|---|
| [1158] | 3929 |           !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
 | 3930 |         pAD->dupeflags = (USHORT) WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 3931 |                                             hwnd,
 | 
|---|
 | 3932 |                                             DupeDlgProc,
 | 
|---|
 | 3933 |                                             FM3ModHandle,
 | 
|---|
 | 3934 |                                             DUPE_FRAME,
 | 
|---|
 | 3935 |                                             MPFROM2SHORT(pAD->dupeflags, 0));
 | 
|---|
 | 3936 |         if (pAD->dupeflags) {
 | 
|---|
 | 3937 |           if (_beginthread(FindDupesThread, NULL, 65536, (PVOID) hwnd) == -1)
 | 
|---|
 | 3938 |             Runtime_Error(pszSrcFile, __LINE__,
 | 
|---|
 | 3939 |                           GetPString(IDS_COULDNTSTARTTHREADTEXT));
 | 
|---|
 | 3940 |         }
 | 
|---|
 | 3941 |         DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
| [551] | 3942 |       }
 | 
|---|
 | 3943 |       break;
 | 
|---|
| [2] | 3944 | 
 | 
|---|
| [551] | 3945 |     case IDM_COLORPALETTE:
 | 
|---|
 | 3946 |       {
 | 
|---|
| [1158] | 3947 |         COLORS co;
 | 
|---|
 | 3948 |         LONG temp[COLORS_MAX];
 | 
|---|
| [2] | 3949 | 
 | 
|---|
| [1158] | 3950 |         memset(&co, 0, sizeof(co));
 | 
|---|
 | 3951 |         co.size = sizeof(co);
 | 
|---|
 | 3952 |         co.numcolors = COLORS_MAX;
 | 
|---|
 | 3953 |         co.colors = pAD->aulColors;
 | 
|---|
 | 3954 |         co.descriptions = IDS_SACOLORS1TEXT;
 | 
|---|
 | 3955 |         co.origs = temp;
 | 
|---|
 | 3956 |         co.prompt = IDS_SACOLORSPROMPTTEXT;
 | 
|---|
 | 3957 |         memcpy(temp, pAD->aulColors, sizeof(LONG) * COLORS_MAX);
 | 
|---|
 | 3958 |         if (WinDlgBox(HWND_DESKTOP,
 | 
|---|
 | 3959 |                       hwnd,
 | 
|---|
 | 3960 |                       ColorDlgProc,
 | 
|---|
 | 3961 |                       FM3ModHandle, COLOR_FRAME, (PVOID) & co)) {
 | 
|---|
 | 3962 |           memcpy(Colors, pAD->aulColors, sizeof(LONG) * COLORS_MAX);
 | 
|---|
 | 3963 |           PrfWriteProfileData(fmprof,
 | 
|---|
 | 3964 |                               appname,
 | 
|---|
 | 3965 |                               "Seeall.Colors",
 | 
|---|
 | 3966 |                               &pAD->aulColors, sizeof(LONG) * COLORS_MAX);
 | 
|---|
 | 3967 |           WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 3968 |         }
 | 
|---|
| [551] | 3969 |       }
 | 
|---|
 | 3970 |       break;
 | 
|---|
| [2] | 3971 | 
 | 
|---|
| [551] | 3972 |     case IDM_CODEPAGE:
 | 
|---|
 | 3973 |       {
 | 
|---|
| [1158] | 3974 |         INT cp;
 | 
|---|
| [2] | 3975 | 
 | 
|---|
| [1158] | 3976 |         cp = PickCodepage(hwnd);
 | 
|---|
 | 3977 |         if (cp != -1) {
 | 
|---|
 | 3978 |           pAD->fattrs.usCodePage = (USHORT) cp;
 | 
|---|
 | 3979 |           Codepage = pAD->fattrs.usCodePage;
 | 
|---|
 | 3980 |           PrfWriteProfileData(fmprof,
 | 
|---|
 | 3981 |                               appname,
 | 
|---|
 | 3982 |                               "Seeall.Codepage",
 | 
|---|
 | 3983 |                               &pAD->fattrs.usCodePage, sizeof(USHORT));
 | 
|---|
 | 3984 |           GpiDeleteSetId(pAD->hps, FIXED_FONT_LCID);
 | 
|---|
 | 3985 |           GpiAssociate(pAD->hps, 0);
 | 
|---|
 | 3986 |           GpiDestroyPS(pAD->hps);
 | 
|---|
 | 3987 |           pAD->hps = InitWindow(hwnd);
 | 
|---|
 | 3988 |           pAD->maxx = pAD->horzscroll = 0;
 | 
|---|
 | 3989 |           WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 3990 |         }
 | 
|---|
| [551] | 3991 |       }
 | 
|---|
 | 3992 |       break;
 | 
|---|
| [2] | 3993 | 
 | 
|---|
| [551] | 3994 |     case IDM_FONTPALETTE:
 | 
|---|
 | 3995 |       SetMLEFont(hwnd, &pAD->fattrs, 11);
 | 
|---|
 | 3996 |       PrfWriteProfileData(fmprof,
 | 
|---|
| [1158] | 3997 |                           appname,
 | 
|---|
 | 3998 |                           "Seeall.Fattrs", &pAD->fattrs, sizeof(pAD->fattrs));
 | 
|---|
| [551] | 3999 |       Fattrs = pAD->fattrs;
 | 
|---|
 | 4000 |       GpiDeleteSetId(pAD->hps, FIXED_FONT_LCID);
 | 
|---|
 | 4001 |       GpiAssociate(pAD->hps, 0);
 | 
|---|
 | 4002 |       GpiDestroyPS(pAD->hps);
 | 
|---|
 | 4003 |       pAD->hps = InitWindow(hwnd);
 | 
|---|
 | 4004 |       pAD->maxx = pAD->horzscroll = 0;
 | 
|---|
 | 4005 |       WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 4006 |       break;
 | 
|---|
 | 4007 | 
 | 
|---|
 | 4008 |     case IDM_SHOWLNAMES:
 | 
|---|
 | 4009 |       pAD->fullnames = (pAD->fullnames) ? FALSE : TRUE;
 | 
|---|
 | 4010 |       PrfWriteProfileData(fmprof,
 | 
|---|
| [1158] | 4011 |                           appname,
 | 
|---|
 | 4012 |                           "Seeall.Fullnames", &pAD->fullnames, sizeof(BOOL));
 | 
|---|
| [551] | 4013 |       Fullnames = pAD->fullnames;
 | 
|---|
 | 4014 |       pAD->maxx = pAD->horzscroll = 0;
 | 
|---|
 | 4015 |       WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 4016 |       break;
 | 
|---|
 | 4017 | 
 | 
|---|
 | 4018 |     case IDM_SORTREVERSE:
 | 
|---|
 | 4019 |       pAD->invertsort = (pAD->invertsort) ? FALSE : TRUE;
 | 
|---|
 | 4020 |       SortReverse = pAD->invertsort;
 | 
|---|
 | 4021 |       PrfWriteProfileData(fmprof,
 | 
|---|
| [1158] | 4022 |                           appname,
 | 
|---|
 | 4023 |                           "Seeall.SortReverse",
 | 
|---|
 | 4024 |                           (PVOID) & pAD->invertsort, sizeof(BOOL));
 | 
|---|
| [551] | 4025 |       WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 4026 |       break;
 | 
|---|
 | 4027 | 
 | 
|---|
 | 4028 |     case IDM_SORTEASIZE:
 | 
|---|
 | 4029 |     case IDM_SORTNAME:
 | 
|---|
 | 4030 |     case IDM_SORTFILENAME:
 | 
|---|
 | 4031 |     case IDM_SORTSIZE:
 | 
|---|
 | 4032 |     case IDM_SORTLWDATE:
 | 
|---|
 | 4033 |     case IDM_SORTFIRST:
 | 
|---|
 | 4034 |       if (!pAD->stopflag &&
 | 
|---|
| [1158] | 4035 |           !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
 | 4036 |         {
 | 
|---|
 | 4037 |           USHORT dummy = SHORT1FROMMP(mp1);
 | 
|---|
| [551] | 4038 | 
 | 
|---|
| [1158] | 4039 |           PrfWriteProfileData(fmprof,
 | 
|---|
 | 4040 |                               appname,
 | 
|---|
 | 4041 |                               "Seeall.Sort", (PVOID) & dummy, sizeof(USHORT));
 | 
|---|
 | 4042 |           SortType = SHORT1FROMMP(mp1);
 | 
|---|
 | 4043 |         }
 | 
|---|
 | 4044 |         WinSetPointer(HWND_DESKTOP, hptrBusy);
 | 
|---|
 | 4045 |         WinSendMsg(hwnd, UM_RESCAN, MPFROMLONG(1), MPVOID);
 | 
|---|
 | 4046 |         switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 4047 |         case IDM_SORTEASIZE:
 | 
|---|
 | 4048 |           pAD->pfnCompare = (PFNSORT) NULL;
 | 
|---|
 | 4049 |           ReSort(hwnd);
 | 
|---|
 | 4050 |           break;
 | 
|---|
| [2] | 4051 | 
 | 
|---|
| [1158] | 4052 |         case IDM_SORTNAME:
 | 
|---|
 | 4053 |           pAD->pfnCompare = comparefullnames;
 | 
|---|
 | 4054 |           ReSort(hwnd);
 | 
|---|
 | 4055 |           break;
 | 
|---|
| [2] | 4056 | 
 | 
|---|
| [1158] | 4057 |         case IDM_SORTFILENAME:
 | 
|---|
 | 4058 |           pAD->pfnCompare = comparenames;
 | 
|---|
 | 4059 |           ReSort(hwnd);
 | 
|---|
 | 4060 |           break;
 | 
|---|
| [551] | 4061 | 
 | 
|---|
| [1158] | 4062 |         case IDM_SORTSIZE:
 | 
|---|
 | 4063 |           pAD->pfnCompare = comparesizes;
 | 
|---|
 | 4064 |           ReSort(hwnd);
 | 
|---|
 | 4065 |           break;
 | 
|---|
| [551] | 4066 | 
 | 
|---|
| [1158] | 4067 |         case IDM_SORTLWDATE:
 | 
|---|
 | 4068 |           pAD->pfnCompare = comparedates;
 | 
|---|
 | 4069 |           ReSort(hwnd);
 | 
|---|
 | 4070 |           break;
 | 
|---|
| [551] | 4071 | 
 | 
|---|
| [1158] | 4072 |         case IDM_SORTFIRST:
 | 
|---|
 | 4073 |           pAD->pfnCompare = compareexts;
 | 
|---|
 | 4074 |           ReSort(hwnd);
 | 
|---|
 | 4075 |           break;
 | 
|---|
 | 4076 |         }
 | 
|---|
 | 4077 |         WinSetPointer(HWND_DESKTOP, hptrArrow);
 | 
|---|
 | 4078 |         DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 4079 |         WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
| [551] | 4080 |       }
 | 
|---|
 | 4081 |       break;
 | 
|---|
| [2] | 4082 | 
 | 
|---|
| [551] | 4083 |     case IDM_FILTER:
 | 
|---|
 | 4084 |       if (!pAD->stopflag &&
 | 
|---|
| [1158] | 4085 |           !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
 | 4086 |         FilterList(hwnd);
 | 
|---|
 | 4087 |         DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
| [551] | 4088 |       }
 | 
|---|
 | 4089 |       break;
 | 
|---|
| [2] | 4090 | 
 | 
|---|
| [551] | 4091 |     case IDM_RESCAN:
 | 
|---|
 | 4092 |       if (!pAD->stopflag &&
 | 
|---|
| [1158] | 4093 |           !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
| [2] | 4094 | 
 | 
|---|
| [1158] | 4095 |         CHAR tempflags[26];
 | 
|---|
| [2] | 4096 | 
 | 
|---|
| [1158] | 4097 |         memcpy(tempflags, pAD->abDrvFlags, sizeof(tempflags));
 | 
|---|
 | 4098 |         if (!WinDlgBox(HWND_DESKTOP, hwnd, AFDrvsWndProc, FM3ModHandle,
 | 
|---|
 | 4099 |                        DRVS_FRAME, (PVOID) pAD)) {
 | 
|---|
 | 4100 |           memcpy(pAD->abDrvFlags, tempflags, sizeof(tempflags));
 | 
|---|
 | 4101 |           *pAD->szFindPath = 0;
 | 
|---|
 | 4102 |           DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 4103 |           break;
 | 
|---|
 | 4104 |         }
 | 
|---|
 | 4105 |         WinSendMsg(pAD->hhscroll, SBM_SETTHUMBSIZE, MPFROM2SHORT(1, 1),
 | 
|---|
 | 4106 |                    MPVOID);
 | 
|---|
 | 4107 |         WinSendMsg(pAD->hvscroll, SBM_SETTHUMBSIZE, MPFROM2SHORT(1, 1),
 | 
|---|
 | 4108 |                    MPVOID);
 | 
|---|
 | 4109 |         pAD->topfile = 1;
 | 
|---|
 | 4110 |         pAD->cursored = 1;
 | 
|---|
 | 4111 |         pAD->selected = 0;
 | 
|---|
 | 4112 |         pAD->ullSelectedBytes = 0;
 | 
|---|
 | 4113 |         pAD->maxx = pAD->horzscroll = 0;
 | 
|---|
 | 4114 |         FreeAllFilesList(hwnd);
 | 
|---|
 | 4115 |         pAD->stopflag = 0;
 | 
|---|
 | 4116 |         if (_beginthread(FindAllThread, NULL, 524288, (PVOID) hwnd) == -1) {
 | 
|---|
 | 4117 |           Runtime_Error(pszSrcFile, __LINE__,
 | 
|---|
 | 4118 |                         GetPString(IDS_COULDNTSTARTTHREADTEXT));
 | 
|---|
 | 4119 |           WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT));
 | 
|---|
 | 4120 |           DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 4121 |         }
 | 
|---|
 | 4122 |         else {
 | 
|---|
 | 4123 |           DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
 | 4124 |           DosSleep(50);//05 Aug 07 GKY 100
 | 
|---|
 | 4125 |           WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 4126 |           PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID);
 | 
|---|
 | 4127 |           PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
 | 
|---|
 | 4128 |         }
 | 
|---|
| [551] | 4129 |       }
 | 
|---|
 | 4130 |       break;
 | 
|---|
| [958] | 4131 |     case IDM_UNHIDEALL:
 | 
|---|
 | 4132 |       {
 | 
|---|
 | 4133 |       ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
 | 
|---|
 | 4134 |       FilterAll(hwnd, ad);
 | 
|---|
 | 4135 |       }
 | 
|---|
 | 4136 |       break;
 | 
|---|
| [2] | 4137 | 
 | 
|---|
| [551] | 4138 |     case IDM_DELETE:
 | 
|---|
 | 4139 |     case IDM_PERMDELETE:
 | 
|---|
 | 4140 |     case IDM_SELECTALL:
 | 
|---|
 | 4141 |     case IDM_DESELECTALL:
 | 
|---|
 | 4142 |     case IDM_INVERT:
 | 
|---|
 | 4143 |     case IDM_SELECTMASK:
 | 
|---|
 | 4144 |     case IDM_DESELECTMASK:
 | 
|---|
 | 4145 |     case IDM_REMOVE:
 | 
|---|
 | 4146 |     case IDM_HIDEALL:
 | 
|---|
 | 4147 |     case IDM_COLLECT:
 | 
|---|
 | 4148 |     case IDM_COLLECTOR:
 | 
|---|
 | 4149 |     case IDM_SAVETOCLIP:
 | 
|---|
| [1084] | 4150 |     case IDM_SAVETOCLIPFILENAME:
 | 
|---|
| [551] | 4151 |     case IDM_APPENDTOCLIP:
 | 
|---|
| [1084] | 4152 |     case IDM_APPENDTOCLIPFILENAME:
 | 
|---|
| [551] | 4153 |     case IDM_SAVETOLIST:
 | 
|---|
 | 4154 |     case IDM_INFO:
 | 
|---|
 | 4155 |     case IDM_ATTRS:
 | 
|---|
 | 4156 |     case IDM_MOVE:
 | 
|---|
 | 4157 |     case IDM_COPY:
 | 
|---|
 | 4158 |     case IDM_RENAME:
 | 
|---|
 | 4159 |     case IDM_MOVEPRESERVE:
 | 
|---|
 | 4160 |     case IDM_COPYPRESERVE:
 | 
|---|
 | 4161 |     case IDM_WILDMOVE:
 | 
|---|
 | 4162 |     case IDM_WILDCOPY:
 | 
|---|
 | 4163 |     case IDM_SUBJECT:
 | 
|---|
 | 4164 |     case IDM_EAS:
 | 
|---|
 | 4165 |     case IDM_PRINT:
 | 
|---|
 | 4166 |     case IDM_ARCHIVE:
 | 
|---|
 | 4167 |     case IDM_EXTRACT:
 | 
|---|
 | 4168 |     case IDM_UUDECODE:
 | 
|---|
 | 4169 |     case IDM_SHADOW:
 | 
|---|
 | 4170 |     case IDM_OBJECT:
 | 
|---|
 | 4171 |     case IDM_OPENSETTINGS:
 | 
|---|
 | 4172 |     case IDM_OPENDEFAULT:
 | 
|---|
 | 4173 |       if (!pAD->stopflag &&
 | 
|---|
| [1158] | 4174 |           !DosRequestMutexSem(pAD->hmtxScan, SEM_IMMEDIATE_RETURN)) {
 | 
|---|
 | 4175 |         switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 4176 |         case IDM_SELECTALL:
 | 
|---|
 | 4177 |         case IDM_DESELECTALL:
 | 
|---|
 | 4178 |         case IDM_INVERT:
 | 
|---|
 | 4179 |         case IDM_HIDEALL:
 | 
|---|
 | 4180 |         case IDM_REMOVE:
 | 
|---|
 | 4181 |           Mark(hwnd, (SHORT1FROMMP(mp1) == IDM_DESELECTALL) ?
 | 
|---|
 | 4182 |                AFM_UNMARK : (SHORT1FROMMP(mp1) == IDM_INVERT) ?
 | 
|---|
 | 4183 |                AFM_INVERT : (SHORT1FROMMP(mp1) == IDM_HIDEALL) ?
 | 
|---|
 | 4184 |                AFM_FILTER : (SHORT1FROMMP(mp1) == IDM_REMOVE) ?
 | 
|---|
 | 4185 |                AFM_MARKDELETED : 0, NULL);
 | 
|---|
 | 4186 |           if (SHORT1FROMMP(mp1) == IDM_REMOVE ||
 | 
|---|
 | 4187 |               SHORT1FROMMP(mp1) == IDM_HIDEALL) {
 | 
|---|
 | 4188 |             if (SHORT1FROMMP(mp1) == IDM_REMOVE)
 | 
|---|
 | 4189 |               RemoveDeleted(hwnd);
 | 
|---|
 | 4190 |             else
 | 
|---|
 | 4191 |               ReSort(hwnd);
 | 
|---|
 | 4192 |           }
 | 
|---|
 | 4193 |           WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 4194 |           break;
 | 
|---|
| [2] | 4195 | 
 | 
|---|
| [1158] | 4196 |         case IDM_SELECTMASK:
 | 
|---|
 | 4197 |         case IDM_DESELECTMASK:
 | 
|---|
 | 4198 |           SelectMask(hwnd, (SHORT1FROMMP(mp1) == IDM_DESELECTMASK));
 | 
|---|
 | 4199 |           WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 4200 |           break;
 | 
|---|
| [2] | 4201 | 
 | 
|---|
| [1158] | 4202 |         case IDM_DELETE:
 | 
|---|
 | 4203 |         case IDM_PERMDELETE:
 | 
|---|
| [1084] | 4204 |         case IDM_APPENDTOCLIP:
 | 
|---|
 | 4205 |         case IDM_APPENDTOCLIPFILENAME:
 | 
|---|
| [1158] | 4206 |         case IDM_SAVETOCLIP:
 | 
|---|
| [1084] | 4207 |         case IDM_SAVETOCLIPFILENAME:
 | 
|---|
| [1158] | 4208 |         case IDM_SAVETOLIST:
 | 
|---|
 | 4209 |         case IDM_COLLECT:
 | 
|---|
 | 4210 |         case IDM_INFO:
 | 
|---|
 | 4211 |         case IDM_ATTRS:
 | 
|---|
 | 4212 |         case IDM_MOVE:
 | 
|---|
 | 4213 |         case IDM_COPY:
 | 
|---|
 | 4214 |         case IDM_RENAME:
 | 
|---|
 | 4215 |         case IDM_MOVEPRESERVE:
 | 
|---|
 | 4216 |         case IDM_COPYPRESERVE:
 | 
|---|
 | 4217 |         case IDM_WILDMOVE:
 | 
|---|
 | 4218 |         case IDM_WILDCOPY:
 | 
|---|
 | 4219 |         case IDM_SUBJECT:
 | 
|---|
 | 4220 |         case IDM_PRINT:
 | 
|---|
 | 4221 |         case IDM_EAS:
 | 
|---|
 | 4222 |         case IDM_ARCHIVE:
 | 
|---|
 | 4223 |         case IDM_EXTRACT:
 | 
|---|
 | 4224 |         case IDM_SHADOW:
 | 
|---|
 | 4225 |         case IDM_OBJECT:
 | 
|---|
 | 4226 |         case IDM_OPENSETTINGS:
 | 
|---|
 | 4227 |         case IDM_OPENDEFAULT:
 | 
|---|
 | 4228 |         case IDM_UUDECODE:
 | 
|---|
 | 4229 |           {
 | 
|---|
 | 4230 |             CHAR **list = BuildAList(hwnd);
 | 
|---|
| [2] | 4231 | 
 | 
|---|
| [1158] | 4232 |             if (!list)
 | 
|---|
 | 4233 |               Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
 | 
|---|
 | 4234 |             else {
 | 
|---|
 | 4235 |               switch (SHORT1FROMMP(mp1)) {
 | 
|---|
 | 4236 |               case IDM_COLLECT:
 | 
|---|
 | 4237 |                 CollectList(hwnd, list);
 | 
|---|
 | 4238 |                 break;
 | 
|---|
 | 4239 |               case IDM_DELETE:
 | 
|---|
 | 4240 |               case IDM_PERMDELETE:
 | 
|---|
| [1084] | 4241 |               case IDM_APPENDTOCLIP:
 | 
|---|
 | 4242 |               case IDM_APPENDTOCLIPFILENAME:
 | 
|---|
| [1158] | 4243 |               case IDM_SAVETOCLIP:
 | 
|---|
| [1084] | 4244 |               case IDM_SAVETOCLIPFILENAME:
 | 
|---|
| [1158] | 4245 |               case IDM_SAVETOLIST:
 | 
|---|
 | 4246 |               case IDM_INFO:
 | 
|---|
 | 4247 |               case IDM_ATTRS:
 | 
|---|
 | 4248 |               case IDM_MOVE:
 | 
|---|
 | 4249 |               case IDM_COPY:
 | 
|---|
 | 4250 |               case IDM_RENAME:
 | 
|---|
 | 4251 |               case IDM_MOVEPRESERVE:
 | 
|---|
 | 4252 |               case IDM_COPYPRESERVE:
 | 
|---|
 | 4253 |               case IDM_WILDMOVE:
 | 
|---|
 | 4254 |               case IDM_WILDCOPY:
 | 
|---|
 | 4255 |               case IDM_SUBJECT:
 | 
|---|
 | 4256 |               case IDM_PRINT:
 | 
|---|
 | 4257 |               case IDM_EAS:
 | 
|---|
 | 4258 |               case IDM_ARCHIVE:
 | 
|---|
 | 4259 |               case IDM_EXTRACT:
 | 
|---|
 | 4260 |               case IDM_UUDECODE:
 | 
|---|
 | 4261 |               case IDM_OBJECT:
 | 
|---|
 | 4262 |               case IDM_SHADOW:
 | 
|---|
 | 4263 |               case IDM_OPENSETTINGS:
 | 
|---|
 | 4264 |               case IDM_OPENDEFAULT:
 | 
|---|
 | 4265 |                 if (!PostMsg(pAD->hwndObj, UM_MASSACTION, mp1, MPFROMP(list)))
 | 
|---|
 | 4266 |                   FreeList(list);
 | 
|---|
 | 4267 |                 break;
 | 
|---|
 | 4268 |               }
 | 
|---|
 | 4269 |               if (fUnHilite) {
 | 
|---|
 | 4270 |                 Mark(hwnd, AFM_UNMARK, NULL);
 | 
|---|
 | 4271 |                 WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 4272 |               }
 | 
|---|
 | 4273 |             }
 | 
|---|
 | 4274 |           }
 | 
|---|
 | 4275 |           break;
 | 
|---|
| [2] | 4276 | 
 | 
|---|
| [1158] | 4277 |         case IDM_COLLECTOR:
 | 
|---|
 | 4278 |           if (mp2) {
 | 
|---|
| [2] | 4279 | 
 | 
|---|
| [1158] | 4280 |             CHAR **list = mp2;
 | 
|---|
| [2] | 4281 | 
 | 
|---|
| [1158] | 4282 |             if (Collector) {
 | 
|---|
 | 4283 |               if (!PostMsg(Collector, WM_COMMAND,
 | 
|---|
 | 4284 |                            MPFROM2SHORT(IDM_COLLECTOR, 0), MPFROMP(list)))
 | 
|---|
 | 4285 |                 FreeList(list);
 | 
|---|
 | 4286 |               else if (fUnHilite) {
 | 
|---|
 | 4287 |                 Mark(hwnd, AFM_UNMARK, NULL);
 | 
|---|
 | 4288 |                 WinInvalidateRect(hwnd, NULL, FALSE);
 | 
|---|
 | 4289 |               }
 | 
|---|
 | 4290 |             }
 | 
|---|
 | 4291 |             else
 | 
|---|
 | 4292 |               FreeList(list);
 | 
|---|
 | 4293 |           }
 | 
|---|
 | 4294 |           break;
 | 
|---|
 | 4295 |         }
 | 
|---|
 | 4296 |         DosReleaseMutexSem(pAD->hmtxScan);
 | 
|---|
| [2] | 4297 |       }
 | 
|---|
| [551] | 4298 |       else if (SHORT1FROMMP(mp1) == IDM_COLLECTOR) {
 | 
|---|
| [1158] | 4299 |         DosSleep(50);//05 Aug 07 GKY 100
 | 
|---|
 | 4300 |         if (!PostMsg(hwnd, msg, mp1, mp2))
 | 
|---|
 | 4301 |           WinSendMsg(hwnd, msg, mp1, mp2);
 | 
|---|
| [551] | 4302 |       }
 | 
|---|
 | 4303 |       break;
 | 
|---|
| [2] | 4304 | 
 | 
|---|
| [551] | 4305 |     case IDM_HELP:
 | 
|---|
 | 4306 |       if (hwndHelp)
 | 
|---|
| [1158] | 4307 |         WinSendMsg(hwndHelp,
 | 
|---|
 | 4308 |                    HM_DISPLAY_HELP,
 | 
|---|
 | 4309 |                    MPFROM2SHORT(HELP_SEEALL, 0), MPFROMSHORT(HM_RESOURCEID));
 | 
|---|
| [2] | 4310 |       break;
 | 
|---|
| [551] | 4311 |     }
 | 
|---|
 | 4312 |     return 0;
 | 
|---|
| [2] | 4313 | 
 | 
|---|
| [551] | 4314 |   case WM_SIZE:
 | 
|---|
 | 4315 | // fprintf(stderr,"Seeall: WM_SIZE\n");
 | 
|---|
 | 4316 |     PostMsg(hwnd, UM_SETUP3, MPVOID, MPVOID);
 | 
|---|
 | 4317 |     break;
 | 
|---|
 | 4318 | 
 | 
|---|
 | 4319 |   case WM_CLOSE:
 | 
|---|
| [2] | 4320 | // fprintf(stderr,"Seeall: WM_CLOSE\n");
 | 
|---|
| [551] | 4321 |     if (pAD)
 | 
|---|
 | 4322 |       pAD->stopflag = 1;
 | 
|---|
 | 4323 |     WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT));
 | 
|---|
 | 4324 |     return 0;
 | 
|---|
| [2] | 4325 | 
 | 
|---|
| [551] | 4326 |   case WM_DESTROY:
 | 
|---|
| [2] | 4327 | // fprintf(stderr,"Seeall: WM_DESTROY\n");
 | 
|---|
| [551] | 4328 |     if (pAD) {
 | 
|---|
 | 4329 |       pAD->stopflag = 1;
 | 
|---|
 | 4330 |       if (pAD->hmtxScan) {
 | 
|---|
| [1158] | 4331 |         DosRequestMutexSem(pAD->hmtxScan, 15000);
 | 
|---|
 | 4332 |         DosCloseMutexSem(pAD->hmtxScan);
 | 
|---|
| [2] | 4333 |       }
 | 
|---|
| [551] | 4334 |       if (pAD->hwndPopup)
 | 
|---|
| [1158] | 4335 |         WinDestroyWindow(pAD->hwndPopup);
 | 
|---|
| [551] | 4336 |       if (pAD->hwndObj) {
 | 
|---|
| [1158] | 4337 |         if (!PostMsg(pAD->hwndObj, WM_CLOSE, MPVOID, MPVOID))
 | 
|---|
 | 4338 |           WinSendMsg(pAD->hwndObj, WM_CLOSE, MPVOID, MPVOID);
 | 
|---|
| [551] | 4339 |       }
 | 
|---|
 | 4340 |       if (pAD->hps) {
 | 
|---|
| [1158] | 4341 |         GpiDeleteSetId(pAD->hps, FIXED_FONT_LCID);
 | 
|---|
 | 4342 |         GpiAssociate(pAD->hps, 0);
 | 
|---|
 | 4343 |         GpiDestroyPS(pAD->hps);
 | 
|---|
| [551] | 4344 |       }
 | 
|---|
 | 4345 |       if (pAD->killme) {
 | 
|---|
| [1158] | 4346 |         if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID))
 | 
|---|
 | 4347 |           WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
 | 
|---|
| [551] | 4348 |       }
 | 
|---|
 | 4349 |       FreeAllFilesList(hwnd);
 | 
|---|
| [1039] | 4350 |       free(pAD);
 | 
|---|
| [551] | 4351 |     }
 | 
|---|
| [1063] | 4352 | #   ifdef FORTIFY
 | 
|---|
 | 4353 |     Fortify_LeaveScope();
 | 
|---|
 | 4354 | #    endif
 | 
|---|
| [551] | 4355 |     break;
 | 
|---|
| [2] | 4356 |   }
 | 
|---|
 | 4357 | 
 | 
|---|
| [551] | 4358 |   return WinDefWindowProc(hwnd, msg, mp1, mp2);
 | 
|---|
| [2] | 4359 | }
 | 
|---|
 | 4360 | 
 | 
|---|
| [1158] | 4361 | HWND StartSeeAll(HWND hwndParent, BOOL standalone,      // called by applet
 | 
|---|
 | 4362 |                  CHAR * pszStartPath)   // pathname or NULL
 | 
|---|
| [84] | 4363 | {
 | 
|---|
| [551] | 4364 |   HWND hwndFrame = (HWND) 0, hwndClient;
 | 
|---|
 | 4365 |   ULONG FrameFlags = FCF_TITLEBAR | FCF_SYSMENU |
 | 
|---|
 | 4366 |     FCF_SIZEBORDER | FCF_MINMAX |
 | 
|---|
 | 4367 |     FCF_NOBYTEALIGN | FCF_VERTSCROLL |
 | 
|---|
 | 4368 |     FCF_MENU | FCF_ICON | FCF_ACCELTABLE | FCF_HORZSCROLL;
 | 
|---|
| [2] | 4369 | 
 | 
|---|
| [551] | 4370 |   if (ParentIsDesktop(hwndParent, hwndParent))
 | 
|---|
| [2] | 4371 |     FrameFlags |= (FCF_TASKLIST | FCF_SHELLPOSITION);
 | 
|---|
 | 4372 |   hwndFrame = WinCreateStdWindow(hwndParent,
 | 
|---|
| [1158] | 4373 |                                  WS_VISIBLE,
 | 
|---|
 | 4374 |                                  &FrameFlags,
 | 
|---|
 | 4375 |                                  WC_SEEALL,
 | 
|---|
 | 4376 |                                  GetPString(IDS_SEEALLTITLETEXT),
 | 
|---|
 | 4377 |                                  WS_VISIBLE | fwsAnimate,
 | 
|---|
 | 4378 |                                  FM3ModHandle, SEEALL_FRAME, &hwndClient);
 | 
|---|
| [551] | 4379 |   if (hwndFrame) {
 | 
|---|
 | 4380 |     static CHAR *pszDir;
 | 
|---|
 | 4381 | 
 | 
|---|
 | 4382 |     if (standalone) {
 | 
|---|
 | 4383 |       if (!PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
| [1158] | 4384 |                    UM_SETUP4, MPVOID, MPVOID)) {
 | 
|---|
 | 4385 |         PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
 | 
|---|
 | 4386 |         return (HWND) 0;
 | 
|---|
| [2] | 4387 |       }
 | 
|---|
 | 4388 |     }
 | 
|---|
| [551] | 4389 |     if (pszStartPath) {
 | 
|---|
| [84] | 4390 |       // Needs to be static for other thread
 | 
|---|
 | 4391 |       if (!pszDir)
 | 
|---|
| [1158] | 4392 |         pszDir = xmalloc(CCHMAXPATH, pszSrcFile, __LINE__);
 | 
|---|
| [84] | 4393 |       if (pszDir) {
 | 
|---|
| [1158] | 4394 |         strcpy(pszDir, pszStartPath);
 | 
|---|
 | 4395 |         pszStartPath = pszDir;
 | 
|---|
| [84] | 4396 |       }
 | 
|---|
 | 4397 |     }
 | 
|---|
| [551] | 4398 |     PostMsg(WinWindowFromID(hwndFrame, FID_CLIENT),
 | 
|---|
| [1158] | 4399 |             UM_SETUP5, MPFROMP(pszStartPath), MPVOID);
 | 
|---|
| [2] | 4400 |   }
 | 
|---|
| [551] | 4401 |   else if (standalone)
 | 
|---|
 | 4402 |     PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
 | 
|---|
| [2] | 4403 |   return hwndFrame;
 | 
|---|
 | 4404 | }
 | 
|---|
| [783] | 4405 | 
 | 
|---|
 | 4406 | #pragma alloc_text(SEEALL,comparefullnames,comparenames,comparesizes)
 | 
|---|
 | 4407 | #pragma alloc_text(SEEALL,comparedates,compareexts,SeeStatusProc)
 | 
|---|
 | 4408 | #pragma alloc_text(SEEALL,InitWindow,PaintLine,SeeAllWndProc)
 | 
|---|
 | 4409 | #pragma alloc_text(SEEALL,UpdateList,CollectList,ReSort,Mark)
 | 
|---|
| [985] | 4410 | #pragma alloc_text(SEEALL,BuildAList,RemoveDeleted,SeeFrameWndProc,FilterList,FilterAll)
 | 
|---|
| [787] | 4411 | #pragma alloc_text(SEEALL2,SeeObjWndProc,MakeSeeObjWinThread,FindDupesThread,DupeDlgProc)
 | 
|---|
| [783] | 4412 | #pragma alloc_text(SEEALL3,FreeAllFilesList,DoADir,FindAllThread,AFDrvsWndProc)
 | 
|---|
 | 4413 | #pragma alloc_text(SEEALL3,StartSeeAll)
 | 
|---|
 | 4414 | 
 | 
|---|