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