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