[36] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: info.c 1402 2009-03-14 17:17:59Z gyoung $
|
---|
| 5 |
|
---|
[576] | 6 | Info windows
|
---|
[36] | 7 |
|
---|
| 8 | Copyright (c) 1993-98 M. Kimes
|
---|
[907] | 9 | Copyright (c) 2001, 2008 Steven H. Levine
|
---|
[36] | 10 |
|
---|
[131] | 11 | 16 Oct 02 SHL Handle large partitions
|
---|
| 12 | 12 Feb 03 SHL FileInfoProc: standardize EA math
|
---|
| 13 | 01 Aug 04 SHL Rework lstrip/rstrip usage
|
---|
[130] | 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
|
---|
[336] | 17 | 14 Jul 06 SHL Use Runtime_Error
|
---|
[575] | 18 | 24 Mar 07 SHL Correct FileInfoProc binary file detect
|
---|
| 19 | 24 Mar 07 SHL Correct FileInfoProc/IconProc race crash
|
---|
[618] | 20 | 19 Apr 07 SHL Sync with AcceptOneDrop GetOneDrop mods
|
---|
[793] | 21 | 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
|
---|
[805] | 22 | 25 Aug 07 SHL Drop list from FILESTUF - data not static
|
---|
| 23 | 25 Aug 07 SHL IconProc: do not use freed memory - random bad things happen
|
---|
[846] | 24 | 27 Sep 07 SHL Correct ULONGLONG size formatting
|
---|
[897] | 25 | 30 Dec 07 GKY Use CommaFmtULL
|
---|
[985] | 26 | 29 Feb 08 GKY Use xfree where appropriate
|
---|
[1358] | 27 | 25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
|
---|
| 28 | 25 Dec 08 GKY Add DRIVE_RSCANNED flag to monitor for the first recursive drive scan per session
|
---|
| 29 | to prevent duplicate directory names in tree following a copy before initial scan.
|
---|
[1391] | 30 | 11 Jan 08 GKY Add Write verify off and recures scan to drive info display when appropriate.
|
---|
[1395] | 31 | 07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
|
---|
| 32 | 07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
|
---|
[1400] | 33 | 08 Mar 09 GKY Renamed commafmt.h i18nutil.h
|
---|
[36] | 34 |
|
---|
| 35 | ***********************************************************************/
|
---|
| 36 |
|
---|
[907] | 37 | #include <stdlib.h>
|
---|
| 38 | #include <string.h>
|
---|
| 39 | #include <ctype.h>
|
---|
| 40 | #include <share.h>
|
---|
| 41 |
|
---|
[2] | 42 | #define INCL_DOS
|
---|
| 43 | #define INCL_WIN
|
---|
| 44 | #define INCL_GPI
|
---|
[162] | 45 | #define INCL_LONGLONG
|
---|
[2] | 46 |
|
---|
[1183] | 47 | #include "fm3dll.h"
|
---|
[1223] | 48 | #include "fm3dll2.h" // #define's for UM_*, control id's, etc.
|
---|
[1208] | 49 | #include "draglist.h" // Data declaration(s)
|
---|
| 50 | #include "notebook.h" // Data declaration(s)
|
---|
| 51 | #include "inis.h" // Data declaration(s)
|
---|
| 52 | #include "init.h" // Data declaration(s)
|
---|
| 53 | #include "mainwnd.h" // Data declaration(s)
|
---|
[2] | 54 | #include "fm3dlg.h"
|
---|
| 55 | #include "fm3str.h"
|
---|
[907] | 56 | #include "makelist.h" // AddToList
|
---|
| 57 | #include "errutil.h" // Dos_Error...
|
---|
| 58 | #include "strutil.h" // GetPString
|
---|
[1160] | 59 | #include "attribs.h" // AttrListDlgProc
|
---|
| 60 | #include "defview.h" // DefaultView
|
---|
| 61 | #include "info.h"
|
---|
[1183] | 62 | #include "valid.h" // CheckDrive, IsBinary
|
---|
[1160] | 63 | #include "seticon.h" // SetIconDlgProc
|
---|
[1183] | 64 | #include "droplist.h" // AcceptOneDrop, DropHelp, GetOneDrop
|
---|
| 65 | #include "eas.h" // DisplayEAsProc
|
---|
| 66 | #include "misc.h" // DrawTargetEmphasis
|
---|
| 67 | #include "notify.h" // Notify
|
---|
| 68 | #include "shadow.h" // OpenObject
|
---|
| 69 | #include "chklist.h" // PopupMenu
|
---|
| 70 | #include "presparm.h" // SetPresParams
|
---|
| 71 | #include "strips.h" // bstrip
|
---|
[1400] | 72 | #include "i18nutil.h" // CommaFmtULL
|
---|
[1183] | 73 | #include "wrappers.h" // xDosFindFirst
|
---|
[1039] | 74 | #include "fortify.h"
|
---|
[2] | 75 |
|
---|
[1208] | 76 | // Data definitions
|
---|
[2] | 77 | #pragma data_seg(DATA1)
|
---|
[336] | 78 | static PSZ pszSrcFile = __FILE__;
|
---|
| 79 |
|
---|
[1208] | 80 | #pragma data_seg(GLOBAL1)
|
---|
| 81 | INT driveflags[26];
|
---|
| 82 |
|
---|
[551] | 83 | CHAR *FlagMsg(CHAR drive, CHAR * buffer)
|
---|
[336] | 84 | {
|
---|
[551] | 85 | ULONG x;
|
---|
| 86 | BOOL once = FALSE;
|
---|
| 87 | register CHAR *p;
|
---|
[2] | 88 |
|
---|
[551] | 89 | if (buffer) {
|
---|
[2] | 90 | *buffer = 0;
|
---|
| 91 | p = buffer;
|
---|
[551] | 92 | if (isalpha(drive)) {
|
---|
| 93 | if (driveflags[toupper(drive) - 'A']) {
|
---|
[1391] | 94 | for (x = IDS_FLREMOVABLETEXT; x < IDS_FLRECURSESCANDONETEXT + 1; x++) {
|
---|
[551] | 95 | if (driveflags[toupper(drive) - 'A'] &
|
---|
| 96 | (1 << (x - IDS_FLREMOVABLETEXT))) {
|
---|
| 97 | if (once) {
|
---|
| 98 | *p = ' ';
|
---|
| 99 | p++;
|
---|
| 100 | }
|
---|
| 101 | else
|
---|
| 102 | once = TRUE;
|
---|
| 103 | *p = '[';
|
---|
| 104 | p++;
|
---|
| 105 | strcpy(p, GetPString(x));
|
---|
| 106 | p += strlen(p);
|
---|
| 107 | *p = ']';
|
---|
| 108 | p++;
|
---|
| 109 | *p = 0;
|
---|
| 110 | }
|
---|
| 111 | }
|
---|
[2] | 112 | }
|
---|
| 113 | else
|
---|
[551] | 114 | strcpy(buffer, "[None]");
|
---|
[2] | 115 | }
|
---|
| 116 | }
|
---|
| 117 | return buffer;
|
---|
| 118 | }
|
---|
| 119 |
|
---|
[551] | 120 | MRESULT EXPENTRY DrvInfoProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
[162] | 121 | {
|
---|
| 122 | CHAR *pszFileName;
|
---|
[551] | 123 | CHAR szMB[20];
|
---|
| 124 | CHAR szKB[20];
|
---|
| 125 | CHAR szUnits[20];
|
---|
[336] | 126 | APIRET rc;
|
---|
[2] | 127 |
|
---|
[551] | 128 | switch (msg) {
|
---|
| 129 | case WM_INITDLG:
|
---|
| 130 | if (mp2) {
|
---|
[2] | 131 |
|
---|
[551] | 132 | CHAR s[CCHMAXPATH * 2];
|
---|
| 133 | ULONG type;
|
---|
[2] | 134 |
|
---|
[1009] | 135 | pszFileName = (CHAR *)mp2;
|
---|
[551] | 136 | WinSetWindowPtr(hwnd, QWL_USER, (PVOID) pszFileName);
|
---|
| 137 | WinSendDlgItemMsg(hwnd,
|
---|
| 138 | INFO_LABEL,
|
---|
| 139 | EM_SETTEXTLIMIT,
|
---|
| 140 | MPFROM2SHORT(CCHMAXPATHCOMP, 0), MPVOID);
|
---|
[552] | 141 | if (!(driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOSTATS)){
|
---|
[551] | 142 | WinSendDlgItemMsg(hwnd,
|
---|
| 143 | INFO_FREE,
|
---|
| 144 | SLM_SETSLIDERINFO,
|
---|
| 145 | MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS, 0),
|
---|
| 146 | MPFROM2SHORT(0, 0));
|
---|
| 147 | WinSendDlgItemMsg(hwnd,
|
---|
| 148 | INFO_USED,
|
---|
| 149 | SLM_SETSLIDERINFO,
|
---|
| 150 | MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS, 0),
|
---|
| 151 | MPFROM2SHORT(0, 0));
|
---|
[552] | 152 | }
|
---|
[551] | 153 | if (driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOTWRITEABLE) {
|
---|
| 154 | WinSendDlgItemMsg(hwnd,
|
---|
| 155 | INFO_LABEL,
|
---|
| 156 | EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID);
|
---|
| 157 | WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, DID_OK));
|
---|
| 158 | }
|
---|
| 159 | if (IsFullName(pszFileName)) {
|
---|
[2] | 160 |
|
---|
[551] | 161 | CHAR FileSystem[CCHMAXPATH * 2];
|
---|
[2] | 162 |
|
---|
[551] | 163 | sprintf(FileSystem,
|
---|
| 164 | GetPString(IDS_DRIVEINFOTITLETEXT), toupper(*pszFileName));
|
---|
| 165 | WinSetWindowText(hwnd, FileSystem);
|
---|
[575] | 166 | if (CheckDrive(toupper(*pszFileName), FileSystem, &type) != -1){
|
---|
[2] | 167 |
|
---|
[551] | 168 | FSALLOCATE fsa;
|
---|
[2] | 169 |
|
---|
[552] | 170 | if (type & (DRIVE_REMOTE | DRIVE_ZIPSTREAM | DRIVE_VIRTUAL)) {
|
---|
[2] | 171 |
|
---|
[551] | 172 | CHAR Path[3], *pfsn, *pfsd;
|
---|
| 173 | ULONG Size;
|
---|
| 174 | APIRET rc;
|
---|
| 175 | PFSQBUFFER2 pfsq;
|
---|
[2] | 176 |
|
---|
[551] | 177 | Path[0] = toupper(*pszFileName);
|
---|
| 178 | Path[1] = ':';
|
---|
| 179 | Path[2] = 0;
|
---|
| 180 | Size = sizeof(s);
|
---|
| 181 | DosError(FERR_DISABLEHARDERR);
|
---|
| 182 | rc = DosQueryFSAttach(Path,
|
---|
| 183 | 0, FSAIL_QUERYNAME, (PFSQBUFFER2) s, &Size);
|
---|
| 184 | if (!rc) {
|
---|
| 185 | pfsq = (PFSQBUFFER2) s;
|
---|
[689] | 186 | pfsn = (PCHAR)(pfsq->szName) + pfsq->cbName + 1;
|
---|
[551] | 187 | pfsd = pfsn + pfsq->cbFSDName + 1;
|
---|
| 188 | if (pfsq->cbFSAData && pfsd && *pfsd) {
|
---|
| 189 | sprintf(s, " (%s)", pfsd);
|
---|
| 190 | WinSetDlgItemText(hwnd, INFO_REALPATH, s);
|
---|
| 191 | }
|
---|
| 192 | }
|
---|
| 193 | }
|
---|
[2] | 194 |
|
---|
[551] | 195 | DosError(FERR_DISABLEHARDERR);
|
---|
| 196 | if (!DosQueryFSInfo(toupper(*pszFileName) - '@',
|
---|
| 197 | FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) {
|
---|
[2] | 198 |
|
---|
[551] | 199 | struct
|
---|
| 200 | {
|
---|
| 201 | ULONG serial;
|
---|
| 202 | CHAR volumelength;
|
---|
| 203 | CHAR volumelabel[CCHMAXPATH];
|
---|
| 204 | }
|
---|
| 205 | volser;
|
---|
| 206 | USHORT percentfree, percentused;
|
---|
[2] | 207 |
|
---|
[551] | 208 | memset(&volser, 0, sizeof(volser));
|
---|
| 209 | DosError(FERR_DISABLEHARDERR);
|
---|
| 210 | if (!DosQueryFSInfo(toupper(*pszFileName) - '@',
|
---|
| 211 | FSIL_VOLSER,
|
---|
| 212 | &volser, (ULONG) sizeof(volser))) {
|
---|
| 213 | WinSetDlgItemText(hwnd, INFO_FS, FileSystem);
|
---|
| 214 | WinSetDlgItemText(hwnd, INFO_LABEL, volser.volumelabel);
|
---|
| 215 | sprintf(s, "%lx", volser.serial);
|
---|
[575] | 216 | WinSetDlgItemText(hwnd, INFO_SERIAL, s);
|
---|
| 217 | FlagMsg(*pszFileName, s);
|
---|
[552] | 218 | WinSetDlgItemText(hwnd, INFO_FLAGS, s);
|
---|
[575] | 219 | if (!(driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOSTATS)){
|
---|
[551] | 220 | CommaFmtULL(szMB, sizeof(szMB),
|
---|
| 221 | (ULONGLONG) fsa.cUnit *
|
---|
| 222 | (fsa.cSectorUnit * fsa.cbSector), 'M');
|
---|
| 223 | CommaFmtULL(szKB, sizeof(szKB),
|
---|
| 224 | (ULONGLONG) fsa.cUnit *
|
---|
| 225 | (fsa.cSectorUnit * fsa.cbSector), 'K');
|
---|
| 226 | CommaFmtULL(szUnits, sizeof(szUnits),
|
---|
| 227 | (ULONGLONG) fsa.cUnit, ' ');
|
---|
| 228 | sprintf(s, "%s, %s, %s %s%s", szMB, szKB, szUnits, GetPString(IDS_UNITTEXT), &"s"[fsa.cUnit == 1L]); // hack cough
|
---|
| 229 | WinSetDlgItemText(hwnd, INFO_TOTAL, s);
|
---|
[162] | 230 |
|
---|
[551] | 231 | CommaFmtULL(szMB, sizeof(szMB),
|
---|
| 232 | (ULONGLONG) fsa.cUnitAvail *
|
---|
| 233 | (fsa.cSectorUnit * fsa.cbSector), 'M');
|
---|
| 234 | CommaFmtULL(szKB, sizeof(szKB),
|
---|
| 235 | (ULONGLONG) fsa.cUnitAvail *
|
---|
| 236 | (fsa.cSectorUnit * fsa.cbSector), 'K');
|
---|
| 237 | CommaFmtULL(szUnits, sizeof(szUnits),
|
---|
| 238 | (ULONGLONG) fsa.cUnitAvail, ' ');
|
---|
[1402] | 239 | sprintf(s, "%s, %s, %s %s%s",
|
---|
| 240 | szMB, szKB, szUnits,
|
---|
| 241 | GetPString(IDS_UNITTEXT), &"s"[fsa.cUnitAvail == 1L]);
|
---|
[551] | 242 | WinSetDlgItemText(hwnd, INFO_AVAILABLE, s);
|
---|
| 243 | sprintf(s,
|
---|
[1402] | 244 | GetPString(IDS_SECTORSTEXT),
|
---|
| 245 | fsa.cbSector,
|
---|
| 246 | fsa.cSectorUnit, &"s"[fsa.cSectorUnit == 1L]);
|
---|
[551] | 247 | WinSetDlgItemText(hwnd, INFO_ALLOCUNITS, s);
|
---|
[552] | 248 |
|
---|
[551] | 249 | percentfree = (fsa.cUnitAvail && fsa.cUnit) ?
|
---|
| 250 | (fsa.cUnitAvail * 100) / fsa.cUnit : 0;
|
---|
| 251 | if (!percentfree && fsa.cUnitAvail)
|
---|
| 252 | percentfree = 1;
|
---|
| 253 | percentused = 100 - percentfree;
|
---|
| 254 | WinSendDlgItemMsg(hwnd,
|
---|
| 255 | INFO_USED,
|
---|
| 256 | SLM_SETSLIDERINFO,
|
---|
| 257 | MPFROM2SHORT(SMA_SLIDERARMPOSITION,
|
---|
| 258 | SMA_INCREMENTVALUE),
|
---|
| 259 | MPFROMSHORT(percentused));
|
---|
| 260 | WinSendDlgItemMsg(hwnd,
|
---|
| 261 | INFO_FREE,
|
---|
| 262 | SLM_SETSLIDERINFO,
|
---|
| 263 | MPFROM2SHORT(SMA_SLIDERARMPOSITION,
|
---|
| 264 | SMA_INCREMENTVALUE),
|
---|
| 265 | MPFROMSHORT(percentfree));
|
---|
| 266 | sprintf(s, "%u%%", percentused);
|
---|
| 267 | WinSetDlgItemText(hwnd, INFO_USEDPERCENT, s);
|
---|
| 268 | sprintf(s, "%u%%", percentfree);
|
---|
[575] | 269 | WinSetDlgItemText(hwnd, INFO_FREEPERCENT, s);
|
---|
| 270 | }
|
---|
| 271 | else
|
---|
| 272 | WinSetDlgItemText(hwnd, INFO_AVAILABLE, GetPString(IDS_STATSMEANINGLESSTEXT));
|
---|
[551] | 273 | }
|
---|
| 274 | else {
|
---|
| 275 | sprintf(FileSystem,
|
---|
[1402] | 276 | GetPString(IDS_CANTQUERYVOLTEXT),
|
---|
| 277 | toupper(*pszFileName));
|
---|
[551] | 278 | Notify(FileSystem);
|
---|
| 279 | WinDismissDlg(hwnd, 0);
|
---|
| 280 | }
|
---|
| 281 | }
|
---|
| 282 | else {
|
---|
| 283 | sprintf(FileSystem,
|
---|
[1402] | 284 | GetPString(IDS_CANTQUERYALLOCTEXT),
|
---|
| 285 | toupper(*pszFileName));
|
---|
[551] | 286 | Notify(FileSystem);
|
---|
| 287 | WinDismissDlg(hwnd, 0);
|
---|
| 288 | }
|
---|
| 289 | }
|
---|
| 290 | else {
|
---|
| 291 | FlagMsg(*pszFileName, s);
|
---|
| 292 | sprintf(FileSystem,
|
---|
[1402] | 293 | GetPString(IDS_DRIVEINACCESSIBLETEXT),
|
---|
| 294 | toupper(*pszFileName), s);
|
---|
[551] | 295 | Notify(FileSystem);
|
---|
| 296 | WinDismissDlg(hwnd, 0);
|
---|
| 297 | }
|
---|
[2] | 298 | }
|
---|
[551] | 299 | else {
|
---|
| 300 | WinDismissDlg(hwnd, 0);
|
---|
| 301 | }
|
---|
| 302 | }
|
---|
| 303 | else
|
---|
| 304 | WinDismissDlg(hwnd, 0);
|
---|
| 305 | break;
|
---|
[2] | 306 |
|
---|
[551] | 307 | case WM_CONTROL:
|
---|
| 308 | return 0;
|
---|
[2] | 309 |
|
---|
[551] | 310 | case WM_COMMAND:
|
---|
| 311 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 312 | case DID_CANCEL:
|
---|
| 313 | WinDismissDlg(hwnd, 0);
|
---|
| 314 | break;
|
---|
[2] | 315 |
|
---|
[551] | 316 | case IDM_HELP:
|
---|
| 317 | if (hwndHelp)
|
---|
| 318 | WinSendMsg(hwndHelp,
|
---|
| 319 | HM_DISPLAY_HELP,
|
---|
| 320 | MPFROM2SHORT(HELP_DRVINFO, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
| 321 | break;
|
---|
[2] | 322 |
|
---|
[551] | 323 | case DID_OK:
|
---|
| 324 | pszFileName = INSTDATA(hwnd);
|
---|
| 325 | if (!(driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOTWRITEABLE)) {
|
---|
[2] | 326 |
|
---|
[551] | 327 | CHAR s[CCHMAXPATHCOMP + 3];
|
---|
[2] | 328 |
|
---|
[551] | 329 | *s = 0;
|
---|
| 330 | WinQueryDlgItemText(hwnd, INFO_LABEL, CCHMAXPATHCOMP, s);
|
---|
| 331 | bstrip(s);
|
---|
| 332 | if (*s) {
|
---|
| 333 | struct
|
---|
| 334 | {
|
---|
| 335 | ULONG serial;
|
---|
| 336 | CHAR volumelength;
|
---|
| 337 | CHAR volumelabel[CCHMAXPATH];
|
---|
| 338 | }
|
---|
| 339 | volser;
|
---|
[2] | 340 |
|
---|
[551] | 341 | memset(&volser, 0, sizeof(volser));
|
---|
| 342 | DosError(FERR_DISABLEHARDERR);
|
---|
| 343 | if (!DosQueryFSInfo(toupper(*pszFileName) - '@',
|
---|
| 344 | FSIL_VOLSER,
|
---|
| 345 | &volser,
|
---|
| 346 | (ULONG) sizeof(volser)) &&
|
---|
| 347 | stricmp(s, volser.volumelabel)) {
|
---|
| 348 | memmove(s + 1, s, strlen(s) + 1);
|
---|
| 349 | *s = strlen(s + 1);
|
---|
| 350 | DosError(FERR_DISABLEHARDERR);
|
---|
| 351 | rc = DosSetFSInfo(toupper(*pszFileName) - '@',
|
---|
| 352 | 2L, (PVOID) s, (ULONG) sizeof(s));
|
---|
| 353 | if (rc) {
|
---|
| 354 | Dos_Error(MB_CANCEL, rc, hwnd, __FILE__, __LINE__,
|
---|
| 355 | "DosSetFSInfo failed");
|
---|
| 356 | }
|
---|
| 357 | }
|
---|
| 358 | }
|
---|
[2] | 359 | }
|
---|
[551] | 360 | WinDismissDlg(hwnd, 1);
|
---|
| 361 | break;
|
---|
| 362 | }
|
---|
| 363 | return 0;
|
---|
[2] | 364 | }
|
---|
[551] | 365 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 366 | }
|
---|
| 367 |
|
---|
[575] | 368 | typedef struct {
|
---|
[2] | 369 | USHORT size;
|
---|
[551] | 370 | CHAR szFileName[CCHMAXPATH];
|
---|
| 371 | BOOL madechanges;
|
---|
[575] | 372 | } FILESTUF;
|
---|
[2] | 373 |
|
---|
[575] | 374 | typedef struct {
|
---|
| 375 | USHORT size;
|
---|
| 376 | PFNWP oldproc;
|
---|
| 377 | FILESTUF *pfs;
|
---|
| 378 | HWND lasthwndMenu;
|
---|
| 379 | } ICONSTUF;
|
---|
| 380 |
|
---|
[2] | 381 | /*
|
---|
| 382 | * subclass routine to allow changing a program's icon
|
---|
| 383 | */
|
---|
| 384 |
|
---|
[551] | 385 | MRESULT EXPENTRY IconProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
[162] | 386 | {
|
---|
[575] | 387 | ICONSTUF *pis = (ICONSTUF *)WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 388 | MRESULT mr;
|
---|
| 389 | CHAR *p;
|
---|
| 390 |
|
---|
[2] | 391 | static BOOL emphasized = FALSE;
|
---|
| 392 |
|
---|
[575] | 393 | if (!pis) {
|
---|
[1398] | 394 | Runtime_Error(pszSrcFile, __LINE__, NULL);
|
---|
[575] | 395 | if (msg != WM_DESTROY)
|
---|
| 396 | return WinDefWindowProc(hwnd, msg, mp1, mp2);
|
---|
| 397 | }
|
---|
[2] | 398 |
|
---|
[551] | 399 | switch (msg) {
|
---|
| 400 | case DM_DRAGOVER:
|
---|
| 401 | if (!emphasized) {
|
---|
| 402 | emphasized = TRUE;
|
---|
| 403 | DrawTargetEmphasis(hwnd, emphasized);
|
---|
| 404 | }
|
---|
[618] | 405 | if (AcceptOneDrop(hwnd, mp1, mp2))
|
---|
[551] | 406 | return MRFROM2SHORT(DOR_DROP, DO_MOVE);
|
---|
| 407 | return MRFROM2SHORT(DOR_NEVERDROP, 0);
|
---|
[2] | 408 |
|
---|
[551] | 409 | case DM_DRAGLEAVE:
|
---|
| 410 | emphasized = FALSE;
|
---|
| 411 | DrawTargetEmphasis(hwnd, emphasized);
|
---|
| 412 | break;
|
---|
[2] | 413 |
|
---|
[551] | 414 | case DM_DROPHELP:
|
---|
| 415 | DropHelp(mp1, mp2, hwnd, GetPString(IDS_DROPCHGICONHELPTEXT));
|
---|
| 416 | return 0;
|
---|
[2] | 417 |
|
---|
[551] | 418 | case DM_DROP:
|
---|
| 419 | {
|
---|
| 420 | HPOINTER hptr;
|
---|
| 421 | CHAR szFrom[CCHMAXPATH + 2];
|
---|
| 422 | ICONINFO ici;
|
---|
[2] | 423 |
|
---|
[551] | 424 | emphasized = FALSE;
|
---|
| 425 | DrawTargetEmphasis(hwnd, emphasized);
|
---|
[618] | 426 | if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) {
|
---|
[551] | 427 | memset(&ici, 0, sizeof(ICONINFO));
|
---|
| 428 | ici.cb = sizeof(ICONINFO);
|
---|
| 429 | ici.fFormat = ICON_FILE;
|
---|
| 430 | ici.pszFileName = szFrom;
|
---|
[575] | 431 | if (!WinSetFileIcon((PSZ) pis->pfs->szFileName, (PICONINFO) & ici)) {
|
---|
[551] | 432 | ici.fFormat = ICON_CLEAR;
|
---|
[575] | 433 | WinSetFileIcon((PSZ) pis->pfs->szFileName, (PICONINFO) & ici);
|
---|
[551] | 434 | }
|
---|
[575] | 435 | hptr = WinLoadFileIcon(pis->pfs->szFileName, FALSE);
|
---|
[551] | 436 | if (!hptr)
|
---|
[575] | 437 | hptr = (!IsFile(pis->pfs->szFileName)) ? hptrDir : hptrFile;
|
---|
| 438 | if (pis && pis->oldproc) {
|
---|
[551] | 439 | WinShowWindow(hwnd, FALSE);
|
---|
[575] | 440 | pis->oldproc(hwnd, SM_SETHANDLE, MPFROMLONG(hptr), MPVOID);
|
---|
[551] | 441 | WinShowWindow(hwnd, TRUE);
|
---|
| 442 | WinInvalidateRect(WinQueryWindow(hwnd, QW_PARENT), NULL, TRUE);
|
---|
| 443 | }
|
---|
[2] | 444 | }
|
---|
[551] | 445 | }
|
---|
| 446 | return 0;
|
---|
[2] | 447 |
|
---|
[551] | 448 | case WM_PAINT:
|
---|
[575] | 449 | mr = pis->oldproc(hwnd, msg, mp1, mp2);
|
---|
| 450 | PaintRecessedWindow(hwnd, (HPS) 0, FALSE, FALSE);
|
---|
| 451 | return mr;
|
---|
[551] | 452 | break;
|
---|
[2] | 453 |
|
---|
[551] | 454 | case WM_MENUEND:
|
---|
[575] | 455 | if (pis->lasthwndMenu == (HWND)mp2)
|
---|
| 456 | WinDestroyWindow(pis->lasthwndMenu);
|
---|
| 457 | pis->lasthwndMenu = (HWND) 0;
|
---|
[551] | 458 | break;
|
---|
[2] | 459 |
|
---|
[551] | 460 | case WM_CONTEXTMENU:
|
---|
[575] | 461 | if (pis->lasthwndMenu)
|
---|
| 462 | WinDestroyWindow(pis->lasthwndMenu);
|
---|
| 463 | pis->lasthwndMenu = WinLoadMenu(hwnd, FM3ModHandle, FLE_FRAME);
|
---|
| 464 | if (pis->lasthwndMenu) {
|
---|
| 465 | p = strrchr(pis->pfs->szFileName, '.');
|
---|
[1398] | 466 | if (!p || (stricmp(p, PCSZ_DOTICO) && stricmp(p, PCSZ_DOTPTR)))
|
---|
[575] | 467 | WinSendMsg(pis->lasthwndMenu,
|
---|
| 468 | MM_DELETEITEM,
|
---|
| 469 | MPFROM2SHORT(IDM_SELECTALL, TRUE), MPVOID);
|
---|
| 470 | PopupMenu(hwnd, hwnd, pis->lasthwndMenu);
|
---|
[551] | 471 | }
|
---|
| 472 | break;
|
---|
| 473 |
|
---|
| 474 | case WM_COMMAND:
|
---|
| 475 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 476 | case IDM_SELECTALL:
|
---|
| 477 | case IDM_DESELECTALL:
|
---|
| 478 | WinDlgBox(HWND_DESKTOP,
|
---|
| 479 | hwnd,
|
---|
| 480 | SetIconDlgProc,
|
---|
| 481 | FM3ModHandle,
|
---|
| 482 | SETICON_FRAME,
|
---|
| 483 | (PVOID) ((SHORT1FROMMP(mp1) == IDM_SELECTALL) ?
|
---|
[575] | 484 | pis->pfs->szFileName : NULL));
|
---|
[2] | 485 | break;
|
---|
[551] | 486 | }
|
---|
| 487 | return 0;
|
---|
[2] | 488 |
|
---|
[551] | 489 | case WM_DESTROY:
|
---|
| 490 | emphasized = FALSE;
|
---|
[575] | 491 | if (!pis)
|
---|
| 492 | return WinDefWindowProc(hwnd, msg, mp1, mp2);
|
---|
[576] | 493 | else {
|
---|
[805] | 494 | PFNWP oldproc = pis->oldproc;
|
---|
[576] | 495 | if (pis->lasthwndMenu)
|
---|
[805] | 496 | WinDestroyWindow(pis->lasthwndMenu);
|
---|
[1039] | 497 | free(pis);
|
---|
[805] | 498 | return oldproc(hwnd, msg, mp1, mp2);
|
---|
[576] | 499 | }
|
---|
[551] | 500 | break;
|
---|
[2] | 501 | }
|
---|
| 502 |
|
---|
[575] | 503 | return pis->oldproc(hwnd, msg, mp1, mp2);
|
---|
[2] | 504 | }
|
---|
| 505 |
|
---|
[551] | 506 | MRESULT EXPENTRY FileInfoProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
[336] | 507 | {
|
---|
[575] | 508 | FILESTUF *pfs;
|
---|
| 509 | ICONSTUF *pis;
|
---|
[805] | 510 | CHAR **ppsz;
|
---|
[2] | 511 |
|
---|
[551] | 512 | switch (msg) {
|
---|
| 513 | case WM_INITDLG:
|
---|
| 514 | if (!mp2) {
|
---|
| 515 | WinDismissDlg(hwnd, 1);
|
---|
| 516 | break;
|
---|
| 517 | }
|
---|
[575] | 518 | pfs = xmallocz(sizeof(FILESTUF), pszSrcFile, __LINE__);
|
---|
| 519 | if (!pfs) {
|
---|
[551] | 520 | WinDismissDlg(hwnd, 1);
|
---|
| 521 | break;
|
---|
| 522 | }
|
---|
[575] | 523 | pfs->size = sizeof(FILESTUF);
|
---|
| 524 | WinSetWindowPtr(hwnd, QWL_USER, pfs);
|
---|
[551] | 525 | {
|
---|
| 526 | USHORT ids[] = { FLE_SIZES, FLE_SLACK, FLE_LASTWRITE, FLE_CREATE,
|
---|
| 527 | FLE_LASTACCESS, 0
|
---|
| 528 | };
|
---|
| 529 | INT x;
|
---|
| 530 | CHAR s[CCHMAXPATH];
|
---|
| 531 |
|
---|
[805] | 532 | ppsz = (CHAR **)mp2;
|
---|
| 533 | for (x = 0; ppsz[x]; x++) {
|
---|
| 534 | if (DosQueryPathInfo(ppsz[x], FIL_QUERYFULLNAME, s, sizeof(s)))
|
---|
| 535 | strcpy(s, ppsz[x]);
|
---|
[551] | 536 | WinSendDlgItemMsg(hwnd,
|
---|
| 537 | FLE_NAME,
|
---|
| 538 | LM_INSERTITEM,
|
---|
| 539 | MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(s));
|
---|
[2] | 540 | }
|
---|
[551] | 541 | if (!x) {
|
---|
| 542 | WinDismissDlg(hwnd, 1);
|
---|
| 543 | break;
|
---|
[2] | 544 | }
|
---|
[551] | 545 | WinSendDlgItemMsg(hwnd,
|
---|
| 546 | FLE_NAME,
|
---|
| 547 | LM_SELECTITEM, MPFROM2SHORT(0, 0), MPFROMSHORT(TRUE));
|
---|
| 548 | for (x = 0; ids[x]; x++)
|
---|
| 549 | SetPresParams(WinWindowFromID(hwnd, ids[x]),
|
---|
| 550 | &RGBGREY, &RGBBLACK, &RGBBLACK, NULL);
|
---|
| 551 | }
|
---|
[575] | 552 | pis = xmallocz(sizeof(ICONSTUF), pszSrcFile, __LINE__);
|
---|
| 553 | if (!pis) {
|
---|
| 554 | WinDismissDlg(hwnd, 1);
|
---|
| 555 | break;
|
---|
| 556 | }
|
---|
| 557 | WinSetWindowPtr(WinWindowFromID(hwnd, FLE_ICON), QWL_USER, (PVOID) pis);
|
---|
| 558 | pis->size = sizeof(ICONSTUF);
|
---|
| 559 | pis->pfs = pfs;
|
---|
| 560 | pis->oldproc = WinSubclassWindow(WinWindowFromID(hwnd, FLE_ICON),
|
---|
[551] | 561 | IconProc);
|
---|
| 562 | break;
|
---|
[2] | 563 |
|
---|
[551] | 564 | case WM_CONTROL:
|
---|
| 565 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 566 | case FLE_READONLY:
|
---|
| 567 | case FLE_ARCHIVED:
|
---|
| 568 | case FLE_SYSTEM:
|
---|
| 569 | case FLE_HIDDEN:
|
---|
| 570 | switch (SHORT2FROMMP(mp1)) {
|
---|
| 571 | case BN_CLICKED:
|
---|
[575] | 572 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 573 | if (pfs && *pfs->szFileName) {
|
---|
[551] | 574 |
|
---|
| 575 | LISTINFO li;
|
---|
[907] | 576 | UINT numfiles = 0, numalloc = 0;
|
---|
[551] | 577 |
|
---|
| 578 | memset(&li, 0, sizeof(LISTINFO));
|
---|
[575] | 579 | if (!AddToList(pfs->szFileName, &li.list, &numfiles, &numalloc)) {
|
---|
[551] | 580 | if (WinDlgBox(HWND_DESKTOP,
|
---|
| 581 | hwnd,
|
---|
| 582 | AttrListDlgProc,
|
---|
| 583 | FM3ModHandle,
|
---|
| 584 | ATR_FRAME, MPFROMP(&li)) && li.list && li.list[0]) {
|
---|
[575] | 585 | pfs->madechanges = TRUE;
|
---|
[551] | 586 | WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID);
|
---|
| 587 | }
|
---|
| 588 | FreeList(li.list);
|
---|
| 589 | }
|
---|
| 590 | }
|
---|
| 591 | break;
|
---|
[805] | 592 | } // switch
|
---|
[2] | 593 | break;
|
---|
[551] | 594 | case FLE_NAME:
|
---|
| 595 | switch (SHORT2FROMMP(mp1)) {
|
---|
| 596 | case LN_ENTER:
|
---|
| 597 | case LN_SELECT:
|
---|
[575] | 598 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 599 | if (!pfs) {
|
---|
[1398] | 600 | Runtime_Error(pszSrcFile, __LINE__, NULL);
|
---|
[551] | 601 | WinDismissDlg(hwnd, 1);
|
---|
| 602 | }
|
---|
| 603 | else {
|
---|
[2] | 604 |
|
---|
[551] | 605 | SHORT sSelect;
|
---|
[2] | 606 |
|
---|
[551] | 607 | sSelect = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 608 | FLE_NAME,
|
---|
| 609 | LM_QUERYSELECTION,
|
---|
| 610 | MPFROMSHORT(LIT_FIRST), MPVOID);
|
---|
| 611 | if (sSelect >= 0) {
|
---|
[575] | 612 | *pfs->szFileName = 0;
|
---|
[551] | 613 | WinSendDlgItemMsg(hwnd,
|
---|
| 614 | FLE_NAME,
|
---|
| 615 | LM_QUERYITEMTEXT,
|
---|
| 616 | MPFROM2SHORT(sSelect, CCHMAXPATH),
|
---|
[575] | 617 | MPFROMP(pfs->szFileName));
|
---|
| 618 | if (*pfs->szFileName) {
|
---|
[551] | 619 | if (SHORT2FROMMP(mp1) == LN_SELECT)
|
---|
| 620 | WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID);
|
---|
| 621 | else
|
---|
| 622 | DefaultView(hwnd,
|
---|
[575] | 623 | (HWND) 0, (HWND) 0, NULL, 32, pfs->szFileName);
|
---|
[551] | 624 | }
|
---|
| 625 | }
|
---|
| 626 | }
|
---|
| 627 | break;
|
---|
| 628 | }
|
---|
| 629 | break;
|
---|
| 630 | }
|
---|
| 631 | return 0;
|
---|
[2] | 632 |
|
---|
[551] | 633 | case UM_SETDIR:
|
---|
| 634 | WinCheckButton(hwnd, FLE_READONLY, FALSE);
|
---|
| 635 | WinCheckButton(hwnd, FLE_ARCHIVED, FALSE);
|
---|
| 636 | WinCheckButton(hwnd, FLE_SYSTEM, FALSE);
|
---|
| 637 | WinCheckButton(hwnd, FLE_HIDDEN, FALSE);
|
---|
| 638 | WinCheckButton(hwnd, FLE_DIRECTORY, FALSE);
|
---|
| 639 | WinCheckButton(hwnd, FLE_READABLE, FALSE);
|
---|
| 640 | WinCheckButton(hwnd, FLE_WRITEABLE, FALSE);
|
---|
| 641 | WinCheckButton(hwnd, FLE_OPEN, FALSE);
|
---|
| 642 | WinCheckButton(hwnd, FLE_BINARY, FALSE);
|
---|
| 643 | WinCheckButton(hwnd, FLE_ISARCHIVE, FALSE);
|
---|
| 644 | WinSetDlgItemText(hwnd, FLE_ARCNAME, NullStr);
|
---|
| 645 | WinCheckButton(hwnd, FLE_OS2FS, FALSE);
|
---|
| 646 | WinCheckButton(hwnd, FLE_OS2WIN, FALSE);
|
---|
| 647 | WinCheckButton(hwnd, FLE_OS2PM, FALSE);
|
---|
| 648 | WinCheckButton(hwnd, FLE_DOS, FALSE);
|
---|
| 649 | WinCheckButton(hwnd, FLE_32BIT, FALSE);
|
---|
| 650 | WinCheckButton(hwnd, FLE_WINREAL, FALSE);
|
---|
| 651 | WinCheckButton(hwnd, FLE_WINPROT, FALSE);
|
---|
| 652 | WinCheckButton(hwnd, FLE_WINENH, FALSE);
|
---|
| 653 | WinCheckButton(hwnd, FLE_DLL, FALSE);
|
---|
| 654 | WinCheckButton(hwnd, FLE_PHYSDRV, FALSE);
|
---|
| 655 | WinCheckButton(hwnd, FLE_VIRTDRV, FALSE);
|
---|
| 656 | WinCheckButton(hwnd, FLE_PROTDLL, FALSE);
|
---|
[575] | 657 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 658 | if (pfs && *pfs->szFileName) {
|
---|
[551] | 659 | CHAR s[97];
|
---|
[897] | 660 | CHAR szCmmaFmtFileSize[81], szCmmaFmtEASize[81];
|
---|
[1397] | 661 | CHAR szCmmaFmtFileEASize[81], szCmmaFmtFileEASizeK[81], szDate[DATE_BUF_BYTES];
|
---|
[841] | 662 | FILEFINDBUF4L fs;
|
---|
[551] | 663 | HDIR hdir = HDIR_CREATE;
|
---|
[841] | 664 | ULONG apptype = 1;
|
---|
[551] | 665 | FILE *fp;
|
---|
| 666 | HPOINTER hptr;
|
---|
| 667 | ARC_TYPE *info;
|
---|
[2] | 668 |
|
---|
[551] | 669 | DosError(FERR_DISABLEHARDERR);
|
---|
[838] | 670 | if (xDosFindFirst(pfs->szFileName,
|
---|
| 671 | &hdir,
|
---|
| 672 | FILE_NORMAL | FILE_ARCHIVED |
|
---|
| 673 | FILE_DIRECTORY | FILE_READONLY | FILE_HIDDEN |
|
---|
| 674 | FILE_SYSTEM,
|
---|
[841] | 675 | &fs, sizeof(fs), &apptype, FIL_QUERYEASIZEL)) {
|
---|
[551] | 676 | // Not found
|
---|
| 677 | SHORT sSelect, numitems;
|
---|
[2] | 678 |
|
---|
[1395] | 679 | if (!fAlertBeepOff)
|
---|
| 680 | DosBeep(250, 100); // Wake up user
|
---|
[551] | 681 | sSelect = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 682 | FLE_NAME,
|
---|
| 683 | LM_QUERYSELECTION,
|
---|
| 684 | MPFROMSHORT(LIT_FIRST), MPVOID);
|
---|
| 685 | if (sSelect >= 0) {
|
---|
| 686 | WinSendDlgItemMsg(hwnd,
|
---|
| 687 | FLE_NAME,
|
---|
| 688 | LM_DELETEITEM, MPFROMSHORT(sSelect), MPVOID);
|
---|
| 689 | numitems = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 690 | FLE_NAME,
|
---|
| 691 | LM_QUERYITEMCOUNT,
|
---|
| 692 | MPVOID, MPVOID);
|
---|
| 693 | if (numitems)
|
---|
| 694 | PostMsg(WinWindowFromID(hwnd, FLE_NAME),
|
---|
| 695 | LM_SELECTITEM,
|
---|
| 696 | MPFROMSHORT(((sSelect) ? sSelect - 1 : 0)),
|
---|
| 697 | MPFROMSHORT(TRUE));
|
---|
| 698 | }
|
---|
[2] | 699 | }
|
---|
[551] | 700 | else {
|
---|
[1395] | 701 | DosFindClose(hdir);
|
---|
| 702 | FDateFormat(szDate, fs.fdateLastWrite);
|
---|
| 703 | sprintf(s, "%s %02u%s%02u%s%02u",
|
---|
| 704 | szDate,
|
---|
| 705 | fs.ftimeLastWrite.hours, TimeSeparator,
|
---|
| 706 | fs.ftimeLastWrite.minutes, TimeSeparator, fs.ftimeLastWrite.twosecs * 2);
|
---|
[551] | 707 | WinSetDlgItemText(hwnd, FLE_LASTWRITE, s);
|
---|
| 708 | if (fs.fdateCreation.year &&
|
---|
[1395] | 709 | fs.fdateCreation.month && fs.fdateCreation.day) {
|
---|
| 710 | FDateFormat(szDate, fs.fdateCreation);
|
---|
| 711 | sprintf(s, "%s %02u%s%02u%s%02u",
|
---|
| 712 | szDate,
|
---|
| 713 | fs.ftimeCreation.hours, TimeSeparator,
|
---|
| 714 | fs.ftimeCreation.minutes, TimeSeparator, fs.ftimeCreation.twosecs * 2);
|
---|
[551] | 715 | WinSetDlgItemText(hwnd, FLE_CREATE, s);
|
---|
| 716 | }
|
---|
| 717 | if (fs.fdateLastAccess.year &&
|
---|
[1395] | 718 | fs.fdateLastAccess.month && fs.fdateLastAccess.day) {
|
---|
| 719 | FDateFormat(szDate, fs.fdateLastAccess);
|
---|
| 720 | sprintf(s, "%s %02u%s%02u%s%02u",
|
---|
| 721 | szDate,
|
---|
| 722 | fs.ftimeLastAccess.hours, TimeSeparator,
|
---|
| 723 | fs.ftimeLastAccess.minutes, TimeSeparator, fs.ftimeLastAccess.twosecs * 2);
|
---|
[551] | 724 | WinSetDlgItemText(hwnd, FLE_LASTACCESS, s);
|
---|
| 725 | }
|
---|
[897] | 726 | CommaFmtULL(szCmmaFmtFileSize,
|
---|
| 727 | sizeof(szCmmaFmtFileSize), fs.cbFile, ' ');
|
---|
| 728 | CommaFmtULL(szCmmaFmtEASize,
|
---|
| 729 | sizeof(szCmmaFmtEASize), CBLIST_TO_EASIZE(fs.cbList), ' ');
|
---|
| 730 | CommaFmtULL(szCmmaFmtFileEASize,
|
---|
| 731 | sizeof(szCmmaFmtFileEASize),
|
---|
| 732 | fs.cbFile + CBLIST_TO_EASIZE(fs.cbList),
|
---|
| 733 | ' ');
|
---|
| 734 | CommaFmtULL(szCmmaFmtFileEASizeK,
|
---|
| 735 | sizeof(szCmmaFmtFileEASizeK),
|
---|
| 736 | fs.cbFile + CBLIST_TO_EASIZE(fs.cbList),
|
---|
| 737 | 'K');
|
---|
[551] | 738 | sprintf(s,
|
---|
| 739 | GetPString(IDS_SIZEINCLEASTEXT),
|
---|
[897] | 740 | szCmmaFmtFileSize,
|
---|
| 741 | szCmmaFmtEASize,
|
---|
| 742 | szCmmaFmtFileEASize,
|
---|
| 743 | szCmmaFmtFileEASizeK);
|
---|
[551] | 744 | WinSetDlgItemText(hwnd, FLE_SIZES, s);
|
---|
[897] | 745 | CommaFmtULL(szCmmaFmtFileSize,
|
---|
| 746 | sizeof(szCmmaFmtFileSize), fs.cbFileAlloc - fs.cbFile, ' ');
|
---|
| 747 | sprintf(s, "%s", szCmmaFmtFileSize);
|
---|
[551] | 748 | WinSetDlgItemText(hwnd, FLE_SLACK, s);
|
---|
| 749 | WinCheckButton(hwnd,
|
---|
| 750 | FLE_READONLY, ((fs.attrFile & FILE_READONLY) != 0));
|
---|
| 751 | WinCheckButton(hwnd,
|
---|
| 752 | FLE_ARCHIVED, ((fs.attrFile & FILE_ARCHIVED) != 0));
|
---|
| 753 | WinCheckButton(hwnd,
|
---|
| 754 | FLE_DIRECTORY, ((fs.attrFile & FILE_DIRECTORY) != 0));
|
---|
| 755 | WinCheckButton(hwnd, FLE_HIDDEN, ((fs.attrFile & FILE_HIDDEN) != 0));
|
---|
| 756 | WinCheckButton(hwnd, FLE_SYSTEM, ((fs.attrFile & FILE_SYSTEM) != 0));
|
---|
| 757 | DosError(FERR_DISABLEHARDERR);
|
---|
[575] | 758 | if (!DosQueryAppType(pfs->szFileName, &apptype)) {
|
---|
[551] | 759 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2FS), TRUE);
|
---|
| 760 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2WIN), TRUE);
|
---|
| 761 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2PM), TRUE);
|
---|
| 762 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BOUND), TRUE);
|
---|
| 763 | WinEnableWindow(WinWindowFromID(hwnd, FLE_32BIT), TRUE);
|
---|
| 764 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DOS), TRUE);
|
---|
| 765 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINPROT), TRUE);
|
---|
| 766 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINREAL), TRUE);
|
---|
| 767 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINENH), TRUE);
|
---|
| 768 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DLL), TRUE);
|
---|
| 769 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PHYSDRV), TRUE);
|
---|
| 770 | WinEnableWindow(WinWindowFromID(hwnd, FLE_VIRTDRV), TRUE);
|
---|
| 771 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PROTDLL), TRUE);
|
---|
| 772 | WinCheckButton(hwnd, FLE_OS2FS,
|
---|
| 773 | ((apptype & FAPPTYP_NOTWINDOWCOMPAT) &&
|
---|
| 774 | !(apptype & FAPPTYP_WINDOWCOMPAT)));
|
---|
| 775 | WinCheckButton(hwnd, FLE_OS2WIN,
|
---|
| 776 | ((apptype & FAPPTYP_WINDOWCOMPAT) &&
|
---|
| 777 | !(apptype & FAPPTYP_NOTWINDOWCOMPAT)));
|
---|
| 778 | WinCheckButton(hwnd, FLE_OS2PM,
|
---|
| 779 | ((apptype & FAPPTYP_WINDOWAPI) ==
|
---|
| 780 | FAPPTYP_WINDOWAPI));
|
---|
| 781 | WinCheckButton(hwnd, FLE_BOUND, ((apptype & FAPPTYP_BOUND) != 0));
|
---|
| 782 | WinCheckButton(hwnd, FLE_DLL, ((apptype & FAPPTYP_DLL) != 0));
|
---|
| 783 | WinCheckButton(hwnd, FLE_DOS, ((apptype & FAPPTYP_DOS) != 0));
|
---|
| 784 | WinCheckButton(hwnd, FLE_PHYSDRV,
|
---|
| 785 | ((apptype & FAPPTYP_PHYSDRV) != 0));
|
---|
| 786 | WinCheckButton(hwnd, FLE_VIRTDRV,
|
---|
| 787 | ((apptype & FAPPTYP_VIRTDRV) != 0));
|
---|
| 788 | WinCheckButton(hwnd, FLE_PROTDLL,
|
---|
| 789 | ((apptype & FAPPTYP_PROTDLL) != 0));
|
---|
| 790 | WinCheckButton(hwnd, FLE_WINREAL,
|
---|
| 791 | ((apptype & FAPPTYP_WINDOWSREAL) != 0));
|
---|
| 792 | WinCheckButton(hwnd, FLE_WINPROT,
|
---|
| 793 | ((apptype & FAPPTYP_WINDOWSPROT) != 0));
|
---|
| 794 | WinCheckButton(hwnd, FLE_32BIT, ((apptype & FAPPTYP_32BIT) != 0));
|
---|
| 795 | WinCheckButton(hwnd, FLE_WINENH, ((apptype & 0x1000) != 0));
|
---|
| 796 | }
|
---|
| 797 | else {
|
---|
| 798 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2FS), FALSE);
|
---|
| 799 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2WIN), FALSE);
|
---|
| 800 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2PM), FALSE);
|
---|
| 801 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BOUND), FALSE);
|
---|
| 802 | WinEnableWindow(WinWindowFromID(hwnd, FLE_32BIT), FALSE);
|
---|
| 803 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DOS), FALSE);
|
---|
| 804 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINPROT), FALSE);
|
---|
| 805 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINREAL), FALSE);
|
---|
| 806 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINENH), FALSE);
|
---|
| 807 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DLL), FALSE);
|
---|
| 808 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PHYSDRV), FALSE);
|
---|
| 809 | WinEnableWindow(WinWindowFromID(hwnd, FLE_VIRTDRV), FALSE);
|
---|
| 810 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PROTDLL), FALSE);
|
---|
| 811 | }
|
---|
[575] | 812 | hptr = WinLoadFileIcon(pfs->szFileName, FALSE);
|
---|
[551] | 813 | WinShowWindow(WinWindowFromID(hwnd, FLE_ICON), FALSE);
|
---|
| 814 | if (hptr) {
|
---|
| 815 | WinSendDlgItemMsg(hwnd,
|
---|
| 816 | FLE_ICON, SM_SETHANDLE, MPFROMLONG(hptr), MPVOID);
|
---|
| 817 | WinShowWindow(WinWindowFromID(hwnd, FLE_ICON), TRUE);
|
---|
| 818 | }
|
---|
| 819 | WinShowWindow(WinWindowFromID(hwnd, FLE_EAS), fs.cbList > 4);
|
---|
| 820 | if (!(fs.attrFile & FILE_DIRECTORY)) {
|
---|
| 821 | WinEnableWindow(WinWindowFromID(hwnd, FLE_READABLE), TRUE);
|
---|
| 822 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WRITEABLE), TRUE);
|
---|
| 823 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OPEN), TRUE);
|
---|
| 824 | WinEnableWindow(WinWindowFromID(hwnd, FLE_ISARCHIVE), TRUE);
|
---|
| 825 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BINARY), TRUE);
|
---|
[805] | 826 | fp = _fsopen(pfs->szFileName, "rb", SH_DENYNO);
|
---|
[551] | 827 | if (fp) {
|
---|
[850] | 828 | char buff[4096]; // 06 Oct 07 SHL protect against NTFS defect
|
---|
[551] | 829 | ULONG len;
|
---|
| 830 | APIRET rc;
|
---|
[2] | 831 |
|
---|
[551] | 832 | len = 512;
|
---|
| 833 | rc = DosRead(fileno(fp), buff, len, &len);
|
---|
| 834 | fclose(fp);
|
---|
| 835 | WinCheckButton(hwnd,
|
---|
| 836 | FLE_BINARY,
|
---|
| 837 | ((len && rc) ? IsBinary(buff, len) : 2));
|
---|
| 838 | WinCheckButton(hwnd, FLE_READABLE, TRUE);
|
---|
[575] | 839 | info = find_type(pfs->szFileName, NULL);
|
---|
[551] | 840 | if (info) {
|
---|
| 841 | WinCheckButton(hwnd, FLE_ISARCHIVE, 1);
|
---|
| 842 | if (info->id)
|
---|
| 843 | WinSetDlgItemText(hwnd, FLE_ARCNAME, info->id);
|
---|
| 844 | }
|
---|
| 845 | }
|
---|
| 846 | else {
|
---|
| 847 | WinCheckButton(hwnd, FLE_ISARCHIVE, 2);
|
---|
| 848 | WinCheckButton(hwnd, FLE_BINARY, 2);
|
---|
| 849 | }
|
---|
[575] | 850 | fp = _fsopen(pfs->szFileName, "ab", SH_DENYNO);
|
---|
[551] | 851 | if (fp) {
|
---|
| 852 | WinCheckButton(hwnd, FLE_WRITEABLE, TRUE);
|
---|
| 853 | fclose(fp);
|
---|
| 854 | }
|
---|
[575] | 855 | fp = _fsopen(pfs->szFileName, "rb", SH_DENYRW);
|
---|
[551] | 856 | if (!fp)
|
---|
| 857 | WinCheckButton(hwnd, FLE_OPEN, TRUE);
|
---|
| 858 | else
|
---|
| 859 | fclose(fp);
|
---|
| 860 | }
|
---|
| 861 | else {
|
---|
| 862 | WinEnableWindow(WinWindowFromID(hwnd, FLE_READABLE), FALSE);
|
---|
| 863 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WRITEABLE), FALSE);
|
---|
| 864 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OPEN), FALSE);
|
---|
| 865 | WinEnableWindow(WinWindowFromID(hwnd, FLE_ISARCHIVE), FALSE);
|
---|
| 866 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BINARY), FALSE);
|
---|
| 867 | }
|
---|
[2] | 868 | }
|
---|
[551] | 869 | }
|
---|
| 870 | return 0;
|
---|
[2] | 871 |
|
---|
[551] | 872 | case WM_COMMAND:
|
---|
| 873 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 874 | case DID_OK:
|
---|
[575] | 875 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 876 | WinDismissDlg(hwnd, (pfs && pfs->madechanges) ? 2 : 1);
|
---|
[551] | 877 | break;
|
---|
| 878 | case IDM_HELP:
|
---|
| 879 | if (hwndHelp)
|
---|
| 880 | WinSendMsg(hwndHelp,
|
---|
| 881 | HM_DISPLAY_HELP,
|
---|
| 882 | MPFROM2SHORT(HELP_INFO, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
| 883 | break;
|
---|
| 884 | case FLE_SETTINGS:
|
---|
[575] | 885 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 886 | if (pfs && *pfs->szFileName)
|
---|
| 887 | OpenObject(pfs->szFileName, Settings, hwnd);
|
---|
[551] | 888 | break;
|
---|
| 889 | case FLE_EAS:
|
---|
[575] | 890 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 891 | if (pfs && *pfs->szFileName) {
|
---|
[2] | 892 |
|
---|
[551] | 893 | CHAR *list[2];
|
---|
[2] | 894 |
|
---|
[575] | 895 | list[0] = pfs->szFileName;
|
---|
[551] | 896 | list[1] = NULL;
|
---|
| 897 | WinDlgBox(HWND_DESKTOP,
|
---|
| 898 | hwnd, DisplayEAsProc, FM3ModHandle, EA_FRAME, (PVOID) list);
|
---|
[2] | 899 | }
|
---|
[551] | 900 | break;
|
---|
| 901 | case DID_CANCEL:
|
---|
[575] | 902 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 903 | WinDismissDlg(hwnd, (pfs && pfs->madechanges) ? 2 : 0);
|
---|
[551] | 904 | break;
|
---|
| 905 | }
|
---|
| 906 | return 0;
|
---|
[2] | 907 |
|
---|
[551] | 908 | case WM_DESTROY:
|
---|
[575] | 909 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
[1009] | 910 | xfree(pfs, pszSrcFile, __LINE__);
|
---|
[551] | 911 | break;
|
---|
[2] | 912 | }
|
---|
[551] | 913 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 914 | }
|
---|
| 915 |
|
---|
[551] | 916 | MRESULT EXPENTRY SetDrvProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
[336] | 917 | {
|
---|
[551] | 918 | switch (msg) {
|
---|
| 919 | case WM_INITDLG:
|
---|
[1009] | 920 | if (!mp2 || !isalpha(*(CHAR *)mp2))
|
---|
[551] | 921 | WinDismissDlg(hwnd, 0);
|
---|
| 922 | else {
|
---|
[2] | 923 |
|
---|
[551] | 924 | CHAR s[80];
|
---|
[2] | 925 |
|
---|
[1009] | 926 | WinSetWindowULong(hwnd, QWL_USER, (toupper(*(CHAR *)mp2) - 'A'));
|
---|
| 927 | sprintf(s, GetPString(IDS_DRIVEFLAGSTITLETEXT), toupper(*(CHAR *)mp2));
|
---|
[551] | 928 | WinSetWindowText(hwnd, s);
|
---|
[2] | 929 | /*
|
---|
[575] | 930 | WinEnableWindow(WinWindowFromID(hwnd,DVS_REMOVABLE),FALSE);
|
---|
| 931 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOTWRITEABLE),FALSE);
|
---|
| 932 | WinEnableWindow(WinWindowFromID(hwnd,DVS_IGNORE),FALSE);
|
---|
| 933 | WinEnableWindow(WinWindowFromID(hwnd,DVS_CDROM),FALSE);
|
---|
| 934 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOLONGNAMES),FALSE);
|
---|
| 935 | WinEnableWindow(WinWindowFromID(hwnd,DVS_REMOTE),FALSE);
|
---|
| 936 | WinEnableWindow(WinWindowFromID(hwnd,DVS_VIRTUAL),FALSE);
|
---|
| 937 | WinEnableWindow(WinWindowFromID(hwnd,DVS_RAMDISK),FALSE);
|
---|
| 938 | WinEnableWindow(WinWindowFromID(hwnd,DVS_BOOT),FALSE);
|
---|
| 939 | WinEnableWindow(WinWindowFromID(hwnd,DVS_INVALID),FALSE);
|
---|
| 940 | WinEnableWindow(WinWindowFromID(hwnd,DVS_ZIPSTREAM),FALSE);
|
---|
| 941 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOSTATS),FALSE);
|
---|
[2] | 942 | */
|
---|
[551] | 943 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
| 944 | }
|
---|
| 945 | break;
|
---|
[2] | 946 |
|
---|
[551] | 947 | case UM_UNDO:
|
---|
| 948 | {
|
---|
| 949 | ULONG drive = WinQueryWindowULong(hwnd, QWL_USER);
|
---|
[2] | 950 |
|
---|
[551] | 951 | WinCheckButton(hwnd, DVS_REMOVABLE,
|
---|
| 952 | ((driveflags[drive] & DRIVE_REMOVABLE) != 0));
|
---|
| 953 | WinCheckButton(hwnd, DVS_NOTWRITEABLE,
|
---|
| 954 | ((driveflags[drive] & DRIVE_NOTWRITEABLE) != 0));
|
---|
| 955 | WinCheckButton(hwnd, DVS_IGNORE,
|
---|
| 956 | ((driveflags[drive] & DRIVE_IGNORE) != 0));
|
---|
| 957 | WinCheckButton(hwnd, DVS_CDROM,
|
---|
| 958 | ((driveflags[drive] & DRIVE_CDROM) != 0));
|
---|
| 959 | WinCheckButton(hwnd, DVS_NOLONGNAMES,
|
---|
| 960 | ((driveflags[drive] & DRIVE_NOLONGNAMES) != 0));
|
---|
| 961 | WinCheckButton(hwnd, DVS_REMOTE,
|
---|
| 962 | ((driveflags[drive] & DRIVE_REMOTE) != 0));
|
---|
[552] | 963 | WinCheckButton(hwnd,DVS_VIRTUAL,
|
---|
[575] | 964 | ((driveflags[drive] & DRIVE_VIRTUAL) != 0));
|
---|
[552] | 965 | WinCheckButton(hwnd,DVS_RAMDISK,
|
---|
[575] | 966 | ((driveflags[drive] & DRIVE_RAMDISK) != 0));
|
---|
[552] | 967 | WinCheckButton(hwnd, DVS_BOOT,
|
---|
[575] | 968 | ((driveflags[drive] & DRIVE_BOOT) != 0));
|
---|
[551] | 969 | WinCheckButton(hwnd, DVS_INVALID,
|
---|
| 970 | ((driveflags[drive] & DRIVE_INVALID) != 0));
|
---|
| 971 | WinCheckButton(hwnd, DVS_NOPRESCAN,
|
---|
| 972 | ((driveflags[drive] & DRIVE_NOPRESCAN) != 0));
|
---|
| 973 | WinCheckButton(hwnd, DVS_ZIPSTREAM,
|
---|
| 974 | ((driveflags[drive] & DRIVE_ZIPSTREAM) != 0));
|
---|
| 975 | WinCheckButton(hwnd, DVS_NOLOADICONS,
|
---|
| 976 | ((driveflags[drive] & DRIVE_NOLOADICONS) != 0));
|
---|
| 977 | WinCheckButton(hwnd, DVS_NOLOADSUBJS,
|
---|
| 978 | ((driveflags[drive] & DRIVE_NOLOADSUBJS) != 0));
|
---|
| 979 | WinCheckButton(hwnd, DVS_NOLOADLONGS,
|
---|
| 980 | ((driveflags[drive] & DRIVE_NOLOADLONGS) != 0));
|
---|
| 981 | WinCheckButton(hwnd, DVS_SLOW, ((driveflags[drive] & DRIVE_SLOW) != 0));
|
---|
| 982 | WinCheckButton(hwnd, DVS_INCLUDEFILES,
|
---|
| 983 | ((driveflags[drive] & DRIVE_INCLUDEFILES) != 0));
|
---|
[552] | 984 | WinCheckButton(hwnd,DVS_NOSTATS,
|
---|
[1354] | 985 | ((driveflags[drive] & DRIVE_NOSTATS) != 0));
|
---|
| 986 | WinCheckButton(hwnd,DVS_WRITEVERIFYOFF,
|
---|
| 987 | ((driveflags[drive] & DRIVE_WRITEVERIFYOFF) != 0));
|
---|
| 988 | WinCheckButton(hwnd,DVS_RSCANNED,
|
---|
| 989 | ((driveflags[drive] & DRIVE_RSCANNED) != 0));
|
---|
[551] | 990 | }
|
---|
| 991 | return 0;
|
---|
[2] | 992 |
|
---|
[551] | 993 | case WM_CONTROL:
|
---|
| 994 | return 0;
|
---|
[2] | 995 |
|
---|
[551] | 996 | case WM_COMMAND:
|
---|
| 997 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 998 | case DID_OK:
|
---|
| 999 | {
|
---|
| 1000 | ULONG drive = WinQueryWindowULong(hwnd, QWL_USER);
|
---|
[2] | 1001 |
|
---|
[551] | 1002 | if (WinQueryButtonCheckstate(hwnd, DVS_NOPRESCAN))
|
---|
| 1003 | driveflags[drive] |= DRIVE_NOPRESCAN;
|
---|
| 1004 | else
|
---|
| 1005 | driveflags[drive] &= (~DRIVE_NOPRESCAN);
|
---|
| 1006 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADICONS))
|
---|
| 1007 | driveflags[drive] |= DRIVE_NOLOADICONS;
|
---|
| 1008 | else
|
---|
| 1009 | driveflags[drive] &= (~DRIVE_NOLOADICONS);
|
---|
| 1010 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADSUBJS))
|
---|
| 1011 | driveflags[drive] |= DRIVE_NOLOADSUBJS;
|
---|
| 1012 | else
|
---|
| 1013 | driveflags[drive] &= (~DRIVE_NOLOADSUBJS);
|
---|
| 1014 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADLONGS))
|
---|
| 1015 | driveflags[drive] |= DRIVE_NOLOADLONGS;
|
---|
| 1016 | else
|
---|
| 1017 | driveflags[drive] &= (~DRIVE_NOLOADLONGS);
|
---|
| 1018 | if (WinQueryButtonCheckstate(hwnd, DVS_SLOW))
|
---|
| 1019 | driveflags[drive] |= DRIVE_SLOW;
|
---|
| 1020 | else
|
---|
| 1021 | driveflags[drive] &= (~DRIVE_SLOW);
|
---|
| 1022 | if (WinQueryButtonCheckstate(hwnd, DVS_INCLUDEFILES))
|
---|
| 1023 | driveflags[drive] |= DRIVE_INCLUDEFILES;
|
---|
| 1024 | else
|
---|
| 1025 | driveflags[drive] &= (~DRIVE_INCLUDEFILES);
|
---|
[575] | 1026 | if (WinQueryButtonCheckstate(hwnd,DVS_NOSTATS))
|
---|
| 1027 | driveflags[drive] |= DRIVE_NOSTATS;
|
---|
| 1028 | else
|
---|
[1354] | 1029 | driveflags[drive] &= (~DRIVE_NOSTATS);
|
---|
| 1030 | if (WinQueryButtonCheckstate(hwnd,DVS_WRITEVERIFYOFF))
|
---|
| 1031 | driveflags[drive] |= DRIVE_WRITEVERIFYOFF;
|
---|
| 1032 | else
|
---|
| 1033 | driveflags[drive] &= (~DRIVE_WRITEVERIFYOFF);
|
---|
| 1034 | if (WinQueryButtonCheckstate(hwnd,DVS_RSCANNED))
|
---|
| 1035 | driveflags[drive] |= DRIVE_RSCANNED;
|
---|
| 1036 | else
|
---|
| 1037 | driveflags[drive] &= (~DRIVE_RSCANNED);
|
---|
[551] | 1038 | {
|
---|
| 1039 | ULONG flags;
|
---|
[1354] | 1040 | CHAR FlagKey[80];
|
---|
[2] | 1041 |
|
---|
[1354] | 1042 | sprintf(FlagKey, "%c.DriveFlags", (CHAR) (drive + 'A'));
|
---|
[551] | 1043 | flags = driveflags[drive];
|
---|
| 1044 | flags &= (~(DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE |
|
---|
| 1045 | DRIVE_IGNORE | DRIVE_CDROM |
|
---|
[1354] | 1046 | DRIVE_REMOTE | DRIVE_RSCANNED |
|
---|
[575] | 1047 | DRIVE_BOOT | DRIVE_INVALID | DRIVE_ZIPSTREAM |
|
---|
| 1048 | DRIVE_VIRTUAL | DRIVE_RAMDISK));
|
---|
[1354] | 1049 | PrfWriteProfileData(fmprof, appname, FlagKey, &flags, sizeof(ULONG));
|
---|
[551] | 1050 | }
|
---|
| 1051 | }
|
---|
| 1052 | WinDismissDlg(hwnd, 1);
|
---|
| 1053 | break;
|
---|
[2] | 1054 |
|
---|
[551] | 1055 | case DID_CANCEL:
|
---|
| 1056 | WinDismissDlg(hwnd, 0);
|
---|
| 1057 | break;
|
---|
[2] | 1058 |
|
---|
[551] | 1059 | case IDM_UNDO:
|
---|
| 1060 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
| 1061 | break;
|
---|
[2] | 1062 |
|
---|
[551] | 1063 | case IDM_HELP:
|
---|
| 1064 | if (hwndHelp)
|
---|
| 1065 | WinSendMsg(hwndHelp,
|
---|
| 1066 | HM_DISPLAY_HELP,
|
---|
| 1067 | MPFROM2SHORT(HELP_FLAGS, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
| 1068 | break;
|
---|
| 1069 | }
|
---|
| 1070 | return 0;
|
---|
[2] | 1071 | }
|
---|
[551] | 1072 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1073 | }
|
---|
[793] | 1074 |
|
---|
| 1075 | #pragma alloc_text(FMINFO,FileInfoProc,IconProc)
|
---|
| 1076 | #pragma alloc_text(FMINFO2,SetDrvProc,DrvInfoProc)
|
---|