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