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