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