[36] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: info.c 1400 2009-03-08 17:50:25Z 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, ' ');
|
---|
| 239 | sprintf(s,
|
---|
| 240 | "%s, %s, %s %s%s",
|
---|
| 241 | szMB, szKB, szUnits,
|
---|
| 242 | GetPString(IDS_UNITTEXT), &"s"[fsa.cUnitAvail == 1L]);
|
---|
| 243 | WinSetDlgItemText(hwnd, INFO_AVAILABLE, s);
|
---|
| 244 | sprintf(s,
|
---|
| 245 | GetPString(IDS_SECTORSTEXT),
|
---|
| 246 | fsa.cbSector,
|
---|
| 247 | fsa.cSectorUnit, &"s"[fsa.cSectorUnit == 1L]);
|
---|
| 248 | WinSetDlgItemText(hwnd, INFO_ALLOCUNITS, s);
|
---|
[552] | 249 |
|
---|
[551] | 250 | percentfree = (fsa.cUnitAvail && fsa.cUnit) ?
|
---|
| 251 | (fsa.cUnitAvail * 100) / fsa.cUnit : 0;
|
---|
| 252 | if (!percentfree && fsa.cUnitAvail)
|
---|
| 253 | percentfree = 1;
|
---|
| 254 | percentused = 100 - percentfree;
|
---|
| 255 | WinSendDlgItemMsg(hwnd,
|
---|
| 256 | INFO_USED,
|
---|
| 257 | SLM_SETSLIDERINFO,
|
---|
| 258 | MPFROM2SHORT(SMA_SLIDERARMPOSITION,
|
---|
| 259 | SMA_INCREMENTVALUE),
|
---|
| 260 | MPFROMSHORT(percentused));
|
---|
| 261 | WinSendDlgItemMsg(hwnd,
|
---|
| 262 | INFO_FREE,
|
---|
| 263 | SLM_SETSLIDERINFO,
|
---|
| 264 | MPFROM2SHORT(SMA_SLIDERARMPOSITION,
|
---|
| 265 | SMA_INCREMENTVALUE),
|
---|
| 266 | MPFROMSHORT(percentfree));
|
---|
| 267 | sprintf(s, "%u%%", percentused);
|
---|
| 268 | WinSetDlgItemText(hwnd, INFO_USEDPERCENT, s);
|
---|
| 269 | sprintf(s, "%u%%", percentfree);
|
---|
[575] | 270 | WinSetDlgItemText(hwnd, INFO_FREEPERCENT, s);
|
---|
| 271 | }
|
---|
| 272 | else
|
---|
| 273 | WinSetDlgItemText(hwnd, INFO_AVAILABLE, GetPString(IDS_STATSMEANINGLESSTEXT));
|
---|
[551] | 274 | }
|
---|
| 275 | else {
|
---|
| 276 | sprintf(FileSystem,
|
---|
| 277 | GetPString(IDS_CANTQUERYVOLTEXT),
|
---|
| 278 | toupper(*pszFileName));
|
---|
| 279 | Notify(FileSystem);
|
---|
| 280 | WinDismissDlg(hwnd, 0);
|
---|
| 281 | }
|
---|
| 282 | }
|
---|
| 283 | else {
|
---|
| 284 | sprintf(FileSystem,
|
---|
| 285 | GetPString(IDS_CANTQUERYALLOCTEXT),
|
---|
| 286 | toupper(*pszFileName));
|
---|
| 287 | Notify(FileSystem);
|
---|
| 288 | WinDismissDlg(hwnd, 0);
|
---|
| 289 | }
|
---|
| 290 | }
|
---|
| 291 | else {
|
---|
| 292 | FlagMsg(*pszFileName, s);
|
---|
| 293 | sprintf(FileSystem,
|
---|
| 294 | GetPString(IDS_DRIVEINACCESSIBLETEXT),
|
---|
| 295 | toupper(*pszFileName), s);
|
---|
| 296 | Notify(FileSystem);
|
---|
| 297 | WinDismissDlg(hwnd, 0);
|
---|
| 298 | }
|
---|
[2] | 299 | }
|
---|
[551] | 300 | else {
|
---|
| 301 | WinDismissDlg(hwnd, 0);
|
---|
| 302 | }
|
---|
| 303 | }
|
---|
| 304 | else
|
---|
| 305 | WinDismissDlg(hwnd, 0);
|
---|
| 306 | break;
|
---|
[2] | 307 |
|
---|
[551] | 308 | case WM_CONTROL:
|
---|
| 309 | return 0;
|
---|
[2] | 310 |
|
---|
[551] | 311 | case WM_COMMAND:
|
---|
| 312 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 313 | case DID_CANCEL:
|
---|
| 314 | WinDismissDlg(hwnd, 0);
|
---|
| 315 | break;
|
---|
[2] | 316 |
|
---|
[551] | 317 | case IDM_HELP:
|
---|
| 318 | if (hwndHelp)
|
---|
| 319 | WinSendMsg(hwndHelp,
|
---|
| 320 | HM_DISPLAY_HELP,
|
---|
| 321 | MPFROM2SHORT(HELP_DRVINFO, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
| 322 | break;
|
---|
[2] | 323 |
|
---|
[551] | 324 | case DID_OK:
|
---|
| 325 | pszFileName = INSTDATA(hwnd);
|
---|
| 326 | if (!(driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOTWRITEABLE)) {
|
---|
[2] | 327 |
|
---|
[551] | 328 | CHAR s[CCHMAXPATHCOMP + 3];
|
---|
[2] | 329 |
|
---|
[551] | 330 | *s = 0;
|
---|
| 331 | WinQueryDlgItemText(hwnd, INFO_LABEL, CCHMAXPATHCOMP, s);
|
---|
| 332 | bstrip(s);
|
---|
| 333 | if (*s) {
|
---|
| 334 | struct
|
---|
| 335 | {
|
---|
| 336 | ULONG serial;
|
---|
| 337 | CHAR volumelength;
|
---|
| 338 | CHAR volumelabel[CCHMAXPATH];
|
---|
| 339 | }
|
---|
| 340 | volser;
|
---|
[2] | 341 |
|
---|
[551] | 342 | memset(&volser, 0, sizeof(volser));
|
---|
| 343 | DosError(FERR_DISABLEHARDERR);
|
---|
| 344 | if (!DosQueryFSInfo(toupper(*pszFileName) - '@',
|
---|
| 345 | FSIL_VOLSER,
|
---|
| 346 | &volser,
|
---|
| 347 | (ULONG) sizeof(volser)) &&
|
---|
| 348 | stricmp(s, volser.volumelabel)) {
|
---|
| 349 | memmove(s + 1, s, strlen(s) + 1);
|
---|
| 350 | *s = strlen(s + 1);
|
---|
| 351 | DosError(FERR_DISABLEHARDERR);
|
---|
| 352 | rc = DosSetFSInfo(toupper(*pszFileName) - '@',
|
---|
| 353 | 2L, (PVOID) s, (ULONG) sizeof(s));
|
---|
| 354 | if (rc) {
|
---|
| 355 | Dos_Error(MB_CANCEL, rc, hwnd, __FILE__, __LINE__,
|
---|
| 356 | "DosSetFSInfo failed");
|
---|
| 357 | }
|
---|
| 358 | }
|
---|
| 359 | }
|
---|
[2] | 360 | }
|
---|
[551] | 361 | WinDismissDlg(hwnd, 1);
|
---|
| 362 | break;
|
---|
| 363 | }
|
---|
| 364 | return 0;
|
---|
[2] | 365 | }
|
---|
[551] | 366 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 367 | }
|
---|
| 368 |
|
---|
[575] | 369 | typedef struct {
|
---|
[2] | 370 | USHORT size;
|
---|
[551] | 371 | CHAR szFileName[CCHMAXPATH];
|
---|
| 372 | BOOL madechanges;
|
---|
[575] | 373 | } FILESTUF;
|
---|
[2] | 374 |
|
---|
[575] | 375 | typedef struct {
|
---|
| 376 | USHORT size;
|
---|
| 377 | PFNWP oldproc;
|
---|
| 378 | FILESTUF *pfs;
|
---|
| 379 | HWND lasthwndMenu;
|
---|
| 380 | } ICONSTUF;
|
---|
| 381 |
|
---|
[2] | 382 | /*
|
---|
| 383 | * subclass routine to allow changing a program's icon
|
---|
| 384 | */
|
---|
| 385 |
|
---|
[551] | 386 | MRESULT EXPENTRY IconProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
[162] | 387 | {
|
---|
[575] | 388 | ICONSTUF *pis = (ICONSTUF *)WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 389 | MRESULT mr;
|
---|
| 390 | CHAR *p;
|
---|
| 391 |
|
---|
[2] | 392 | static BOOL emphasized = FALSE;
|
---|
| 393 |
|
---|
[575] | 394 | if (!pis) {
|
---|
[1398] | 395 | Runtime_Error(pszSrcFile, __LINE__, NULL);
|
---|
[575] | 396 | if (msg != WM_DESTROY)
|
---|
| 397 | return WinDefWindowProc(hwnd, msg, mp1, mp2);
|
---|
| 398 | }
|
---|
[2] | 399 |
|
---|
[551] | 400 | switch (msg) {
|
---|
| 401 | case DM_DRAGOVER:
|
---|
| 402 | if (!emphasized) {
|
---|
| 403 | emphasized = TRUE;
|
---|
| 404 | DrawTargetEmphasis(hwnd, emphasized);
|
---|
| 405 | }
|
---|
[618] | 406 | if (AcceptOneDrop(hwnd, mp1, mp2))
|
---|
[551] | 407 | return MRFROM2SHORT(DOR_DROP, DO_MOVE);
|
---|
| 408 | return MRFROM2SHORT(DOR_NEVERDROP, 0);
|
---|
[2] | 409 |
|
---|
[551] | 410 | case DM_DRAGLEAVE:
|
---|
| 411 | emphasized = FALSE;
|
---|
| 412 | DrawTargetEmphasis(hwnd, emphasized);
|
---|
| 413 | break;
|
---|
[2] | 414 |
|
---|
[551] | 415 | case DM_DROPHELP:
|
---|
| 416 | DropHelp(mp1, mp2, hwnd, GetPString(IDS_DROPCHGICONHELPTEXT));
|
---|
| 417 | return 0;
|
---|
[2] | 418 |
|
---|
[551] | 419 | case DM_DROP:
|
---|
| 420 | {
|
---|
| 421 | HPOINTER hptr;
|
---|
| 422 | CHAR szFrom[CCHMAXPATH + 2];
|
---|
| 423 | ICONINFO ici;
|
---|
[2] | 424 |
|
---|
[551] | 425 | emphasized = FALSE;
|
---|
| 426 | DrawTargetEmphasis(hwnd, emphasized);
|
---|
[618] | 427 | if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) {
|
---|
[551] | 428 | memset(&ici, 0, sizeof(ICONINFO));
|
---|
| 429 | ici.cb = sizeof(ICONINFO);
|
---|
| 430 | ici.fFormat = ICON_FILE;
|
---|
| 431 | ici.pszFileName = szFrom;
|
---|
[575] | 432 | if (!WinSetFileIcon((PSZ) pis->pfs->szFileName, (PICONINFO) & ici)) {
|
---|
[551] | 433 | ici.fFormat = ICON_CLEAR;
|
---|
[575] | 434 | WinSetFileIcon((PSZ) pis->pfs->szFileName, (PICONINFO) & ici);
|
---|
[551] | 435 | }
|
---|
[575] | 436 | hptr = WinLoadFileIcon(pis->pfs->szFileName, FALSE);
|
---|
[551] | 437 | if (!hptr)
|
---|
[575] | 438 | hptr = (!IsFile(pis->pfs->szFileName)) ? hptrDir : hptrFile;
|
---|
| 439 | if (pis && pis->oldproc) {
|
---|
[551] | 440 | WinShowWindow(hwnd, FALSE);
|
---|
[575] | 441 | pis->oldproc(hwnd, SM_SETHANDLE, MPFROMLONG(hptr), MPVOID);
|
---|
[551] | 442 | WinShowWindow(hwnd, TRUE);
|
---|
| 443 | WinInvalidateRect(WinQueryWindow(hwnd, QW_PARENT), NULL, TRUE);
|
---|
| 444 | }
|
---|
[2] | 445 | }
|
---|
[551] | 446 | }
|
---|
| 447 | return 0;
|
---|
[2] | 448 |
|
---|
[551] | 449 | case WM_PAINT:
|
---|
[575] | 450 | mr = pis->oldproc(hwnd, msg, mp1, mp2);
|
---|
| 451 | PaintRecessedWindow(hwnd, (HPS) 0, FALSE, FALSE);
|
---|
| 452 | return mr;
|
---|
[551] | 453 | break;
|
---|
[2] | 454 |
|
---|
[551] | 455 | case WM_MENUEND:
|
---|
[575] | 456 | if (pis->lasthwndMenu == (HWND)mp2)
|
---|
| 457 | WinDestroyWindow(pis->lasthwndMenu);
|
---|
| 458 | pis->lasthwndMenu = (HWND) 0;
|
---|
[551] | 459 | break;
|
---|
[2] | 460 |
|
---|
[551] | 461 | case WM_CONTEXTMENU:
|
---|
[575] | 462 | if (pis->lasthwndMenu)
|
---|
| 463 | WinDestroyWindow(pis->lasthwndMenu);
|
---|
| 464 | pis->lasthwndMenu = WinLoadMenu(hwnd, FM3ModHandle, FLE_FRAME);
|
---|
| 465 | if (pis->lasthwndMenu) {
|
---|
| 466 | p = strrchr(pis->pfs->szFileName, '.');
|
---|
[1398] | 467 | if (!p || (stricmp(p, PCSZ_DOTICO) && stricmp(p, PCSZ_DOTPTR)))
|
---|
[575] | 468 | WinSendMsg(pis->lasthwndMenu,
|
---|
| 469 | MM_DELETEITEM,
|
---|
| 470 | MPFROM2SHORT(IDM_SELECTALL, TRUE), MPVOID);
|
---|
| 471 | PopupMenu(hwnd, hwnd, pis->lasthwndMenu);
|
---|
[551] | 472 | }
|
---|
| 473 | break;
|
---|
| 474 |
|
---|
| 475 | case WM_COMMAND:
|
---|
| 476 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 477 | case IDM_SELECTALL:
|
---|
| 478 | case IDM_DESELECTALL:
|
---|
| 479 | WinDlgBox(HWND_DESKTOP,
|
---|
| 480 | hwnd,
|
---|
| 481 | SetIconDlgProc,
|
---|
| 482 | FM3ModHandle,
|
---|
| 483 | SETICON_FRAME,
|
---|
| 484 | (PVOID) ((SHORT1FROMMP(mp1) == IDM_SELECTALL) ?
|
---|
[575] | 485 | pis->pfs->szFileName : NULL));
|
---|
[2] | 486 | break;
|
---|
[551] | 487 | }
|
---|
| 488 | return 0;
|
---|
[2] | 489 |
|
---|
[551] | 490 | case WM_DESTROY:
|
---|
| 491 | emphasized = FALSE;
|
---|
[575] | 492 | if (!pis)
|
---|
| 493 | return WinDefWindowProc(hwnd, msg, mp1, mp2);
|
---|
[576] | 494 | else {
|
---|
[805] | 495 | PFNWP oldproc = pis->oldproc;
|
---|
[576] | 496 | if (pis->lasthwndMenu)
|
---|
[805] | 497 | WinDestroyWindow(pis->lasthwndMenu);
|
---|
[1039] | 498 | free(pis);
|
---|
[805] | 499 | return oldproc(hwnd, msg, mp1, mp2);
|
---|
[576] | 500 | }
|
---|
[551] | 501 | break;
|
---|
[2] | 502 | }
|
---|
| 503 |
|
---|
[575] | 504 | return pis->oldproc(hwnd, msg, mp1, mp2);
|
---|
[2] | 505 | }
|
---|
| 506 |
|
---|
[551] | 507 | MRESULT EXPENTRY FileInfoProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
[336] | 508 | {
|
---|
[575] | 509 | FILESTUF *pfs;
|
---|
| 510 | ICONSTUF *pis;
|
---|
[805] | 511 | CHAR **ppsz;
|
---|
[2] | 512 |
|
---|
[551] | 513 | switch (msg) {
|
---|
| 514 | case WM_INITDLG:
|
---|
| 515 | if (!mp2) {
|
---|
| 516 | WinDismissDlg(hwnd, 1);
|
---|
| 517 | break;
|
---|
| 518 | }
|
---|
[575] | 519 | pfs = xmallocz(sizeof(FILESTUF), pszSrcFile, __LINE__);
|
---|
| 520 | if (!pfs) {
|
---|
[551] | 521 | WinDismissDlg(hwnd, 1);
|
---|
| 522 | break;
|
---|
| 523 | }
|
---|
[575] | 524 | pfs->size = sizeof(FILESTUF);
|
---|
| 525 | WinSetWindowPtr(hwnd, QWL_USER, pfs);
|
---|
[551] | 526 | {
|
---|
| 527 | USHORT ids[] = { FLE_SIZES, FLE_SLACK, FLE_LASTWRITE, FLE_CREATE,
|
---|
| 528 | FLE_LASTACCESS, 0
|
---|
| 529 | };
|
---|
| 530 | INT x;
|
---|
| 531 | CHAR s[CCHMAXPATH];
|
---|
| 532 |
|
---|
[805] | 533 | ppsz = (CHAR **)mp2;
|
---|
| 534 | for (x = 0; ppsz[x]; x++) {
|
---|
| 535 | if (DosQueryPathInfo(ppsz[x], FIL_QUERYFULLNAME, s, sizeof(s)))
|
---|
| 536 | strcpy(s, ppsz[x]);
|
---|
[551] | 537 | WinSendDlgItemMsg(hwnd,
|
---|
| 538 | FLE_NAME,
|
---|
| 539 | LM_INSERTITEM,
|
---|
| 540 | MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(s));
|
---|
[2] | 541 | }
|
---|
[551] | 542 | if (!x) {
|
---|
| 543 | WinDismissDlg(hwnd, 1);
|
---|
| 544 | break;
|
---|
[2] | 545 | }
|
---|
[551] | 546 | WinSendDlgItemMsg(hwnd,
|
---|
| 547 | FLE_NAME,
|
---|
| 548 | LM_SELECTITEM, MPFROM2SHORT(0, 0), MPFROMSHORT(TRUE));
|
---|
| 549 | for (x = 0; ids[x]; x++)
|
---|
| 550 | SetPresParams(WinWindowFromID(hwnd, ids[x]),
|
---|
| 551 | &RGBGREY, &RGBBLACK, &RGBBLACK, NULL);
|
---|
| 552 | }
|
---|
[575] | 553 | pis = xmallocz(sizeof(ICONSTUF), pszSrcFile, __LINE__);
|
---|
| 554 | if (!pis) {
|
---|
| 555 | WinDismissDlg(hwnd, 1);
|
---|
| 556 | break;
|
---|
| 557 | }
|
---|
| 558 | WinSetWindowPtr(WinWindowFromID(hwnd, FLE_ICON), QWL_USER, (PVOID) pis);
|
---|
| 559 | pis->size = sizeof(ICONSTUF);
|
---|
| 560 | pis->pfs = pfs;
|
---|
| 561 | pis->oldproc = WinSubclassWindow(WinWindowFromID(hwnd, FLE_ICON),
|
---|
[551] | 562 | IconProc);
|
---|
| 563 | break;
|
---|
[2] | 564 |
|
---|
[551] | 565 | case WM_CONTROL:
|
---|
| 566 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 567 | case FLE_READONLY:
|
---|
| 568 | case FLE_ARCHIVED:
|
---|
| 569 | case FLE_SYSTEM:
|
---|
| 570 | case FLE_HIDDEN:
|
---|
| 571 | switch (SHORT2FROMMP(mp1)) {
|
---|
| 572 | case BN_CLICKED:
|
---|
[575] | 573 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 574 | if (pfs && *pfs->szFileName) {
|
---|
[551] | 575 |
|
---|
| 576 | LISTINFO li;
|
---|
[907] | 577 | UINT numfiles = 0, numalloc = 0;
|
---|
[551] | 578 |
|
---|
| 579 | memset(&li, 0, sizeof(LISTINFO));
|
---|
[575] | 580 | if (!AddToList(pfs->szFileName, &li.list, &numfiles, &numalloc)) {
|
---|
[551] | 581 | if (WinDlgBox(HWND_DESKTOP,
|
---|
| 582 | hwnd,
|
---|
| 583 | AttrListDlgProc,
|
---|
| 584 | FM3ModHandle,
|
---|
| 585 | ATR_FRAME, MPFROMP(&li)) && li.list && li.list[0]) {
|
---|
[575] | 586 | pfs->madechanges = TRUE;
|
---|
[551] | 587 | WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID);
|
---|
| 588 | }
|
---|
| 589 | FreeList(li.list);
|
---|
| 590 | }
|
---|
| 591 | }
|
---|
| 592 | break;
|
---|
[805] | 593 | } // switch
|
---|
[2] | 594 | break;
|
---|
[551] | 595 | case FLE_NAME:
|
---|
| 596 | switch (SHORT2FROMMP(mp1)) {
|
---|
| 597 | case LN_ENTER:
|
---|
| 598 | case LN_SELECT:
|
---|
[575] | 599 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 600 | if (!pfs) {
|
---|
[1398] | 601 | Runtime_Error(pszSrcFile, __LINE__, NULL);
|
---|
[551] | 602 | WinDismissDlg(hwnd, 1);
|
---|
| 603 | }
|
---|
| 604 | else {
|
---|
[2] | 605 |
|
---|
[551] | 606 | SHORT sSelect;
|
---|
[2] | 607 |
|
---|
[551] | 608 | sSelect = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 609 | FLE_NAME,
|
---|
| 610 | LM_QUERYSELECTION,
|
---|
| 611 | MPFROMSHORT(LIT_FIRST), MPVOID);
|
---|
| 612 | if (sSelect >= 0) {
|
---|
[575] | 613 | *pfs->szFileName = 0;
|
---|
[551] | 614 | WinSendDlgItemMsg(hwnd,
|
---|
| 615 | FLE_NAME,
|
---|
| 616 | LM_QUERYITEMTEXT,
|
---|
| 617 | MPFROM2SHORT(sSelect, CCHMAXPATH),
|
---|
[575] | 618 | MPFROMP(pfs->szFileName));
|
---|
| 619 | if (*pfs->szFileName) {
|
---|
[551] | 620 | if (SHORT2FROMMP(mp1) == LN_SELECT)
|
---|
| 621 | WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID);
|
---|
| 622 | else
|
---|
| 623 | DefaultView(hwnd,
|
---|
[575] | 624 | (HWND) 0, (HWND) 0, NULL, 32, pfs->szFileName);
|
---|
[551] | 625 | }
|
---|
| 626 | }
|
---|
| 627 | }
|
---|
| 628 | break;
|
---|
| 629 | }
|
---|
| 630 | break;
|
---|
| 631 | }
|
---|
| 632 | return 0;
|
---|
[2] | 633 |
|
---|
[551] | 634 | case UM_SETDIR:
|
---|
| 635 | WinCheckButton(hwnd, FLE_READONLY, FALSE);
|
---|
| 636 | WinCheckButton(hwnd, FLE_ARCHIVED, FALSE);
|
---|
| 637 | WinCheckButton(hwnd, FLE_SYSTEM, FALSE);
|
---|
| 638 | WinCheckButton(hwnd, FLE_HIDDEN, FALSE);
|
---|
| 639 | WinCheckButton(hwnd, FLE_DIRECTORY, FALSE);
|
---|
| 640 | WinCheckButton(hwnd, FLE_READABLE, FALSE);
|
---|
| 641 | WinCheckButton(hwnd, FLE_WRITEABLE, FALSE);
|
---|
| 642 | WinCheckButton(hwnd, FLE_OPEN, FALSE);
|
---|
| 643 | WinCheckButton(hwnd, FLE_BINARY, FALSE);
|
---|
| 644 | WinCheckButton(hwnd, FLE_ISARCHIVE, FALSE);
|
---|
| 645 | WinSetDlgItemText(hwnd, FLE_ARCNAME, NullStr);
|
---|
| 646 | WinCheckButton(hwnd, FLE_OS2FS, FALSE);
|
---|
| 647 | WinCheckButton(hwnd, FLE_OS2WIN, FALSE);
|
---|
| 648 | WinCheckButton(hwnd, FLE_OS2PM, FALSE);
|
---|
| 649 | WinCheckButton(hwnd, FLE_DOS, FALSE);
|
---|
| 650 | WinCheckButton(hwnd, FLE_32BIT, FALSE);
|
---|
| 651 | WinCheckButton(hwnd, FLE_WINREAL, FALSE);
|
---|
| 652 | WinCheckButton(hwnd, FLE_WINPROT, FALSE);
|
---|
| 653 | WinCheckButton(hwnd, FLE_WINENH, FALSE);
|
---|
| 654 | WinCheckButton(hwnd, FLE_DLL, FALSE);
|
---|
| 655 | WinCheckButton(hwnd, FLE_PHYSDRV, FALSE);
|
---|
| 656 | WinCheckButton(hwnd, FLE_VIRTDRV, FALSE);
|
---|
| 657 | WinCheckButton(hwnd, FLE_PROTDLL, FALSE);
|
---|
[575] | 658 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 659 | if (pfs && *pfs->szFileName) {
|
---|
[551] | 660 | CHAR s[97];
|
---|
[897] | 661 | CHAR szCmmaFmtFileSize[81], szCmmaFmtEASize[81];
|
---|
[1397] | 662 | CHAR szCmmaFmtFileEASize[81], szCmmaFmtFileEASizeK[81], szDate[DATE_BUF_BYTES];
|
---|
[841] | 663 | FILEFINDBUF4L fs;
|
---|
[551] | 664 | HDIR hdir = HDIR_CREATE;
|
---|
[841] | 665 | ULONG apptype = 1;
|
---|
[551] | 666 | FILE *fp;
|
---|
| 667 | HPOINTER hptr;
|
---|
| 668 | ARC_TYPE *info;
|
---|
[2] | 669 |
|
---|
[551] | 670 | DosError(FERR_DISABLEHARDERR);
|
---|
[838] | 671 | if (xDosFindFirst(pfs->szFileName,
|
---|
| 672 | &hdir,
|
---|
| 673 | FILE_NORMAL | FILE_ARCHIVED |
|
---|
| 674 | FILE_DIRECTORY | FILE_READONLY | FILE_HIDDEN |
|
---|
| 675 | FILE_SYSTEM,
|
---|
[841] | 676 | &fs, sizeof(fs), &apptype, FIL_QUERYEASIZEL)) {
|
---|
[551] | 677 | // Not found
|
---|
| 678 | SHORT sSelect, numitems;
|
---|
[2] | 679 |
|
---|
[1395] | 680 | if (!fAlertBeepOff)
|
---|
| 681 | DosBeep(250, 100); // Wake up user
|
---|
[551] | 682 | sSelect = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 683 | FLE_NAME,
|
---|
| 684 | LM_QUERYSELECTION,
|
---|
| 685 | MPFROMSHORT(LIT_FIRST), MPVOID);
|
---|
| 686 | if (sSelect >= 0) {
|
---|
| 687 | WinSendDlgItemMsg(hwnd,
|
---|
| 688 | FLE_NAME,
|
---|
| 689 | LM_DELETEITEM, MPFROMSHORT(sSelect), MPVOID);
|
---|
| 690 | numitems = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 691 | FLE_NAME,
|
---|
| 692 | LM_QUERYITEMCOUNT,
|
---|
| 693 | MPVOID, MPVOID);
|
---|
| 694 | if (numitems)
|
---|
| 695 | PostMsg(WinWindowFromID(hwnd, FLE_NAME),
|
---|
| 696 | LM_SELECTITEM,
|
---|
| 697 | MPFROMSHORT(((sSelect) ? sSelect - 1 : 0)),
|
---|
| 698 | MPFROMSHORT(TRUE));
|
---|
| 699 | }
|
---|
[2] | 700 | }
|
---|
[551] | 701 | else {
|
---|
[1395] | 702 | DosFindClose(hdir);
|
---|
| 703 | FDateFormat(szDate, fs.fdateLastWrite);
|
---|
| 704 | sprintf(s, "%s %02u%s%02u%s%02u",
|
---|
| 705 | szDate,
|
---|
| 706 | fs.ftimeLastWrite.hours, TimeSeparator,
|
---|
| 707 | fs.ftimeLastWrite.minutes, TimeSeparator, fs.ftimeLastWrite.twosecs * 2);
|
---|
[551] | 708 | WinSetDlgItemText(hwnd, FLE_LASTWRITE, s);
|
---|
| 709 | if (fs.fdateCreation.year &&
|
---|
[1395] | 710 | fs.fdateCreation.month && fs.fdateCreation.day) {
|
---|
| 711 | FDateFormat(szDate, fs.fdateCreation);
|
---|
| 712 | sprintf(s, "%s %02u%s%02u%s%02u",
|
---|
| 713 | szDate,
|
---|
| 714 | fs.ftimeCreation.hours, TimeSeparator,
|
---|
| 715 | fs.ftimeCreation.minutes, TimeSeparator, fs.ftimeCreation.twosecs * 2);
|
---|
[551] | 716 | WinSetDlgItemText(hwnd, FLE_CREATE, s);
|
---|
| 717 | }
|
---|
| 718 | if (fs.fdateLastAccess.year &&
|
---|
[1395] | 719 | fs.fdateLastAccess.month && fs.fdateLastAccess.day) {
|
---|
| 720 | FDateFormat(szDate, fs.fdateLastAccess);
|
---|
| 721 | sprintf(s, "%s %02u%s%02u%s%02u",
|
---|
| 722 | szDate,
|
---|
| 723 | fs.ftimeLastAccess.hours, TimeSeparator,
|
---|
| 724 | fs.ftimeLastAccess.minutes, TimeSeparator, fs.ftimeLastAccess.twosecs * 2);
|
---|
[551] | 725 | WinSetDlgItemText(hwnd, FLE_LASTACCESS, s);
|
---|
| 726 | }
|
---|
[897] | 727 | CommaFmtULL(szCmmaFmtFileSize,
|
---|
| 728 | sizeof(szCmmaFmtFileSize), fs.cbFile, ' ');
|
---|
| 729 | CommaFmtULL(szCmmaFmtEASize,
|
---|
| 730 | sizeof(szCmmaFmtEASize), CBLIST_TO_EASIZE(fs.cbList), ' ');
|
---|
| 731 | CommaFmtULL(szCmmaFmtFileEASize,
|
---|
| 732 | sizeof(szCmmaFmtFileEASize),
|
---|
| 733 | fs.cbFile + CBLIST_TO_EASIZE(fs.cbList),
|
---|
| 734 | ' ');
|
---|
| 735 | CommaFmtULL(szCmmaFmtFileEASizeK,
|
---|
| 736 | sizeof(szCmmaFmtFileEASizeK),
|
---|
| 737 | fs.cbFile + CBLIST_TO_EASIZE(fs.cbList),
|
---|
| 738 | 'K');
|
---|
[551] | 739 | sprintf(s,
|
---|
| 740 | GetPString(IDS_SIZEINCLEASTEXT),
|
---|
[897] | 741 | szCmmaFmtFileSize,
|
---|
| 742 | szCmmaFmtEASize,
|
---|
| 743 | szCmmaFmtFileEASize,
|
---|
| 744 | szCmmaFmtFileEASizeK);
|
---|
[551] | 745 | WinSetDlgItemText(hwnd, FLE_SIZES, s);
|
---|
[897] | 746 | CommaFmtULL(szCmmaFmtFileSize,
|
---|
| 747 | sizeof(szCmmaFmtFileSize), fs.cbFileAlloc - fs.cbFile, ' ');
|
---|
| 748 | sprintf(s, "%s", szCmmaFmtFileSize);
|
---|
[551] | 749 | WinSetDlgItemText(hwnd, FLE_SLACK, s);
|
---|
| 750 | WinCheckButton(hwnd,
|
---|
| 751 | FLE_READONLY, ((fs.attrFile & FILE_READONLY) != 0));
|
---|
| 752 | WinCheckButton(hwnd,
|
---|
| 753 | FLE_ARCHIVED, ((fs.attrFile & FILE_ARCHIVED) != 0));
|
---|
| 754 | WinCheckButton(hwnd,
|
---|
| 755 | FLE_DIRECTORY, ((fs.attrFile & FILE_DIRECTORY) != 0));
|
---|
| 756 | WinCheckButton(hwnd, FLE_HIDDEN, ((fs.attrFile & FILE_HIDDEN) != 0));
|
---|
| 757 | WinCheckButton(hwnd, FLE_SYSTEM, ((fs.attrFile & FILE_SYSTEM) != 0));
|
---|
| 758 | DosError(FERR_DISABLEHARDERR);
|
---|
[575] | 759 | if (!DosQueryAppType(pfs->szFileName, &apptype)) {
|
---|
[551] | 760 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2FS), TRUE);
|
---|
| 761 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2WIN), TRUE);
|
---|
| 762 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2PM), TRUE);
|
---|
| 763 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BOUND), TRUE);
|
---|
| 764 | WinEnableWindow(WinWindowFromID(hwnd, FLE_32BIT), TRUE);
|
---|
| 765 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DOS), TRUE);
|
---|
| 766 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINPROT), TRUE);
|
---|
| 767 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINREAL), TRUE);
|
---|
| 768 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINENH), TRUE);
|
---|
| 769 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DLL), TRUE);
|
---|
| 770 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PHYSDRV), TRUE);
|
---|
| 771 | WinEnableWindow(WinWindowFromID(hwnd, FLE_VIRTDRV), TRUE);
|
---|
| 772 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PROTDLL), TRUE);
|
---|
| 773 | WinCheckButton(hwnd, FLE_OS2FS,
|
---|
| 774 | ((apptype & FAPPTYP_NOTWINDOWCOMPAT) &&
|
---|
| 775 | !(apptype & FAPPTYP_WINDOWCOMPAT)));
|
---|
| 776 | WinCheckButton(hwnd, FLE_OS2WIN,
|
---|
| 777 | ((apptype & FAPPTYP_WINDOWCOMPAT) &&
|
---|
| 778 | !(apptype & FAPPTYP_NOTWINDOWCOMPAT)));
|
---|
| 779 | WinCheckButton(hwnd, FLE_OS2PM,
|
---|
| 780 | ((apptype & FAPPTYP_WINDOWAPI) ==
|
---|
| 781 | FAPPTYP_WINDOWAPI));
|
---|
| 782 | WinCheckButton(hwnd, FLE_BOUND, ((apptype & FAPPTYP_BOUND) != 0));
|
---|
| 783 | WinCheckButton(hwnd, FLE_DLL, ((apptype & FAPPTYP_DLL) != 0));
|
---|
| 784 | WinCheckButton(hwnd, FLE_DOS, ((apptype & FAPPTYP_DOS) != 0));
|
---|
| 785 | WinCheckButton(hwnd, FLE_PHYSDRV,
|
---|
| 786 | ((apptype & FAPPTYP_PHYSDRV) != 0));
|
---|
| 787 | WinCheckButton(hwnd, FLE_VIRTDRV,
|
---|
| 788 | ((apptype & FAPPTYP_VIRTDRV) != 0));
|
---|
| 789 | WinCheckButton(hwnd, FLE_PROTDLL,
|
---|
| 790 | ((apptype & FAPPTYP_PROTDLL) != 0));
|
---|
| 791 | WinCheckButton(hwnd, FLE_WINREAL,
|
---|
| 792 | ((apptype & FAPPTYP_WINDOWSREAL) != 0));
|
---|
| 793 | WinCheckButton(hwnd, FLE_WINPROT,
|
---|
| 794 | ((apptype & FAPPTYP_WINDOWSPROT) != 0));
|
---|
| 795 | WinCheckButton(hwnd, FLE_32BIT, ((apptype & FAPPTYP_32BIT) != 0));
|
---|
| 796 | WinCheckButton(hwnd, FLE_WINENH, ((apptype & 0x1000) != 0));
|
---|
| 797 | }
|
---|
| 798 | else {
|
---|
| 799 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2FS), FALSE);
|
---|
| 800 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2WIN), FALSE);
|
---|
| 801 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2PM), FALSE);
|
---|
| 802 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BOUND), FALSE);
|
---|
| 803 | WinEnableWindow(WinWindowFromID(hwnd, FLE_32BIT), FALSE);
|
---|
| 804 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DOS), FALSE);
|
---|
| 805 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINPROT), FALSE);
|
---|
| 806 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINREAL), FALSE);
|
---|
| 807 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINENH), FALSE);
|
---|
| 808 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DLL), FALSE);
|
---|
| 809 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PHYSDRV), FALSE);
|
---|
| 810 | WinEnableWindow(WinWindowFromID(hwnd, FLE_VIRTDRV), FALSE);
|
---|
| 811 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PROTDLL), FALSE);
|
---|
| 812 | }
|
---|
[575] | 813 | hptr = WinLoadFileIcon(pfs->szFileName, FALSE);
|
---|
[551] | 814 | WinShowWindow(WinWindowFromID(hwnd, FLE_ICON), FALSE);
|
---|
| 815 | if (hptr) {
|
---|
| 816 | WinSendDlgItemMsg(hwnd,
|
---|
| 817 | FLE_ICON, SM_SETHANDLE, MPFROMLONG(hptr), MPVOID);
|
---|
| 818 | WinShowWindow(WinWindowFromID(hwnd, FLE_ICON), TRUE);
|
---|
| 819 | }
|
---|
| 820 | WinShowWindow(WinWindowFromID(hwnd, FLE_EAS), fs.cbList > 4);
|
---|
| 821 | if (!(fs.attrFile & FILE_DIRECTORY)) {
|
---|
| 822 | WinEnableWindow(WinWindowFromID(hwnd, FLE_READABLE), TRUE);
|
---|
| 823 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WRITEABLE), TRUE);
|
---|
| 824 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OPEN), TRUE);
|
---|
| 825 | WinEnableWindow(WinWindowFromID(hwnd, FLE_ISARCHIVE), TRUE);
|
---|
| 826 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BINARY), TRUE);
|
---|
[805] | 827 | fp = _fsopen(pfs->szFileName, "rb", SH_DENYNO);
|
---|
[551] | 828 | if (fp) {
|
---|
[850] | 829 | char buff[4096]; // 06 Oct 07 SHL protect against NTFS defect
|
---|
[551] | 830 | ULONG len;
|
---|
| 831 | APIRET rc;
|
---|
[2] | 832 |
|
---|
[551] | 833 | len = 512;
|
---|
| 834 | rc = DosRead(fileno(fp), buff, len, &len);
|
---|
| 835 | fclose(fp);
|
---|
| 836 | WinCheckButton(hwnd,
|
---|
| 837 | FLE_BINARY,
|
---|
| 838 | ((len && rc) ? IsBinary(buff, len) : 2));
|
---|
| 839 | WinCheckButton(hwnd, FLE_READABLE, TRUE);
|
---|
[575] | 840 | info = find_type(pfs->szFileName, NULL);
|
---|
[551] | 841 | if (info) {
|
---|
| 842 | WinCheckButton(hwnd, FLE_ISARCHIVE, 1);
|
---|
| 843 | if (info->id)
|
---|
| 844 | WinSetDlgItemText(hwnd, FLE_ARCNAME, info->id);
|
---|
| 845 | }
|
---|
| 846 | }
|
---|
| 847 | else {
|
---|
| 848 | WinCheckButton(hwnd, FLE_ISARCHIVE, 2);
|
---|
| 849 | WinCheckButton(hwnd, FLE_BINARY, 2);
|
---|
| 850 | }
|
---|
[575] | 851 | fp = _fsopen(pfs->szFileName, "ab", SH_DENYNO);
|
---|
[551] | 852 | if (fp) {
|
---|
| 853 | WinCheckButton(hwnd, FLE_WRITEABLE, TRUE);
|
---|
| 854 | fclose(fp);
|
---|
| 855 | }
|
---|
[575] | 856 | fp = _fsopen(pfs->szFileName, "rb", SH_DENYRW);
|
---|
[551] | 857 | if (!fp)
|
---|
| 858 | WinCheckButton(hwnd, FLE_OPEN, TRUE);
|
---|
| 859 | else
|
---|
| 860 | fclose(fp);
|
---|
| 861 | }
|
---|
| 862 | else {
|
---|
| 863 | WinEnableWindow(WinWindowFromID(hwnd, FLE_READABLE), FALSE);
|
---|
| 864 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WRITEABLE), FALSE);
|
---|
| 865 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OPEN), FALSE);
|
---|
| 866 | WinEnableWindow(WinWindowFromID(hwnd, FLE_ISARCHIVE), FALSE);
|
---|
| 867 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BINARY), FALSE);
|
---|
| 868 | }
|
---|
[2] | 869 | }
|
---|
[551] | 870 | }
|
---|
| 871 | return 0;
|
---|
[2] | 872 |
|
---|
[551] | 873 | case WM_COMMAND:
|
---|
| 874 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 875 | case DID_OK:
|
---|
[575] | 876 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 877 | WinDismissDlg(hwnd, (pfs && pfs->madechanges) ? 2 : 1);
|
---|
[551] | 878 | break;
|
---|
| 879 | case IDM_HELP:
|
---|
| 880 | if (hwndHelp)
|
---|
| 881 | WinSendMsg(hwndHelp,
|
---|
| 882 | HM_DISPLAY_HELP,
|
---|
| 883 | MPFROM2SHORT(HELP_INFO, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
| 884 | break;
|
---|
| 885 | case FLE_SETTINGS:
|
---|
[575] | 886 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 887 | if (pfs && *pfs->szFileName)
|
---|
| 888 | OpenObject(pfs->szFileName, Settings, hwnd);
|
---|
[551] | 889 | break;
|
---|
| 890 | case FLE_EAS:
|
---|
[575] | 891 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 892 | if (pfs && *pfs->szFileName) {
|
---|
[2] | 893 |
|
---|
[551] | 894 | CHAR *list[2];
|
---|
[2] | 895 |
|
---|
[575] | 896 | list[0] = pfs->szFileName;
|
---|
[551] | 897 | list[1] = NULL;
|
---|
| 898 | WinDlgBox(HWND_DESKTOP,
|
---|
| 899 | hwnd, DisplayEAsProc, FM3ModHandle, EA_FRAME, (PVOID) list);
|
---|
[2] | 900 | }
|
---|
[551] | 901 | break;
|
---|
| 902 | case DID_CANCEL:
|
---|
[575] | 903 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
| 904 | WinDismissDlg(hwnd, (pfs && pfs->madechanges) ? 2 : 0);
|
---|
[551] | 905 | break;
|
---|
| 906 | }
|
---|
| 907 | return 0;
|
---|
[2] | 908 |
|
---|
[551] | 909 | case WM_DESTROY:
|
---|
[575] | 910 | pfs = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
[1009] | 911 | xfree(pfs, pszSrcFile, __LINE__);
|
---|
[551] | 912 | break;
|
---|
[2] | 913 | }
|
---|
[551] | 914 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 915 | }
|
---|
| 916 |
|
---|
[551] | 917 | MRESULT EXPENTRY SetDrvProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
[336] | 918 | {
|
---|
[551] | 919 | switch (msg) {
|
---|
| 920 | case WM_INITDLG:
|
---|
[1009] | 921 | if (!mp2 || !isalpha(*(CHAR *)mp2))
|
---|
[551] | 922 | WinDismissDlg(hwnd, 0);
|
---|
| 923 | else {
|
---|
[2] | 924 |
|
---|
[551] | 925 | CHAR s[80];
|
---|
[2] | 926 |
|
---|
[1009] | 927 | WinSetWindowULong(hwnd, QWL_USER, (toupper(*(CHAR *)mp2) - 'A'));
|
---|
| 928 | sprintf(s, GetPString(IDS_DRIVEFLAGSTITLETEXT), toupper(*(CHAR *)mp2));
|
---|
[551] | 929 | WinSetWindowText(hwnd, s);
|
---|
[2] | 930 | /*
|
---|
[575] | 931 | WinEnableWindow(WinWindowFromID(hwnd,DVS_REMOVABLE),FALSE);
|
---|
| 932 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOTWRITEABLE),FALSE);
|
---|
| 933 | WinEnableWindow(WinWindowFromID(hwnd,DVS_IGNORE),FALSE);
|
---|
| 934 | WinEnableWindow(WinWindowFromID(hwnd,DVS_CDROM),FALSE);
|
---|
| 935 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOLONGNAMES),FALSE);
|
---|
| 936 | WinEnableWindow(WinWindowFromID(hwnd,DVS_REMOTE),FALSE);
|
---|
| 937 | WinEnableWindow(WinWindowFromID(hwnd,DVS_VIRTUAL),FALSE);
|
---|
| 938 | WinEnableWindow(WinWindowFromID(hwnd,DVS_RAMDISK),FALSE);
|
---|
| 939 | WinEnableWindow(WinWindowFromID(hwnd,DVS_BOOT),FALSE);
|
---|
| 940 | WinEnableWindow(WinWindowFromID(hwnd,DVS_INVALID),FALSE);
|
---|
| 941 | WinEnableWindow(WinWindowFromID(hwnd,DVS_ZIPSTREAM),FALSE);
|
---|
| 942 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOSTATS),FALSE);
|
---|
[2] | 943 | */
|
---|
[551] | 944 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
| 945 | }
|
---|
| 946 | break;
|
---|
[2] | 947 |
|
---|
[551] | 948 | case UM_UNDO:
|
---|
| 949 | {
|
---|
| 950 | ULONG drive = WinQueryWindowULong(hwnd, QWL_USER);
|
---|
[2] | 951 |
|
---|
[551] | 952 | WinCheckButton(hwnd, DVS_REMOVABLE,
|
---|
| 953 | ((driveflags[drive] & DRIVE_REMOVABLE) != 0));
|
---|
| 954 | WinCheckButton(hwnd, DVS_NOTWRITEABLE,
|
---|
| 955 | ((driveflags[drive] & DRIVE_NOTWRITEABLE) != 0));
|
---|
| 956 | WinCheckButton(hwnd, DVS_IGNORE,
|
---|
| 957 | ((driveflags[drive] & DRIVE_IGNORE) != 0));
|
---|
| 958 | WinCheckButton(hwnd, DVS_CDROM,
|
---|
| 959 | ((driveflags[drive] & DRIVE_CDROM) != 0));
|
---|
| 960 | WinCheckButton(hwnd, DVS_NOLONGNAMES,
|
---|
| 961 | ((driveflags[drive] & DRIVE_NOLONGNAMES) != 0));
|
---|
| 962 | WinCheckButton(hwnd, DVS_REMOTE,
|
---|
| 963 | ((driveflags[drive] & DRIVE_REMOTE) != 0));
|
---|
[552] | 964 | WinCheckButton(hwnd,DVS_VIRTUAL,
|
---|
[575] | 965 | ((driveflags[drive] & DRIVE_VIRTUAL) != 0));
|
---|
[552] | 966 | WinCheckButton(hwnd,DVS_RAMDISK,
|
---|
[575] | 967 | ((driveflags[drive] & DRIVE_RAMDISK) != 0));
|
---|
[552] | 968 | WinCheckButton(hwnd, DVS_BOOT,
|
---|
[575] | 969 | ((driveflags[drive] & DRIVE_BOOT) != 0));
|
---|
[551] | 970 | WinCheckButton(hwnd, DVS_INVALID,
|
---|
| 971 | ((driveflags[drive] & DRIVE_INVALID) != 0));
|
---|
| 972 | WinCheckButton(hwnd, DVS_NOPRESCAN,
|
---|
| 973 | ((driveflags[drive] & DRIVE_NOPRESCAN) != 0));
|
---|
| 974 | WinCheckButton(hwnd, DVS_ZIPSTREAM,
|
---|
| 975 | ((driveflags[drive] & DRIVE_ZIPSTREAM) != 0));
|
---|
| 976 | WinCheckButton(hwnd, DVS_NOLOADICONS,
|
---|
| 977 | ((driveflags[drive] & DRIVE_NOLOADICONS) != 0));
|
---|
| 978 | WinCheckButton(hwnd, DVS_NOLOADSUBJS,
|
---|
| 979 | ((driveflags[drive] & DRIVE_NOLOADSUBJS) != 0));
|
---|
| 980 | WinCheckButton(hwnd, DVS_NOLOADLONGS,
|
---|
| 981 | ((driveflags[drive] & DRIVE_NOLOADLONGS) != 0));
|
---|
| 982 | WinCheckButton(hwnd, DVS_SLOW, ((driveflags[drive] & DRIVE_SLOW) != 0));
|
---|
| 983 | WinCheckButton(hwnd, DVS_INCLUDEFILES,
|
---|
| 984 | ((driveflags[drive] & DRIVE_INCLUDEFILES) != 0));
|
---|
[552] | 985 | WinCheckButton(hwnd,DVS_NOSTATS,
|
---|
[1354] | 986 | ((driveflags[drive] & DRIVE_NOSTATS) != 0));
|
---|
| 987 | WinCheckButton(hwnd,DVS_WRITEVERIFYOFF,
|
---|
| 988 | ((driveflags[drive] & DRIVE_WRITEVERIFYOFF) != 0));
|
---|
| 989 | WinCheckButton(hwnd,DVS_RSCANNED,
|
---|
| 990 | ((driveflags[drive] & DRIVE_RSCANNED) != 0));
|
---|
[551] | 991 | }
|
---|
| 992 | return 0;
|
---|
[2] | 993 |
|
---|
[551] | 994 | case WM_CONTROL:
|
---|
| 995 | return 0;
|
---|
[2] | 996 |
|
---|
[551] | 997 | case WM_COMMAND:
|
---|
| 998 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 999 | case DID_OK:
|
---|
| 1000 | {
|
---|
| 1001 | ULONG drive = WinQueryWindowULong(hwnd, QWL_USER);
|
---|
[2] | 1002 |
|
---|
[551] | 1003 | if (WinQueryButtonCheckstate(hwnd, DVS_NOPRESCAN))
|
---|
| 1004 | driveflags[drive] |= DRIVE_NOPRESCAN;
|
---|
| 1005 | else
|
---|
| 1006 | driveflags[drive] &= (~DRIVE_NOPRESCAN);
|
---|
| 1007 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADICONS))
|
---|
| 1008 | driveflags[drive] |= DRIVE_NOLOADICONS;
|
---|
| 1009 | else
|
---|
| 1010 | driveflags[drive] &= (~DRIVE_NOLOADICONS);
|
---|
| 1011 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADSUBJS))
|
---|
| 1012 | driveflags[drive] |= DRIVE_NOLOADSUBJS;
|
---|
| 1013 | else
|
---|
| 1014 | driveflags[drive] &= (~DRIVE_NOLOADSUBJS);
|
---|
| 1015 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADLONGS))
|
---|
| 1016 | driveflags[drive] |= DRIVE_NOLOADLONGS;
|
---|
| 1017 | else
|
---|
| 1018 | driveflags[drive] &= (~DRIVE_NOLOADLONGS);
|
---|
| 1019 | if (WinQueryButtonCheckstate(hwnd, DVS_SLOW))
|
---|
| 1020 | driveflags[drive] |= DRIVE_SLOW;
|
---|
| 1021 | else
|
---|
| 1022 | driveflags[drive] &= (~DRIVE_SLOW);
|
---|
| 1023 | if (WinQueryButtonCheckstate(hwnd, DVS_INCLUDEFILES))
|
---|
| 1024 | driveflags[drive] |= DRIVE_INCLUDEFILES;
|
---|
| 1025 | else
|
---|
| 1026 | driveflags[drive] &= (~DRIVE_INCLUDEFILES);
|
---|
[575] | 1027 | if (WinQueryButtonCheckstate(hwnd,DVS_NOSTATS))
|
---|
| 1028 | driveflags[drive] |= DRIVE_NOSTATS;
|
---|
| 1029 | else
|
---|
[1354] | 1030 | driveflags[drive] &= (~DRIVE_NOSTATS);
|
---|
| 1031 | if (WinQueryButtonCheckstate(hwnd,DVS_WRITEVERIFYOFF))
|
---|
| 1032 | driveflags[drive] |= DRIVE_WRITEVERIFYOFF;
|
---|
| 1033 | else
|
---|
| 1034 | driveflags[drive] &= (~DRIVE_WRITEVERIFYOFF);
|
---|
| 1035 | if (WinQueryButtonCheckstate(hwnd,DVS_RSCANNED))
|
---|
| 1036 | driveflags[drive] |= DRIVE_RSCANNED;
|
---|
| 1037 | else
|
---|
| 1038 | driveflags[drive] &= (~DRIVE_RSCANNED);
|
---|
[551] | 1039 | {
|
---|
| 1040 | ULONG flags;
|
---|
[1354] | 1041 | CHAR FlagKey[80];
|
---|
[2] | 1042 |
|
---|
[1354] | 1043 | sprintf(FlagKey, "%c.DriveFlags", (CHAR) (drive + 'A'));
|
---|
[551] | 1044 | flags = driveflags[drive];
|
---|
| 1045 | flags &= (~(DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE |
|
---|
| 1046 | DRIVE_IGNORE | DRIVE_CDROM |
|
---|
[1354] | 1047 | DRIVE_REMOTE | DRIVE_RSCANNED |
|
---|
[575] | 1048 | DRIVE_BOOT | DRIVE_INVALID | DRIVE_ZIPSTREAM |
|
---|
| 1049 | DRIVE_VIRTUAL | DRIVE_RAMDISK));
|
---|
[1354] | 1050 | PrfWriteProfileData(fmprof, appname, FlagKey, &flags, sizeof(ULONG));
|
---|
[551] | 1051 | }
|
---|
| 1052 | }
|
---|
| 1053 | WinDismissDlg(hwnd, 1);
|
---|
| 1054 | break;
|
---|
[2] | 1055 |
|
---|
[551] | 1056 | case DID_CANCEL:
|
---|
| 1057 | WinDismissDlg(hwnd, 0);
|
---|
| 1058 | break;
|
---|
[2] | 1059 |
|
---|
[551] | 1060 | case IDM_UNDO:
|
---|
| 1061 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID);
|
---|
| 1062 | break;
|
---|
[2] | 1063 |
|
---|
[551] | 1064 | case IDM_HELP:
|
---|
| 1065 | if (hwndHelp)
|
---|
| 1066 | WinSendMsg(hwndHelp,
|
---|
| 1067 | HM_DISPLAY_HELP,
|
---|
| 1068 | MPFROM2SHORT(HELP_FLAGS, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
| 1069 | break;
|
---|
| 1070 | }
|
---|
| 1071 | return 0;
|
---|
[2] | 1072 | }
|
---|
[551] | 1073 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1074 | }
|
---|
[793] | 1075 |
|
---|
| 1076 | #pragma alloc_text(FMINFO,FileInfoProc,IconProc)
|
---|
| 1077 | #pragma alloc_text(FMINFO2,SetDrvProc,DrvInfoProc)
|
---|