[123] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: walkem.c 966 2008-02-19 20:37:44Z jbs $
|
---|
| 5 |
|
---|
| 6 | Copyright (c) 1993-98 M. Kimes
|
---|
[574] | 7 | Copyright (c) 2005, 2007 Steven H. Levine
|
---|
[123] | 8 |
|
---|
[186] | 9 | 01 Aug 04 SHL Rework lstrip/rstrip usage
|
---|
| 10 | 05 Jun 05 SHL Use QWL_USER
|
---|
[242] | 11 | 13 Aug 05 SHL Run through indent
|
---|
[259] | 12 | 13 Aug 05 SHL remove_udir - avoid corrupting last dirs list
|
---|
[328] | 13 | 17 Jul 06 SHL Use Runtime_Error
|
---|
[404] | 14 | 29 Jul 06 SHL Use xfgets
|
---|
[518] | 15 | 20 Oct 06 SHL Correct . .. check
|
---|
[544] | 16 | 06 Nov 06 SHL Oops - need to allow .. here
|
---|
| 17 | 14 Nov 06 SHL Correct FillPathListBox regression
|
---|
[574] | 18 | 22 Mar 07 GKY Use QWL_USER
|
---|
[617] | 19 | 20 Apr 07 SHL Avoid spurious add_udir error reports
|
---|
[787] | 20 | 16 Aug 07 SHL Update add_setups for ticket# 109
|
---|
[789] | 21 | 19 Aug 07 SHL Correct load_setups error reporting
|
---|
[794] | 22 | 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
|
---|
[807] | 23 | 25 Aug 07 SHL Correct #pragma alloc_text typos
|
---|
[864] | 24 | 11 Nov 07 GKY Cancel now directly closes dialog even if directory path text has changed
|
---|
[939] | 25 | 20 Jan 08 GKY Walk & walk2 dialogs now save and restore size and position
|
---|
[965] | 26 | 19 Feb 08 JBS Add "State at last FM/2 close" to the states combo box
|
---|
[123] | 27 |
|
---|
| 28 | ***********************************************************************/
|
---|
| 29 |
|
---|
[907] | 30 | #include <stdlib.h>
|
---|
| 31 | #include <string.h>
|
---|
| 32 | #include <ctype.h>
|
---|
| 33 | #include <share.h>
|
---|
| 34 |
|
---|
[2] | 35 | #define INCL_WIN
|
---|
| 36 | #define INCL_DOS
|
---|
| 37 | #define INCL_DOSERRORS
|
---|
[787] | 38 | #define INCL_SHLERRORS // PMERR_NOT_IN_IDX
|
---|
[841] | 39 | #define INCL_LONGLONG
|
---|
[2] | 40 |
|
---|
| 41 | #include "fm3dlg.h"
|
---|
| 42 | #include "fm3str.h"
|
---|
[907] | 43 | #include "errutil.h" // Dos_Error...
|
---|
| 44 | #include "strutil.h" // GetPString
|
---|
| 45 | #include "fm3dll.h"
|
---|
[2] | 46 |
|
---|
| 47 | #pragma data_seg(DATA1)
|
---|
[328] | 48 |
|
---|
| 49 | static PSZ pszSrcFile = __FILE__;
|
---|
| 50 |
|
---|
[2] | 51 |
|
---|
[242] | 52 | typedef struct
|
---|
| 53 | {
|
---|
[551] | 54 | USHORT size;
|
---|
| 55 | USHORT changed;
|
---|
| 56 | BOOL nounwriteable;
|
---|
| 57 | CHAR szCurrentPath[CCHMAXPATH];
|
---|
| 58 | CHAR *szReturnPath;
|
---|
| 59 | }
|
---|
| 60 | WALKER;
|
---|
[2] | 61 |
|
---|
[242] | 62 | static CHAR WalkFont[CCHMAXPATH] = "";
|
---|
[2] | 63 | static ULONG WalkFontSize = sizeof(WalkFont);
|
---|
| 64 |
|
---|
[787] | 65 | /**
|
---|
| 66 | * States names management
|
---|
| 67 | */
|
---|
| 68 |
|
---|
| 69 | static BOOL fSetupsLoaded;
|
---|
| 70 | static LINKDIRS *pFirstSetup;
|
---|
| 71 | static const PSZ pszLastSetups = "LastSetups";
|
---|
[907] | 72 | // 18 Aug 07 SHL fixme to stop supporting old style 1 year from now?
|
---|
[787] | 73 | static const ULONG ulOldSetupsBytes = 100 * 13; // Prior to 3.0.7
|
---|
| 74 |
|
---|
| 75 | /**
|
---|
| 76 | * Fill States drop down list with known state names
|
---|
| 77 | */
|
---|
| 78 |
|
---|
| 79 | VOID fill_setups_list(VOID)
|
---|
[242] | 80 | {
|
---|
[787] | 81 | WinSendMsg(hwndStatelist, LM_DELETEALL, MPVOID, MPVOID);
|
---|
| 82 | if (fUserComboBox) {
|
---|
| 83 | LINKDIRS *pld;
|
---|
| 84 | load_setups();
|
---|
| 85 | for (pld = pFirstSetup; pld; pld = pld->next) {
|
---|
| 86 | // DbgMsg(pszSrcFile, __LINE__, "Inserted %s", pld->path);
|
---|
| 87 | WinSendMsg(hwndStatelist,
|
---|
| 88 | LM_INSERTITEM,
|
---|
| 89 | MPFROM2SHORT(LIT_SORTASCENDING, 0),
|
---|
| 90 | MPFROMP(pld->path));
|
---|
| 91 | }
|
---|
[966] | 92 | if (fSaveState) {
|
---|
| 93 | WinSendMsg(hwndStatelist,
|
---|
| 94 | LM_INSERTITEM,
|
---|
| 95 | MPFROM2SHORT(LIT_SORTASCENDING, 0),
|
---|
| 96 | MPFROMP(GetPString(IDS_SHUTDOWNSTATE)));
|
---|
| 97 | }
|
---|
[787] | 98 | WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT));
|
---|
| 99 | }
|
---|
| 100 | }
|
---|
[2] | 101 |
|
---|
[787] | 102 | /**
|
---|
| 103 | * Lookup setup and do requested action
|
---|
| 104 | * @param - action, Support old/new style storage method
|
---|
| 105 | * @return 1 if found and action OK, 0 if not found and action OK, -1 if error during action
|
---|
| 106 | */
|
---|
| 107 |
|
---|
| 108 | #define LS_FIND 0
|
---|
| 109 | #define LS_ADD 1
|
---|
| 110 | #define LS_DELETE 2
|
---|
| 111 |
|
---|
| 112 | static INT lookup_setup(PSZ name, UINT action)
|
---|
| 113 | {
|
---|
| 114 | LINKDIRS *pld;
|
---|
| 115 | LINKDIRS *pldLast = NULL;
|
---|
| 116 |
|
---|
| 117 | if (!name || !*name) {
|
---|
| 118 | Runtime_Error(pszSrcFile, __LINE__, "no data");
|
---|
| 119 | return -1;
|
---|
| 120 | }
|
---|
| 121 |
|
---|
| 122 | load_setups();
|
---|
| 123 |
|
---|
| 124 | for (pld = pFirstSetup; pld; pld = pld->next) {
|
---|
| 125 | if (!stricmp(pld->path, name)) {
|
---|
| 126 | if (action == LS_DELETE) {
|
---|
| 127 | if (pldLast)
|
---|
| 128 | pldLast->next = pld->next;
|
---|
| 129 | else
|
---|
| 130 | pFirstSetup = pld->next;
|
---|
| 131 | xfree(pld->path);
|
---|
| 132 | xfree(pld);
|
---|
| 133 | }
|
---|
| 134 | return 1; // Found or added
|
---|
| 135 | }
|
---|
| 136 | pldLast = pld; // In case deleting
|
---|
| 137 | } // for
|
---|
| 138 |
|
---|
| 139 | // Not found
|
---|
| 140 | if (action == LS_ADD) {
|
---|
| 141 | pld = xmalloc(sizeof(LINKDIRS), pszSrcFile, __LINE__);
|
---|
| 142 | if (!pld)
|
---|
| 143 | return -1;
|
---|
| 144 | pld->path = xstrdup(name, pszSrcFile, __LINE__);
|
---|
| 145 | if (!pld->path) {
|
---|
| 146 | xfree(pld);
|
---|
| 147 | return -1;
|
---|
| 148 | }
|
---|
| 149 | // Insert at front of list - drop down will sort
|
---|
| 150 | pld->next = pFirstSetup;
|
---|
| 151 | pFirstSetup = pld;
|
---|
| 152 | return 0;
|
---|
| 153 | }
|
---|
| 154 |
|
---|
| 155 | return FALSE; // Not found
|
---|
[2] | 156 | }
|
---|
| 157 |
|
---|
[787] | 158 | /**
|
---|
| 159 | * Load state names from ini
|
---|
| 160 | * Support old/new style storage method
|
---|
| 161 | */
|
---|
| 162 |
|
---|
| 163 | VOID load_setups(VOID)
|
---|
[242] | 164 | {
|
---|
[787] | 165 | ULONG ulDataBytes;
|
---|
| 166 | ULONG l;
|
---|
| 167 | PSZ pszBuf;
|
---|
| 168 | PSZ psz;
|
---|
| 169 | LINKDIRS *pld;
|
---|
| 170 |
|
---|
| 171 | if (fSetupsLoaded)
|
---|
[551] | 172 | return;
|
---|
[787] | 173 |
|
---|
| 174 | if (!PrfQueryProfileSize(fmprof, FM3Str, pszLastSetups, &ulDataBytes)) {
|
---|
| 175 | // fixme to use generic hab
|
---|
| 176 | ERRORID eid = WinGetLastError((HAB)0);
|
---|
| 177 | if ((eid & 0xffff) != PMERR_NOT_IN_IDX) {
|
---|
[789] | 178 | // Get error info back
|
---|
| 179 | PrfQueryProfileSize(fmprof, FM3Str, pszLastSetups, &ulDataBytes);
|
---|
| 180 | Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, "PrfQueryProfileSize");
|
---|
[787] | 181 | }
|
---|
[789] | 182 | else
|
---|
| 183 | fSetupsLoaded = TRUE; // Nothing saved
|
---|
| 184 | return;
|
---|
[787] | 185 | }
|
---|
| 186 |
|
---|
| 187 | if (ulDataBytes == 0) {
|
---|
| 188 | Runtime_Error(pszSrcFile, __LINE__, "PrfQueryProfileSize reported 0 bytes");
|
---|
| 189 | return;
|
---|
| 190 | }
|
---|
| 191 |
|
---|
| 192 | pszBuf = xmalloc(ulDataBytes + 1, pszSrcFile, __LINE__); // One extra for end marker
|
---|
| 193 | if (!pszBuf)
|
---|
| 194 | return;
|
---|
| 195 | l = ulDataBytes;
|
---|
| 196 | if (!PrfQueryProfileData(fmprof, FM3Str, pszLastSetups, pszBuf, &l)) {
|
---|
| 197 | Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, "PrfQueryProfileData");
|
---|
| 198 | xfree(pszBuf);
|
---|
| 199 | return;
|
---|
| 200 | }
|
---|
| 201 |
|
---|
| 202 | if (ulDataBytes != l) {
|
---|
| 203 | Runtime_Error(pszSrcFile, __LINE__, "PrfQueryProfileData reported %u expected %u", l, ulDataBytes);
|
---|
| 204 | xfree(pszBuf);
|
---|
| 205 | return;
|
---|
| 206 | }
|
---|
| 207 |
|
---|
| 208 | *(pszBuf + ulDataBytes) = 0; // Insert end marker
|
---|
| 209 |
|
---|
| 210 | psz = pszBuf;
|
---|
| 211 | if (!*psz && ulDataBytes == ulOldSetupsBytes)
|
---|
| 212 | psz += 13; // Rarely used 1st fixed width entry prior to 3.0.7
|
---|
| 213 |
|
---|
| 214 | while (*psz) {
|
---|
| 215 | pld = xmalloc(sizeof(LINKDIRS), pszSrcFile, __LINE__);
|
---|
| 216 | if (!pld) {
|
---|
| 217 | xfree(pszBuf);
|
---|
| 218 | return;
|
---|
| 219 | }
|
---|
| 220 | pld->path = xstrdup(psz, pszSrcFile, __LINE__);
|
---|
| 221 | if (!pld->path) {
|
---|
| 222 | xfree(pszBuf);
|
---|
| 223 | xfree(pld);
|
---|
| 224 | return;
|
---|
| 225 | }
|
---|
| 226 |
|
---|
| 227 | // Insert at front of list - drop down will sort
|
---|
| 228 | pld->next = pFirstSetup;
|
---|
| 229 | pFirstSetup = pld;
|
---|
| 230 | // DbgMsg(pszSrcFile, __LINE__, "Inserted %s", pld->path);
|
---|
| 231 |
|
---|
| 232 | if (ulDataBytes == ulOldSetupsBytes)
|
---|
| 233 | psz += 13; // Buffers fixed width prior to 3.0.7
|
---|
| 234 | else
|
---|
| 235 | psz += strlen(psz) + 1;
|
---|
| 236 | } // while
|
---|
| 237 |
|
---|
| 238 | xfree(pszBuf);
|
---|
| 239 |
|
---|
| 240 | fSetupsLoaded = TRUE;
|
---|
[2] | 241 | }
|
---|
| 242 |
|
---|
[787] | 243 | VOID save_setups(VOID)
|
---|
[242] | 244 | {
|
---|
[787] | 245 | ULONG ulBufBytes;
|
---|
| 246 | ULONG ulFillBytes;
|
---|
| 247 | ULONG l;
|
---|
| 248 | PSZ pszBuf;
|
---|
| 249 | PSZ psz;
|
---|
| 250 | LINKDIRS *pld;
|
---|
[2] | 251 |
|
---|
[787] | 252 | if (!fSetupsLoaded)
|
---|
| 253 | return;
|
---|
| 254 |
|
---|
| 255 | ulBufBytes = 0;
|
---|
| 256 | for (pld = pFirstSetup; pld; pld = pld->next) {
|
---|
| 257 | ulBufBytes += strlen(pld->path) + 1;
|
---|
| 258 | } // for
|
---|
| 259 |
|
---|
| 260 | if (!ulBufBytes)
|
---|
| 261 | pszBuf = NULL;
|
---|
| 262 | else {
|
---|
| 263 | // Ensure different than size prior to 3.0.7
|
---|
| 264 | ulFillBytes = ulBufBytes == ulOldSetupsBytes ? 1 : 0;
|
---|
| 265 | pszBuf = xmalloc(ulBufBytes + ulFillBytes, pszSrcFile, __LINE__);
|
---|
| 266 | if (!pszBuf)
|
---|
| 267 | return;
|
---|
| 268 |
|
---|
| 269 | psz = pszBuf;
|
---|
| 270 | for (pld = pFirstSetup; pld; pld = pld->next) {
|
---|
| 271 | l = strlen(pld->path) + 1;
|
---|
| 272 | memcpy(psz, pld->path, l);
|
---|
| 273 | psz += l;
|
---|
| 274 | } // for
|
---|
| 275 | if (ulFillBytes)
|
---|
| 276 | *psz = 0;
|
---|
[551] | 277 | }
|
---|
[787] | 278 |
|
---|
| 279 | if (!PrfWriteProfileData(fmprof,
|
---|
| 280 | FM3Str,
|
---|
| 281 | pszLastSetups, pszBuf, ulBufBytes)) {
|
---|
| 282 | // Win_Error(pszSrcFile, __LINE__, HWND_DESKTOP, HWND_DESKTOP, "PrfWriteProfileData");
|
---|
| 283 | ERRORID eid = WinGetLastError((HAB)0);
|
---|
| 284 | if ((eid & 0xffff) != PMERR_NOT_IN_IDX)
|
---|
| 285 | Runtime_Error(pszSrcFile, __LINE__, "PrfWriteProfileData returned %u", eid);
|
---|
| 286 | }
|
---|
| 287 |
|
---|
| 288 | // Delete obsolete INI entry
|
---|
| 289 | PrfWriteProfileData(fmprof, FM3Str, "LastSetup", NULL, 0);
|
---|
[2] | 290 | }
|
---|
| 291 |
|
---|
[787] | 292 | /**
|
---|
| 293 | * Add named state to setups list
|
---|
| 294 | * @return same as lookup_setup
|
---|
| 295 | */
|
---|
| 296 |
|
---|
| 297 | INT add_setup(PSZ name)
|
---|
[242] | 298 | {
|
---|
[787] | 299 | return lookup_setup(name, LS_ADD);
|
---|
| 300 | }
|
---|
[2] | 301 |
|
---|
[787] | 302 | /**
|
---|
| 303 | * Delete named state from setups list
|
---|
| 304 | * @return same as lookup_setup
|
---|
| 305 | */
|
---|
| 306 |
|
---|
| 307 | INT remove_setup(PSZ name)
|
---|
| 308 | {
|
---|
| 309 | return lookup_setup(name, LS_DELETE);
|
---|
[2] | 310 | }
|
---|
| 311 |
|
---|
[242] | 312 | VOID load_udirs(VOID)
|
---|
| 313 | {
|
---|
[551] | 314 | /* load linked list of user directories from USERDIRS.DAT file */
|
---|
[2] | 315 |
|
---|
[551] | 316 | FILE *fp;
|
---|
| 317 | LINKDIRS *info;
|
---|
| 318 | LINKDIRS *last = NULL;
|
---|
| 319 | CHAR s[CCHMAXPATH + 24];
|
---|
[2] | 320 |
|
---|
[551] | 321 | loadedudirs = TRUE;
|
---|
| 322 | fUdirsChanged = FALSE;
|
---|
| 323 | save_dir2(s);
|
---|
| 324 | if (s[strlen(s) - 1] != '\\')
|
---|
| 325 | strcat(s, "\\");
|
---|
| 326 | strcat(s, "USERDIRS.DAT");
|
---|
| 327 | fp = _fsopen(s, "r", SH_DENYWR);
|
---|
| 328 | if (fp) {
|
---|
| 329 | while (!feof(fp)) {
|
---|
| 330 | if (!xfgets(s, CCHMAXPATH + 24, fp, pszSrcFile, __LINE__))
|
---|
| 331 | break;
|
---|
| 332 | s[CCHMAXPATH] = 0;
|
---|
| 333 | bstripcr(s);
|
---|
| 334 | if (*s && *s != ';') {
|
---|
| 335 | info = xmalloc(sizeof(LINKDIRS), pszSrcFile, __LINE__);
|
---|
| 336 | if (info) {
|
---|
| 337 | info->path = xstrdup(s, pszSrcFile, __LINE__);
|
---|
| 338 | if (!info->path)
|
---|
| 339 | free(info);
|
---|
| 340 | else {
|
---|
| 341 | info->next = NULL;
|
---|
| 342 | if (!udirhead)
|
---|
| 343 | udirhead = info;
|
---|
| 344 | else
|
---|
| 345 | last->next = info;
|
---|
| 346 | last = info;
|
---|
| 347 | }
|
---|
[242] | 348 | }
|
---|
[551] | 349 | }
|
---|
[2] | 350 | }
|
---|
[551] | 351 | fclose(fp);
|
---|
| 352 | }
|
---|
[2] | 353 | }
|
---|
| 354 |
|
---|
[242] | 355 | VOID save_udirs(VOID)
|
---|
| 356 | {
|
---|
[551] | 357 | FILE *fp;
|
---|
| 358 | LINKDIRS *info;
|
---|
| 359 | CHAR s[CCHMAXPATH + 14];
|
---|
[2] | 360 |
|
---|
[551] | 361 | if (loadedudirs) {
|
---|
| 362 | fUdirsChanged = FALSE;
|
---|
| 363 | if (udirhead) {
|
---|
| 364 | save_dir2(s);
|
---|
| 365 | if (s[strlen(s) - 1] != '\\')
|
---|
| 366 | strcat(s, "\\");
|
---|
| 367 | strcat(s, "USERDIRS.DAT");
|
---|
| 368 | fp = xfopen(s, "w", pszSrcFile, __LINE__);
|
---|
| 369 | if (fp) {
|
---|
| 370 | fputs(GetPString(IDS_USERDEFDIRSTEXT), fp);
|
---|
| 371 | info = udirhead;
|
---|
| 372 | while (info) {
|
---|
| 373 | fprintf(fp, "%0.*s\n", CCHMAXPATH, info->path);
|
---|
| 374 | info = info->next;
|
---|
[242] | 375 | }
|
---|
[551] | 376 | fclose(fp);
|
---|
| 377 | }
|
---|
[2] | 378 | }
|
---|
[551] | 379 | }
|
---|
[2] | 380 | }
|
---|
| 381 |
|
---|
[617] | 382 | /**
|
---|
| 383 | * Add path to user directory list or last used directory list.
|
---|
| 384 | * Callers need to check fUdirsChanged to know if user dirs change occured.
|
---|
| 385 | * Callers need to check return code to know if last dirs change occured.
|
---|
| 386 | * @param userdirs TRUE to process user directory list. Otherwise last used list.
|
---|
| 387 | * @return TRUE if added, FALSE if already in list or error.
|
---|
| 388 | */
|
---|
[259] | 389 |
|
---|
[617] | 390 | BOOL add_udir(BOOL userdirs, CHAR *inpath)
|
---|
[242] | 391 | {
|
---|
[551] | 392 | CHAR path[CCHMAXPATH];
|
---|
| 393 | LINKDIRS *info;
|
---|
| 394 | LINKDIRS *last = NULL;
|
---|
| 395 | LINKDIRS *temp;
|
---|
[2] | 396 |
|
---|
[551] | 397 | if (inpath && *inpath) {
|
---|
| 398 | if (DosQueryPathInfo(inpath, FIL_QUERYFULLNAME, path, sizeof(path)))
|
---|
| 399 | strcpy(path, inpath);
|
---|
| 400 | if (!userdirs && IsRoot(path))
|
---|
| 401 | return FALSE;
|
---|
| 402 | if (IsFullName(path)) {
|
---|
| 403 | if (!loadedudirs)
|
---|
| 404 | load_udirs();
|
---|
| 405 | // Search user dir list first unless doing last dirs
|
---|
| 406 | info = userdirs ? udirhead : ldirhead;
|
---|
| 407 | while (info) {
|
---|
| 408 | if (!stricmp(info->path, path))
|
---|
| 409 | return FALSE; // Already in list
|
---|
| 410 | last = info; // Remember append to location
|
---|
| 411 | info = info->next;
|
---|
| 412 | }
|
---|
| 413 | // Search last dir list unless doing just last dirs
|
---|
| 414 | if (!userdirs) {
|
---|
| 415 | info = udirhead;
|
---|
| 416 | while (info) {
|
---|
| 417 | if (!stricmp(info->path, path))
|
---|
[242] | 418 | return FALSE;
|
---|
[551] | 419 | info = info->next;
|
---|
| 420 | }
|
---|
| 421 | }
|
---|
| 422 | else {
|
---|
| 423 | /* if adding manual directory, remove from auto list if present */
|
---|
| 424 | info = ldirhead;
|
---|
| 425 | temp = NULL;
|
---|
| 426 | while (info) {
|
---|
| 427 | if (!stricmp(info->path, path)) {
|
---|
| 428 | if (temp)
|
---|
| 429 | temp->next = info->next;
|
---|
[242] | 430 | else
|
---|
[551] | 431 | ldirhead = info->next;
|
---|
| 432 | free(info->path);
|
---|
| 433 | free(info);
|
---|
| 434 | break;
|
---|
| 435 | }
|
---|
| 436 | temp = info;
|
---|
| 437 | info = info->next;
|
---|
[242] | 438 | }
|
---|
[551] | 439 | }
|
---|
| 440 | // Append entry to end of user dirs list
|
---|
| 441 | info = xmalloc(sizeof(LINKDIRS), pszSrcFile, __LINE__);
|
---|
| 442 | if (info) {
|
---|
| 443 | info->path = xstrdup(path, pszSrcFile, __LINE__);
|
---|
| 444 | if (!info->path)
|
---|
| 445 | free(info);
|
---|
| 446 | else {
|
---|
| 447 | info->next = NULL;
|
---|
| 448 | if (userdirs) {
|
---|
| 449 | fUdirsChanged = TRUE;
|
---|
| 450 | if (!udirhead)
|
---|
| 451 | udirhead = info;
|
---|
| 452 | else
|
---|
| 453 | last->next = info;
|
---|
| 454 | }
|
---|
| 455 | else {
|
---|
| 456 | if (!ldirhead)
|
---|
| 457 | ldirhead = info;
|
---|
| 458 | else
|
---|
| 459 | last->next = info;
|
---|
| 460 | }
|
---|
| 461 | return TRUE;
|
---|
| 462 | }
|
---|
| 463 | }
|
---|
[2] | 464 | }
|
---|
[551] | 465 | }
|
---|
| 466 | return FALSE;
|
---|
[2] | 467 | }
|
---|
| 468 |
|
---|
[259] | 469 | //=== remove_udir - remove path from user dir list or last directory list ===
|
---|
| 470 |
|
---|
[242] | 471 | BOOL remove_udir(CHAR * path)
|
---|
| 472 | {
|
---|
[551] | 473 | LINKDIRS *info;
|
---|
| 474 | LINKDIRS *last = NULL;
|
---|
[2] | 475 |
|
---|
[551] | 476 | if (path && *path) {
|
---|
| 477 | if (!loadedudirs)
|
---|
| 478 | load_udirs();
|
---|
| 479 | info = udirhead;
|
---|
| 480 | while (info) {
|
---|
| 481 | if (!stricmp(info->path, path)) {
|
---|
| 482 | if (last)
|
---|
| 483 | last->next = info->next;
|
---|
| 484 | else
|
---|
| 485 | udirhead = info->next;
|
---|
| 486 | free(info->path);
|
---|
| 487 | free(info);
|
---|
| 488 | fUdirsChanged = TRUE;
|
---|
| 489 | return TRUE;
|
---|
| 490 | }
|
---|
| 491 | last = info;
|
---|
| 492 | info = info->next;
|
---|
| 493 | }
|
---|
[259] | 494 |
|
---|
[551] | 495 | info = ldirhead;
|
---|
| 496 | last = NULL;
|
---|
| 497 | while (info) {
|
---|
| 498 | if (!stricmp(info->path, path)) {
|
---|
| 499 | if (last)
|
---|
| 500 | last->next = info->next;
|
---|
| 501 | else
|
---|
| 502 | ldirhead = info->next;
|
---|
| 503 | free(info->path);
|
---|
| 504 | free(info);
|
---|
| 505 | return TRUE;
|
---|
| 506 | }
|
---|
| 507 | last = info;
|
---|
| 508 | info = info->next;
|
---|
[2] | 509 | }
|
---|
[551] | 510 | }
|
---|
| 511 | return FALSE;
|
---|
[2] | 512 | }
|
---|
| 513 |
|
---|
[242] | 514 | BOOL remove_ldir(CHAR * path)
|
---|
| 515 | {
|
---|
[551] | 516 | LINKDIRS *info;
|
---|
| 517 | LINKDIRS *last = NULL;
|
---|
[2] | 518 |
|
---|
[551] | 519 | if (path && *path) {
|
---|
| 520 | info = ldirhead;
|
---|
| 521 | while (info) {
|
---|
| 522 | if (!stricmp(info->path, path)) {
|
---|
| 523 | if (last)
|
---|
| 524 | last->next = info->next;
|
---|
| 525 | else
|
---|
| 526 | ldirhead = info->next;
|
---|
| 527 | free(info->path);
|
---|
| 528 | free(info);
|
---|
| 529 | return TRUE;
|
---|
| 530 | }
|
---|
| 531 | last = info;
|
---|
| 532 | info = info->next;
|
---|
[2] | 533 | }
|
---|
[551] | 534 | }
|
---|
| 535 | return FALSE;
|
---|
[2] | 536 | }
|
---|
| 537 |
|
---|
[551] | 538 | VOID FillPathListBox(HWND hwnd, HWND hwnddrive, HWND hwnddir, CHAR * pszPath,
|
---|
[242] | 539 | BOOL nounwriteable)
|
---|
| 540 | {
|
---|
[551] | 541 | /*
|
---|
| 542 | * this function fills one or two list boxes with drive and directory
|
---|
| 543 | * information showing all available drives and all directories off of
|
---|
| 544 | * the directory represented by path. This works independently of the
|
---|
| 545 | * current directory.
|
---|
| 546 | */
|
---|
[2] | 547 |
|
---|
[551] | 548 | CHAR szDrive[] = " :", szTemp[1032];
|
---|
[847] | 549 | FILEFINDBUF3 findbuf;
|
---|
[551] | 550 | HDIR hDir = HDIR_CREATE;
|
---|
| 551 | SHORT sDrive;
|
---|
[766] | 552 | ULONG ulDriveNum, ulSearchCount = 1, ulDriveMap;
|
---|
[2] | 553 |
|
---|
[551] | 554 | DosError(FERR_DISABLEHARDERR);
|
---|
| 555 | DosQCurDisk(&ulDriveNum, &ulDriveMap);
|
---|
| 556 | if (hwnddrive)
|
---|
| 557 | WinSendMsg(hwnddrive, LM_DELETEALL, MPVOID, MPVOID);
|
---|
| 558 | if (hwnddrive != hwnddir && hwnddir)
|
---|
| 559 | WinSendMsg(hwnddir, LM_DELETEALL, MPVOID, MPVOID);
|
---|
[2] | 560 |
|
---|
[551] | 561 | if (hwnddrive) {
|
---|
| 562 | // Fill drive listbox
|
---|
| 563 | for (sDrive = 0; sDrive < 26; sDrive++) {
|
---|
[766] | 564 | if (ulDriveMap & (1 << sDrive)) {
|
---|
[551] | 565 | *szDrive = (CHAR) (sDrive + 'A');
|
---|
| 566 | if ((!nounwriteable || !(driveflags[sDrive] & DRIVE_NOTWRITEABLE)) &&
|
---|
| 567 | !(driveflags[sDrive] & (DRIVE_IGNORE | DRIVE_INVALID)))
|
---|
| 568 | WinSendMsg(hwnddrive, LM_INSERTITEM, MPFROM2SHORT(LIT_END, 0),
|
---|
| 569 | MPFROMP(szDrive));
|
---|
| 570 | }
|
---|
[2] | 571 | }
|
---|
[551] | 572 | if (hwnddrive != hwnddir && pszPath && isalpha(*pszPath)
|
---|
| 573 | && pszPath[1] == ':') {
|
---|
| 574 | *szDrive = toupper(*pszPath);
|
---|
| 575 | WinSetWindowText(hwnddrive, szDrive);
|
---|
| 576 | }
|
---|
| 577 | }
|
---|
[2] | 578 |
|
---|
[551] | 579 | if (hwnddir) {
|
---|
| 580 | // Fill directory listbox
|
---|
| 581 | sprintf(szTemp,
|
---|
| 582 | "%s%s*",
|
---|
| 583 | pszPath, (pszPath[strlen(pszPath) - 1] == '\\') ? "" : "\\");
|
---|
| 584 | DosError(FERR_DISABLEHARDERR);
|
---|
[847] | 585 | if (!DosFindFirst(szTemp,
|
---|
| 586 | &hDir,
|
---|
| 587 | FILE_DIRECTORY | MUST_HAVE_DIRECTORY |
|
---|
| 588 | FILE_READONLY | FILE_ARCHIVED | FILE_SYSTEM |
|
---|
| 589 | FILE_HIDDEN,
|
---|
| 590 | &findbuf,
|
---|
| 591 | sizeof(FILEFINDBUF3), &ulSearchCount, FIL_STANDARD)) {
|
---|
[551] | 592 | do {
|
---|
| 593 | if (findbuf.attrFile & FILE_DIRECTORY) {
|
---|
| 594 | // Skip .. unless full path supplied
|
---|
| 595 | if (strcmp(findbuf.achName, "..") ||
|
---|
| 596 | strlen(pszPath) > 3 || pszPath[1] != ':') {
|
---|
| 597 | // Skip . allow ..
|
---|
| 598 | if (findbuf.achName[0] != '.' || findbuf.achName[1]) {
|
---|
| 599 | WinSendMsg(hwnddir,
|
---|
| 600 | LM_INSERTITEM,
|
---|
| 601 | MPFROM2SHORT(LIT_SORTASCENDING, 0),
|
---|
| 602 | MPFROMP(findbuf.achName));
|
---|
| 603 | }
|
---|
| 604 | }
|
---|
[242] | 605 | }
|
---|
[766] | 606 | ulSearchCount = 1;
|
---|
[847] | 607 | } while (!DosFindNext(hDir,
|
---|
| 608 | &findbuf, sizeof(FILEFINDBUF3), &ulSearchCount));
|
---|
[551] | 609 | DosFindClose(hDir);
|
---|
[2] | 610 | }
|
---|
[551] | 611 | DosError(FERR_DISABLEHARDERR);
|
---|
| 612 | }
|
---|
[2] | 613 | }
|
---|
| 614 |
|
---|
[242] | 615 | MRESULT EXPENTRY TextSubProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
| 616 | {
|
---|
[574] | 617 | PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
[2] | 618 |
|
---|
[551] | 619 | switch (msg) {
|
---|
| 620 | case WM_CHAR:
|
---|
| 621 | if (SHORT1FROMMP(mp1) & KC_KEYUP) {
|
---|
| 622 | if ((SHORT1FROMMP(mp1) & KC_VIRTUALKEY) &&
|
---|
| 623 | (SHORT1FROMMP(mp2) & 255) == '\r')
|
---|
| 624 | PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_COMMAND,
|
---|
| 625 | MPFROM2SHORT(DID_OK, 0), MPVOID);
|
---|
[242] | 626 | }
|
---|
[551] | 627 | break;
|
---|
| 628 | }
|
---|
| 629 | return oldproc(hwnd, msg, mp1, mp2);
|
---|
[2] | 630 | }
|
---|
| 631 |
|
---|
[242] | 632 | MRESULT EXPENTRY WalkDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
| 633 | {
|
---|
[551] | 634 | WALKER *wa;
|
---|
| 635 | CHAR szBuff[CCHMAXPATH + 1], szBuffer[CCHMAXPATH + 1], *p;
|
---|
| 636 | SHORT sSelect;
|
---|
| 637 | static BOOL okay; /* avoid combobox selecting as filled */
|
---|
| 638 | static CHAR lastdir[CCHMAXPATH + 1];
|
---|
[2] | 639 |
|
---|
[551] | 640 | switch (msg) {
|
---|
| 641 | case UM_SETUP2:
|
---|
| 642 | case WM_INITDLG:
|
---|
| 643 | okay = FALSE;
|
---|
| 644 | *lastdir = 0;
|
---|
| 645 | if (!mp2) {
|
---|
| 646 | Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
|
---|
| 647 | WinDismissDlg(hwnd, 0);
|
---|
| 648 | break;
|
---|
| 649 | }
|
---|
| 650 | wa = xmallocz(sizeof(WALKER), pszSrcFile, __LINE__);
|
---|
| 651 | if (!wa) {
|
---|
| 652 | WinDismissDlg(hwnd, 0);
|
---|
| 653 | break;
|
---|
| 654 | }
|
---|
| 655 | wa->size = (USHORT) sizeof(WALKER);
|
---|
[574] | 656 | WinSetWindowPtr(hwnd, QWL_USER, (PVOID) wa);
|
---|
[551] | 657 | wa->szReturnPath = (CHAR *) mp2;
|
---|
[242] | 658 | {
|
---|
[551] | 659 | PFNWP oldproc;
|
---|
[2] | 660 |
|
---|
[551] | 661 | oldproc = WinSubclassWindow(WinWindowFromID(hwnd, WALK_PATH),
|
---|
| 662 | (PFNWP) TextSubProc);
|
---|
| 663 | if (oldproc)
|
---|
| 664 | WinSetWindowPtr(WinWindowFromID(hwnd, WALK_PATH),
|
---|
| 665 | QWL_USER, (PVOID) oldproc);
|
---|
| 666 | WinSendDlgItemMsg(WinWindowFromID(hwnd, WALK_RECENT),
|
---|
| 667 | CBID_EDIT,
|
---|
| 668 | EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
| 669 | WinSendDlgItemMsg(WinWindowFromID(hwnd, WALK_RECENT),
|
---|
| 670 | CBID_EDIT,
|
---|
| 671 | EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID);
|
---|
| 672 | }
|
---|
[939] | 673 | {
|
---|
| 674 | SWP swp;
|
---|
| 675 | ULONG size = sizeof(SWP);
|
---|
| 676 |
|
---|
| 677 | PrfQueryProfileData(fmprof, FM3Str, "WalkDir.Position", (PVOID) &swp, &size);
|
---|
| 678 | WinSetWindowPos(hwnd,
|
---|
| 679 | HWND_TOP,
|
---|
| 680 | swp.x,
|
---|
| 681 | swp.y,
|
---|
| 682 | swp.cx,
|
---|
| 683 | swp.cy,
|
---|
| 684 | swp.fl);
|
---|
| 685 | }
|
---|
[551] | 686 | PosOverOkay(hwnd);
|
---|
| 687 | if (msg == UM_SETUP2)
|
---|
| 688 | wa->nounwriteable = FALSE;
|
---|
| 689 | else
|
---|
| 690 | wa->nounwriteable = TRUE;
|
---|
| 691 | if (!*wa->szReturnPath)
|
---|
| 692 | save_dir2(wa->szCurrentPath);
|
---|
| 693 | else {
|
---|
| 694 | strcpy(wa->szCurrentPath, wa->szReturnPath);
|
---|
| 695 | MakeFullName(wa->szCurrentPath);
|
---|
| 696 | }
|
---|
| 697 | if (wa->nounwriteable &&
|
---|
| 698 | (driveflags[toupper(*wa->szCurrentPath) - 'A'] &
|
---|
| 699 | DRIVE_NOTWRITEABLE)) {
|
---|
[2] | 700 |
|
---|
[551] | 701 | ULONG bd;
|
---|
[2] | 702 |
|
---|
[551] | 703 | strcpy(wa->szCurrentPath, "C:\\");
|
---|
| 704 | if (DosQuerySysInfo(QSV_BOOT_DRIVE,
|
---|
| 705 | QSV_BOOT_DRIVE,
|
---|
| 706 | (PVOID) & bd, (ULONG) sizeof(ULONG)))
|
---|
[766] | 707 | bd = 3;
|
---|
[551] | 708 | *wa->szCurrentPath = (CHAR) bd + '@';
|
---|
| 709 | }
|
---|
| 710 | WinSendDlgItemMsg(hwnd,
|
---|
| 711 | WALK_PATH,
|
---|
| 712 | EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
| 713 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath);
|
---|
| 714 | if (!loadedudirs)
|
---|
| 715 | load_udirs();
|
---|
| 716 | { /* fill user list box */
|
---|
| 717 | ULONG ulDriveNum, ulDriveMap;
|
---|
| 718 | ULONG ulSearchCount;
|
---|
[847] | 719 | FILEFINDBUF3 findbuf;
|
---|
[551] | 720 | HDIR hDir;
|
---|
| 721 | APIRET rc;
|
---|
| 722 | LINKDIRS *info, *temp;
|
---|
[2] | 723 |
|
---|
[551] | 724 | DosError(FERR_DISABLEHARDERR);
|
---|
| 725 | DosQCurDisk(&ulDriveNum, &ulDriveMap);
|
---|
| 726 | info = udirhead;
|
---|
| 727 | while (info) {
|
---|
| 728 | if (IsFullName(info->path) &&
|
---|
| 729 | !(driveflags[toupper(*info->path) - 'A'] &
|
---|
| 730 | (DRIVE_IGNORE | DRIVE_INVALID))) {
|
---|
| 731 | DosError(FERR_DISABLEHARDERR);
|
---|
| 732 | hDir = HDIR_CREATE;
|
---|
[766] | 733 | ulSearchCount = 1;
|
---|
[551] | 734 | if (!IsRoot(info->path))
|
---|
[847] | 735 | rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY |
|
---|
| 736 | MUST_HAVE_DIRECTORY | FILE_READONLY |
|
---|
| 737 | FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,
|
---|
| 738 | &findbuf, sizeof(FILEFINDBUF3),
|
---|
| 739 | &ulSearchCount, FIL_STANDARD);
|
---|
[551] | 740 | else {
|
---|
| 741 | rc = 0;
|
---|
| 742 | findbuf.attrFile = FILE_DIRECTORY;
|
---|
| 743 | }
|
---|
| 744 | if (!rc) {
|
---|
| 745 | if (!IsRoot(info->path))
|
---|
| 746 | DosFindClose(hDir);
|
---|
| 747 | if (findbuf.attrFile & FILE_DIRECTORY)
|
---|
| 748 | WinSendDlgItemMsg(hwnd, WALK_USERLIST, LM_INSERTITEM,
|
---|
| 749 | MPFROM2SHORT(LIT_SORTASCENDING, 0),
|
---|
| 750 | MPFROMP(info->path));
|
---|
| 751 | else {
|
---|
| 752 | temp = info->next;
|
---|
| 753 | remove_udir(info->path);
|
---|
| 754 | info = temp;
|
---|
| 755 | continue;
|
---|
[242] | 756 | }
|
---|
[551] | 757 | }
|
---|
[766] | 758 | else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) {
|
---|
[551] | 759 | temp = info->next;
|
---|
| 760 | remove_udir(info->path);
|
---|
| 761 | info = temp;
|
---|
| 762 | continue;
|
---|
| 763 | }
|
---|
| 764 | }
|
---|
| 765 | info = info->next;
|
---|
| 766 | }
|
---|
| 767 | info = ldirhead;
|
---|
| 768 | while (info) {
|
---|
| 769 | if (IsFullName(info->path) &&
|
---|
| 770 | !(driveflags[toupper(*info->path) - 'A'] &
|
---|
| 771 | (DRIVE_IGNORE | DRIVE_INVALID))) {
|
---|
| 772 | DosError(FERR_DISABLEHARDERR);
|
---|
| 773 | hDir = HDIR_CREATE;
|
---|
[766] | 774 | ulSearchCount = 1;
|
---|
[551] | 775 | if (!IsRoot(info->path))
|
---|
[847] | 776 | rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY |
|
---|
| 777 | MUST_HAVE_DIRECTORY | FILE_READONLY |
|
---|
| 778 | FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,
|
---|
| 779 | &findbuf, sizeof(FILEFINDBUF3),
|
---|
| 780 | &ulSearchCount, FIL_STANDARD);
|
---|
[551] | 781 | else {
|
---|
| 782 | rc = 0;
|
---|
| 783 | findbuf.attrFile = FILE_DIRECTORY;
|
---|
| 784 | }
|
---|
| 785 | if (!rc) {
|
---|
| 786 | if (!IsRoot(info->path))
|
---|
| 787 | DosFindClose(hDir);
|
---|
| 788 | if (findbuf.attrFile & FILE_DIRECTORY)
|
---|
| 789 | WinSendDlgItemMsg(hwnd, WALK_RECENT, LM_INSERTITEM,
|
---|
| 790 | MPFROM2SHORT(LIT_SORTASCENDING, 0),
|
---|
| 791 | MPFROMP(info->path));
|
---|
| 792 | else {
|
---|
| 793 | temp = info->next;
|
---|
| 794 | remove_ldir(info->path);
|
---|
| 795 | info = temp;
|
---|
| 796 | continue;
|
---|
[242] | 797 | }
|
---|
[551] | 798 | WinSetDlgItemText(hwnd, WALK_RECENT,
|
---|
| 799 | GetPString(IDS_WALKRECENTDIRSTEXT));
|
---|
| 800 | }
|
---|
[766] | 801 | else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) {
|
---|
[551] | 802 | temp = info->next;
|
---|
| 803 | remove_ldir(info->path);
|
---|
| 804 | info = temp;
|
---|
| 805 | continue;
|
---|
| 806 | }
|
---|
[242] | 807 | }
|
---|
[551] | 808 | info = info->next;
|
---|
| 809 | }
|
---|
| 810 | }
|
---|
| 811 | FillPathListBox(hwnd,
|
---|
| 812 | WinWindowFromID(hwnd, WALK_DRIVELIST),
|
---|
| 813 | WinWindowFromID(hwnd, WALK_DIRLIST),
|
---|
| 814 | wa->szCurrentPath, wa->nounwriteable);
|
---|
| 815 | if (!PostMsg(hwnd, UM_SETUP4, MPVOID, MPVOID))
|
---|
| 816 | okay = TRUE;
|
---|
| 817 | {
|
---|
| 818 | MRESULT ret;
|
---|
[2] | 819 |
|
---|
[551] | 820 | ret = WinDefDlgProc(hwnd, WM_INITDLG, mp1, mp2);
|
---|
| 821 | WinSendMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
|
---|
| 822 | WinInvalidateRect(WinWindowFromID(hwnd, WALK_PATH), NULL, TRUE);
|
---|
| 823 | return ret;
|
---|
| 824 | }
|
---|
[2] | 825 |
|
---|
[551] | 826 | case UM_SETUP4:
|
---|
| 827 | okay = TRUE;
|
---|
| 828 | return 0;
|
---|
[2] | 829 |
|
---|
[551] | 830 | case WM_ADJUSTWINDOWPOS:
|
---|
| 831 | PostMsg(hwnd, UM_SETDIR, MPVOID, MPVOID);
|
---|
| 832 | break;
|
---|
[2] | 833 |
|
---|
[551] | 834 | case UM_SETDIR:
|
---|
| 835 | PaintRecessedWindow(WinWindowFromID(hwnd, WALK_HELP), (HPS) 0, FALSE,
|
---|
| 836 | TRUE);
|
---|
| 837 | return 0;
|
---|
[2] | 838 |
|
---|
[551] | 839 | case WM_PRESPARAMCHANGED:
|
---|
| 840 | {
|
---|
| 841 | ULONG AttrFound, AttrValue[64], cbRetLen;
|
---|
[2] | 842 |
|
---|
[551] | 843 | cbRetLen = WinQueryPresParam(hwnd, (ULONG) mp1, 0, &AttrFound,
|
---|
| 844 | (ULONG) sizeof(AttrValue), &AttrValue, 0);
|
---|
| 845 | if (cbRetLen) {
|
---|
| 846 | switch (AttrFound) {
|
---|
| 847 | case PP_FONTNAMESIZE:
|
---|
| 848 | PrfWriteProfileData(fmprof,
|
---|
| 849 | appname,
|
---|
| 850 | "WalkFont", (PVOID) AttrValue, cbRetLen);
|
---|
| 851 | *WalkFont = 0;
|
---|
| 852 | WalkFontSize = sizeof(WalkFont);
|
---|
| 853 | WinInvalidateRect(WinWindowFromID(hwnd, WALK_PATH), NULL, TRUE);
|
---|
| 854 | break;
|
---|
[242] | 855 | }
|
---|
[551] | 856 | }
|
---|
| 857 | }
|
---|
| 858 | break;
|
---|
[2] | 859 |
|
---|
[551] | 860 | case UM_SETUP3:
|
---|
| 861 | save_udirs();
|
---|
| 862 | if (hwndMain)
|
---|
| 863 | PostMsg(hwndMain, UM_FILLUSERLIST, MPVOID, MPVOID);
|
---|
| 864 | return 0;
|
---|
[2] | 865 |
|
---|
[551] | 866 | case UM_SETUP:
|
---|
| 867 | {
|
---|
| 868 | INT x;
|
---|
| 869 | USHORT id[] = { WALK_PATH, WALK_DIRLIST, WALK_USERLIST,
|
---|
| 870 | WALK_RECENT, 0
|
---|
| 871 | };
|
---|
[2] | 872 |
|
---|
[551] | 873 | if (*WalkFont ||
|
---|
| 874 | (PrfQueryProfileData(fmprof,
|
---|
| 875 | appname,
|
---|
| 876 | "WalkFont",
|
---|
| 877 | (PVOID) WalkFont,
|
---|
| 878 | &WalkFontSize) && WalkFontSize)) {
|
---|
| 879 | for (x = 0; id[x]; x++)
|
---|
| 880 | WinSetPresParam(WinWindowFromID(hwnd, id[x]),
|
---|
| 881 | PP_FONTNAMESIZE, WalkFontSize, (PVOID) WalkFont);
|
---|
| 882 | }
|
---|
| 883 | }
|
---|
| 884 | return 0;
|
---|
[2] | 885 |
|
---|
[551] | 886 | case UM_CONTROL:
|
---|
| 887 | case WM_CONTROL:
|
---|
[574] | 888 | wa = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
[551] | 889 | if (SHORT1FROMMP(mp1) == WALK_DRIVELIST ||
|
---|
| 890 | SHORT1FROMMP(mp1) == WALK_DIRLIST ||
|
---|
| 891 | SHORT1FROMMP(mp1) == WALK_USERLIST ||
|
---|
| 892 | SHORT1FROMMP(mp1) == WALK_RECENT) {
|
---|
| 893 | sSelect = (USHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 894 | SHORT1FROMMP(mp1),
|
---|
| 895 | LM_QUERYSELECTION, MPVOID, MPVOID);
|
---|
| 896 | *szBuffer = 0;
|
---|
| 897 | if (sSelect >= 0)
|
---|
| 898 | WinSendDlgItemMsg(hwnd, SHORT1FROMMP(mp1), LM_QUERYITEMTEXT,
|
---|
| 899 | MPFROM2SHORT(sSelect, CCHMAXPATH),
|
---|
| 900 | MPFROMP(szBuffer));
|
---|
| 901 | }
|
---|
| 902 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 903 | case WALK_PATH:
|
---|
| 904 | if (SHORT2FROMMP(mp1) == EN_SETFOCUS)
|
---|
| 905 | WinSetDlgItemText(hwnd, WALK_HELP, GetPString(IDS_WALKCURRDIRTEXT));
|
---|
| 906 | else if (SHORT2FROMMP(mp1) == EN_KILLFOCUS)
|
---|
| 907 | WinSetDlgItemText(hwnd, WALK_HELP,
|
---|
| 908 | GetPString(IDS_WALKDEFAULTHELPTEXT));
|
---|
| 909 | break;
|
---|
[2] | 910 |
|
---|
[551] | 911 | case WALK_RECENT:
|
---|
| 912 | if (okay && SHORT2FROMMP(mp1) == CBN_LBSELECT) {
|
---|
[2] | 913 |
|
---|
[551] | 914 | ULONG ulSearchCount;
|
---|
[847] | 915 | FILEFINDBUF3 findbuf;
|
---|
[551] | 916 | HDIR hDir;
|
---|
| 917 | APIRET rc;
|
---|
[2] | 918 |
|
---|
[551] | 919 | // *szBuffer = 0;
|
---|
| 920 | // WinQueryDlgItemText(hwnd,WALK_RECENT,CCHMAXPATH,szBuffer);
|
---|
| 921 | if (!*szBuffer)
|
---|
| 922 | break;
|
---|
| 923 | DosError(FERR_DISABLEHARDERR);
|
---|
| 924 | hDir = HDIR_CREATE;
|
---|
[766] | 925 | ulSearchCount = 1;
|
---|
[551] | 926 | if (!IsRoot(szBuffer)) {
|
---|
[847] | 927 | rc = DosFindFirst(szBuffer, &hDir, FILE_DIRECTORY |
|
---|
| 928 | MUST_HAVE_DIRECTORY | FILE_READONLY |
|
---|
| 929 | FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,
|
---|
| 930 | &findbuf, sizeof(FILEFINDBUF3),
|
---|
| 931 | &ulSearchCount, FIL_STANDARD);
|
---|
[551] | 932 | if (!rc)
|
---|
| 933 | DosFindClose(hDir);
|
---|
| 934 | }
|
---|
| 935 | else {
|
---|
| 936 | findbuf.attrFile = FILE_DIRECTORY;
|
---|
| 937 | rc = 0;
|
---|
| 938 | }
|
---|
| 939 | if (rc)
|
---|
| 940 | Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__,
|
---|
[838] | 941 | "xDosFindFirst");
|
---|
[551] | 942 | else if (~findbuf.attrFile & FILE_DIRECTORY)
|
---|
| 943 | Runtime_Error(pszSrcFile, __LINE__, "not a directory");
|
---|
| 944 | else {
|
---|
| 945 | strcpy(wa->szCurrentPath, szBuffer);
|
---|
| 946 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath);
|
---|
| 947 | WinSetDlgItemText(hwnd, WALK_RECENT, wa->szCurrentPath);
|
---|
| 948 | FillPathListBox(hwnd,
|
---|
| 949 | WinWindowFromID(hwnd, WALK_DRIVELIST),
|
---|
| 950 | WinWindowFromID(hwnd, WALK_DIRLIST),
|
---|
| 951 | wa->szCurrentPath, FALSE);
|
---|
| 952 | }
|
---|
| 953 | }
|
---|
| 954 | else if (SHORT2FROMMP(mp1) == CBN_ENTER)
|
---|
| 955 | PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(DID_OK, 0), MPVOID);
|
---|
| 956 | else if (SHORT2FROMMP(mp1) == CBN_SHOWLIST)
|
---|
| 957 | WinSetDlgItemText(hwnd, WALK_HELP,
|
---|
| 958 | GetPString(IDS_WALKRECENTDIRSHELPTEXT));
|
---|
| 959 | break;
|
---|
[2] | 960 |
|
---|
[551] | 961 | case WALK_USERLIST:
|
---|
| 962 | if (okay && *szBuffer && SHORT2FROMMP(mp1) == LN_SELECT) {
|
---|
[2] | 963 |
|
---|
[551] | 964 | ULONG ulSearchCount;
|
---|
[847] | 965 | FILEFINDBUF3 findbuf;
|
---|
[551] | 966 | HDIR hDir;
|
---|
| 967 | APIRET rc;
|
---|
[2] | 968 |
|
---|
[551] | 969 | DosError(FERR_DISABLEHARDERR);
|
---|
| 970 | hDir = HDIR_CREATE;
|
---|
[766] | 971 | ulSearchCount = 1;
|
---|
[551] | 972 | if (!IsRoot(szBuffer)) {
|
---|
[847] | 973 | rc = DosFindFirst(szBuffer,
|
---|
| 974 | &hDir,
|
---|
| 975 | FILE_DIRECTORY |
|
---|
| 976 | MUST_HAVE_DIRECTORY | FILE_READONLY |
|
---|
| 977 | FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,
|
---|
| 978 | &findbuf,
|
---|
| 979 | sizeof(FILEFINDBUF3),
|
---|
| 980 | &ulSearchCount, FIL_STANDARD);
|
---|
[551] | 981 | if (!rc)
|
---|
| 982 | DosFindClose(hDir);
|
---|
| 983 | }
|
---|
| 984 | else {
|
---|
| 985 | findbuf.attrFile = FILE_DIRECTORY;
|
---|
| 986 | rc = 0;
|
---|
| 987 | }
|
---|
| 988 | if (rc)
|
---|
| 989 | Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__,
|
---|
[838] | 990 | "xDosFindFirst");
|
---|
[551] | 991 | else if (~findbuf.attrFile & FILE_DIRECTORY)
|
---|
| 992 | Runtime_Error(pszSrcFile, __LINE__, "not a directory");
|
---|
| 993 | else {
|
---|
| 994 | strcpy(wa->szCurrentPath, szBuffer);
|
---|
| 995 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath);
|
---|
| 996 | FillPathListBox(hwnd,
|
---|
| 997 | WinWindowFromID(hwnd, WALK_DRIVELIST),
|
---|
| 998 | WinWindowFromID(hwnd, WALK_DIRLIST),
|
---|
| 999 | wa->szCurrentPath, FALSE);
|
---|
| 1000 | }
|
---|
| 1001 | }
|
---|
| 1002 | else if (SHORT2FROMMP(mp1) == LN_ENTER)
|
---|
| 1003 | PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(DID_OK, 0), MPVOID);
|
---|
| 1004 | else if (SHORT2FROMMP(mp1) == LN_SETFOCUS)
|
---|
| 1005 | WinSetDlgItemText(hwnd,
|
---|
| 1006 | WALK_HELP, GetPString(IDS_WALKUSERDIRSHELPTEXT));
|
---|
| 1007 | else if (SHORT2FROMMP(mp1) == LN_KILLFOCUS)
|
---|
| 1008 | WinSetDlgItemText(hwnd,
|
---|
| 1009 | WALK_HELP, GetPString(IDS_WALKDEFAULTHELPTEXT));
|
---|
| 1010 | break;
|
---|
[2] | 1011 |
|
---|
[551] | 1012 | case WALK_DRIVELIST:
|
---|
| 1013 | if (okay && *szBuffer && SHORT2FROMMP(mp1) == LN_ENTER) {
|
---|
[2] | 1014 |
|
---|
[551] | 1015 | ULONG ulDirLen = CCHMAXPATH;
|
---|
| 1016 | APIRET rc;
|
---|
[2] | 1017 |
|
---|
[551] | 1018 | rc = DosQCurDir(toupper(*szBuffer) - '@', &szBuff[3], &ulDirLen);
|
---|
| 1019 | if (!rc) {
|
---|
| 1020 | strcpy(wa->szCurrentPath, "C:\\");
|
---|
| 1021 | *wa->szCurrentPath = toupper(*szBuffer);
|
---|
| 1022 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath);
|
---|
| 1023 | FillPathListBox(hwnd,
|
---|
| 1024 | WinWindowFromID(hwnd, WALK_DRIVELIST),
|
---|
| 1025 | WinWindowFromID(hwnd, WALK_DIRLIST),
|
---|
| 1026 | wa->szCurrentPath, FALSE);
|
---|
| 1027 | }
|
---|
| 1028 | }
|
---|
| 1029 | else if (SHORT2FROMMP(mp1) == LN_SETFOCUS)
|
---|
| 1030 | WinSetDlgItemText(hwnd, WALK_HELP,
|
---|
| 1031 | GetPString(IDS_WALKDRIVELISTHELPTEXT));
|
---|
| 1032 | else if (SHORT2FROMMP(mp1) == LN_KILLFOCUS)
|
---|
| 1033 | WinSetDlgItemText(hwnd, WALK_HELP,
|
---|
| 1034 | GetPString(IDS_WALKDEFAULTHELPTEXT));
|
---|
| 1035 | break;
|
---|
[2] | 1036 |
|
---|
[551] | 1037 | case WALK_DIRLIST:
|
---|
| 1038 | if (okay && SHORT2FROMMP(mp1) == LN_ENTER) {
|
---|
[2] | 1039 |
|
---|
[551] | 1040 | ULONG ulSearchCount;
|
---|
[847] | 1041 | FILEFINDBUF3 findbuf;
|
---|
[551] | 1042 | HDIR hDir;
|
---|
| 1043 | APIRET rc;
|
---|
[2] | 1044 |
|
---|
[551] | 1045 | bstrip(szBuffer);
|
---|
| 1046 | if (*szBuffer) {
|
---|
| 1047 | strcpy(szBuff, wa->szCurrentPath);
|
---|
| 1048 | if (szBuff[strlen(szBuff) - 1] != '\\')
|
---|
| 1049 | strcat(szBuff, "\\");
|
---|
| 1050 | strcat(szBuff, szBuffer);
|
---|
| 1051 | MakeFullName(szBuff);
|
---|
| 1052 | DosError(FERR_DISABLEHARDERR);
|
---|
| 1053 | hDir = HDIR_CREATE;
|
---|
[766] | 1054 | ulSearchCount = 1;
|
---|
[551] | 1055 | if (!IsRoot(szBuff)) {
|
---|
[847] | 1056 | rc = DosFindFirst(szBuff,
|
---|
| 1057 | &hDir,
|
---|
| 1058 | FILE_DIRECTORY |
|
---|
| 1059 | MUST_HAVE_DIRECTORY | FILE_READONLY |
|
---|
| 1060 | FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,
|
---|
| 1061 | &findbuf,
|
---|
| 1062 | sizeof(FILEFINDBUF3),
|
---|
| 1063 | &ulSearchCount, FIL_STANDARD);
|
---|
[551] | 1064 | if (!rc)
|
---|
| 1065 | DosFindClose(hDir);
|
---|
| 1066 | }
|
---|
| 1067 | else {
|
---|
| 1068 | findbuf.attrFile = FILE_DIRECTORY;
|
---|
| 1069 | rc = 0;
|
---|
| 1070 | }
|
---|
| 1071 | if (!rc && (findbuf.attrFile & FILE_DIRECTORY)) {
|
---|
| 1072 | strcpy(wa->szCurrentPath, szBuff);
|
---|
| 1073 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath);
|
---|
| 1074 | FillPathListBox(hwnd,
|
---|
| 1075 | WinWindowFromID(hwnd, WALK_DRIVELIST),
|
---|
| 1076 | WinWindowFromID(hwnd, WALK_DIRLIST),
|
---|
| 1077 | wa->szCurrentPath, FALSE);
|
---|
| 1078 | }
|
---|
[242] | 1079 | }
|
---|
[551] | 1080 | }
|
---|
| 1081 | else if (SHORT2FROMMP(mp1) == LN_SETFOCUS)
|
---|
| 1082 | WinSetDlgItemText(hwnd, WALK_HELP,
|
---|
| 1083 | GetPString(IDS_WALKDIRLISTHELPTEXT));
|
---|
| 1084 | else if (SHORT2FROMMP(mp1) == LN_KILLFOCUS)
|
---|
| 1085 | WinSetDlgItemText(hwnd, WALK_HELP,
|
---|
| 1086 | GetPString(IDS_WALKDEFAULTHELPTEXT));
|
---|
| 1087 | break;
|
---|
| 1088 | }
|
---|
| 1089 | return 0;
|
---|
| 1090 |
|
---|
| 1091 | case WM_COMMAND:
|
---|
[574] | 1092 | wa = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
[551] | 1093 | if (!wa)
|
---|
| 1094 | WinDismissDlg(hwnd, 0);
|
---|
| 1095 | *szBuff = 0;
|
---|
| 1096 | WinQueryDlgItemText(hwnd, WALK_PATH, CCHMAXPATH, szBuff);
|
---|
| 1097 | bstrip(szBuff);
|
---|
| 1098 | while ((p = strchr(szBuff, '/')) != NULL)
|
---|
| 1099 | *p = '\\';
|
---|
| 1100 | while (strlen(szBuff) > 3 && szBuff[strlen(szBuff) - 1] == '\\')
|
---|
| 1101 | szBuff[strlen(szBuff) - 1] = 0;
|
---|
| 1102 | MakeFullName(szBuff);
|
---|
[864] | 1103 | if (*szBuff && stricmp(szBuff, wa->szCurrentPath) && SHORT1FROMMP(mp1) != DID_CANCEL) {
|
---|
[551] | 1104 | if (!SetDir(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT),
|
---|
| 1105 | QW_OWNER), hwnd, szBuff, 0))
|
---|
| 1106 | strcpy(wa->szCurrentPath, szBuff);
|
---|
[865] | 1107 | else
|
---|
[242] | 1108 | return 0;
|
---|
[551] | 1109 | }
|
---|
| 1110 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath);
|
---|
| 1111 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 1112 | case WALK_ADD:
|
---|
| 1113 | *szBuff = 0;
|
---|
| 1114 | WinQueryDlgItemText(hwnd, WALK_PATH, CCHMAXPATH, szBuff);
|
---|
| 1115 | bstrip(szBuff);
|
---|
| 1116 | while ((p = strchr(szBuff, '/')) != NULL)
|
---|
| 1117 | *p = '\\';
|
---|
| 1118 | if (*szBuff && !IsFile(szBuff)) {
|
---|
| 1119 | MakeFullName(szBuff);
|
---|
[617] | 1120 | add_udir(TRUE, szBuff);
|
---|
| 1121 | if (fUdirsChanged) {
|
---|
[551] | 1122 | WinSendDlgItemMsg(hwnd,
|
---|
| 1123 | WALK_USERLIST,
|
---|
| 1124 | LM_INSERTITEM,
|
---|
| 1125 | MPFROM2SHORT(LIT_SORTASCENDING, 0),
|
---|
| 1126 | MPFROMP(szBuff));
|
---|
| 1127 | wa->changed = 1;
|
---|
| 1128 | }
|
---|
| 1129 | }
|
---|
| 1130 | break;
|
---|
[2] | 1131 |
|
---|
[551] | 1132 | case WALK_DELETE:
|
---|
| 1133 | *szBuff = 0;
|
---|
| 1134 | WinQueryDlgItemText(hwnd, WALK_PATH, CCHMAXPATH, szBuff);
|
---|
| 1135 | bstrip(szBuff);
|
---|
| 1136 | while ((p = strchr(szBuff, '/')) != NULL)
|
---|
| 1137 | *p = '\\';
|
---|
| 1138 | if (*szBuff && !IsFile(szBuff)) {
|
---|
[242] | 1139 | MakeFullName(szBuff);
|
---|
[551] | 1140 | sSelect = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 1141 | WALK_USERLIST,
|
---|
| 1142 | LM_SEARCHSTRING,
|
---|
| 1143 | MPFROM2SHORT(0, LIT_FIRST),
|
---|
| 1144 | MPFROMP(szBuff));
|
---|
| 1145 | if (sSelect >= 0) {
|
---|
| 1146 | WinSendDlgItemMsg(hwnd,
|
---|
| 1147 | WALK_USERLIST,
|
---|
| 1148 | LM_DELETEITEM, MPFROM2SHORT(sSelect, 0), MPVOID);
|
---|
| 1149 | remove_udir(szBuff);
|
---|
| 1150 | wa->changed = 1;
|
---|
[242] | 1151 | }
|
---|
[551] | 1152 | }
|
---|
| 1153 | break;
|
---|
[2] | 1154 |
|
---|
[551] | 1155 | case DID_OK:
|
---|
| 1156 | if (*wa->szCurrentPath) {
|
---|
| 1157 | strcpy(wa->szReturnPath, wa->szCurrentPath);
|
---|
| 1158 | MakeValidDir(wa->szReturnPath);
|
---|
| 1159 | if (fAutoAddAllDirs)
|
---|
| 1160 | add_udir(FALSE, wa->szReturnPath);
|
---|
| 1161 | if (fChangeTarget) {
|
---|
| 1162 | strcpy(targetdir, wa->szReturnPath);
|
---|
| 1163 | PrfWriteProfileString(fmprof, appname, "Targetdir", targetdir);
|
---|
| 1164 | }
|
---|
| 1165 | }
|
---|
[939] | 1166 | {
|
---|
| 1167 | SWP swp;
|
---|
| 1168 | ULONG size = sizeof(SWP);
|
---|
| 1169 |
|
---|
| 1170 | WinQueryWindowPos(hwnd, &swp);
|
---|
| 1171 | PrfWriteProfileData(fmprof, FM3Str, "WalkDir.Position", (PVOID) &swp,
|
---|
| 1172 | size);
|
---|
| 1173 | }
|
---|
[551] | 1174 | if (wa->changed)
|
---|
| 1175 | WinSendMsg(hwnd, UM_SETUP3, MPVOID, MPVOID);
|
---|
| 1176 | WinDismissDlg(hwnd, 1);
|
---|
| 1177 | break;
|
---|
[2] | 1178 |
|
---|
[551] | 1179 | case IDM_HELP:
|
---|
| 1180 | if (hwndHelp)
|
---|
| 1181 | WinSendMsg(hwndHelp,
|
---|
| 1182 | HM_DISPLAY_HELP,
|
---|
| 1183 | MPFROM2SHORT(HELP_WALKEM, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
| 1184 | break;
|
---|
[2] | 1185 |
|
---|
[551] | 1186 | case DID_CANCEL:
|
---|
[939] | 1187 | {
|
---|
| 1188 | SWP swp;
|
---|
| 1189 | ULONG size = sizeof(SWP);
|
---|
| 1190 |
|
---|
| 1191 | WinQueryWindowPos(hwnd, &swp);
|
---|
| 1192 | PrfWriteProfileData(fmprof, FM3Str, "WalkDir.Position", (PVOID) &swp,
|
---|
| 1193 | size);
|
---|
| 1194 | }
|
---|
[551] | 1195 | if (wa->changed)
|
---|
[864] | 1196 | WinSendMsg(hwnd, UM_SETUP3, MPVOID, MPVOID);
|
---|
[551] | 1197 | free(wa);
|
---|
| 1198 | WinDismissDlg(hwnd, 0);
|
---|
| 1199 | break;
|
---|
| 1200 | }
|
---|
| 1201 | return 0;
|
---|
[2] | 1202 |
|
---|
[551] | 1203 | case WM_CLOSE:
|
---|
[939] | 1204 | break;
|
---|
[551] | 1205 | }
|
---|
| 1206 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1207 | }
|
---|
| 1208 |
|
---|
[242] | 1209 | MRESULT EXPENTRY WalkAllDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
| 1210 | {
|
---|
[551] | 1211 | switch (msg) {
|
---|
| 1212 | case WM_INITDLG:
|
---|
| 1213 | return WalkDlgProc(hwnd, UM_SETUP2, mp1, mp2);
|
---|
| 1214 | }
|
---|
| 1215 | return WalkDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1216 | }
|
---|
| 1217 |
|
---|
[242] | 1218 | MRESULT EXPENTRY WalkCopyDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
| 1219 | {
|
---|
[551] | 1220 | switch (msg) {
|
---|
| 1221 | case WM_INITDLG:
|
---|
| 1222 | WinSetWindowText(hwnd, GetPString(IDS_WALKCOPYDLGTEXT));
|
---|
| 1223 | return WalkDlgProc(hwnd, UM_SETUP2, mp1, mp2);
|
---|
| 1224 | }
|
---|
| 1225 | return WalkDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1226 | }
|
---|
| 1227 |
|
---|
[242] | 1228 | MRESULT EXPENTRY WalkMoveDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
| 1229 | {
|
---|
[551] | 1230 | switch (msg) {
|
---|
| 1231 | case WM_INITDLG:
|
---|
| 1232 | WinSetWindowText(hwnd, GetPString(IDS_WALKMOVEDLGTEXT));
|
---|
| 1233 | return WalkDlgProc(hwnd, UM_SETUP2, mp1, mp2);
|
---|
| 1234 | }
|
---|
| 1235 | return WalkDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1236 | }
|
---|
| 1237 |
|
---|
[242] | 1238 | MRESULT EXPENTRY WalkExtractDlgProc(HWND hwnd, ULONG msg, MPARAM mp1,
|
---|
| 1239 | MPARAM mp2)
|
---|
| 1240 | {
|
---|
[551] | 1241 | switch (msg) {
|
---|
| 1242 | case WM_INITDLG:
|
---|
| 1243 | WinSetWindowText(hwnd, GetPString(IDS_WALKEXTRACTDLGTEXT));
|
---|
| 1244 | return WalkDlgProc(hwnd, UM_SETUP2, mp1, mp2);
|
---|
| 1245 | }
|
---|
| 1246 | return WalkDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1247 | }
|
---|
| 1248 |
|
---|
[242] | 1249 | MRESULT EXPENTRY WalkTargetDlgProc(HWND hwnd, ULONG msg, MPARAM mp1,
|
---|
| 1250 | MPARAM mp2)
|
---|
| 1251 | {
|
---|
[551] | 1252 | switch (msg) {
|
---|
| 1253 | case WM_INITDLG:
|
---|
[242] | 1254 | {
|
---|
[551] | 1255 | char s[CCHMAXPATH + 32];
|
---|
[2] | 1256 |
|
---|
[551] | 1257 | sprintf(s,
|
---|
| 1258 | GetPString(IDS_WALKTARGETDLGTEXT),
|
---|
| 1259 | (*targetdir) ?
|
---|
| 1260 | NullStr :
|
---|
| 1261 | " (",
|
---|
| 1262 | (*targetdir) ?
|
---|
| 1263 | NullStr : GetPString(IDS_NONE), (*targetdir) ? NullStr : ")");
|
---|
| 1264 | WinSetWindowText(hwnd, s);
|
---|
[242] | 1265 | }
|
---|
[551] | 1266 | return WalkDlgProc(hwnd, UM_SETUP2, mp1, mp2);
|
---|
| 1267 | }
|
---|
| 1268 | return WalkDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1269 | }
|
---|
| 1270 |
|
---|
[242] | 1271 | MRESULT EXPENTRY WalkTwoDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
| 1272 | {
|
---|
[551] | 1273 | WALK2 *wa;
|
---|
| 1274 | CHAR szBuff[CCHMAXPATH + 1], szBuffer[CCHMAXPATH + 1], *p;
|
---|
| 1275 | SHORT sSelect;
|
---|
| 1276 | static BOOL okay; /* avoid combobox selecting as filled */
|
---|
[2] | 1277 |
|
---|
[551] | 1278 | switch (msg) {
|
---|
| 1279 | case UM_SETUP2:
|
---|
| 1280 | case WM_INITDLG:
|
---|
| 1281 | okay = FALSE;
|
---|
| 1282 | if (!mp2) {
|
---|
| 1283 | WinDismissDlg(hwnd, 0);
|
---|
| 1284 | break;
|
---|
| 1285 | }
|
---|
[574] | 1286 | WinSetWindowPtr(hwnd, QWL_USER, mp2);
|
---|
[551] | 1287 | wa = mp2;
|
---|
[242] | 1288 | {
|
---|
[551] | 1289 | PFNWP oldproc;
|
---|
[2] | 1290 |
|
---|
[551] | 1291 | oldproc = WinSubclassWindow(WinWindowFromID(hwnd, WALK_PATH),
|
---|
| 1292 | (PFNWP) TextSubProc);
|
---|
| 1293 | if (oldproc)
|
---|
| 1294 | WinSetWindowPtr(WinWindowFromID(hwnd, WALK_PATH),
|
---|
| 1295 | QWL_USER, (PVOID) oldproc);
|
---|
| 1296 | oldproc = WinSubclassWindow(WinWindowFromID(hwnd, WALK2_PATH),
|
---|
| 1297 | (PFNWP) TextSubProc);
|
---|
| 1298 | if (oldproc)
|
---|
| 1299 | WinSetWindowPtr(WinWindowFromID(hwnd, WALK2_PATH),
|
---|
| 1300 | QWL_USER, (PVOID) oldproc);
|
---|
| 1301 | }
|
---|
[939] | 1302 | {
|
---|
| 1303 | SWP swp;
|
---|
| 1304 | ULONG size = sizeof(SWP);
|
---|
| 1305 |
|
---|
| 1306 | PrfQueryProfileData(fmprof, FM3Str, "WalkDir2.Position", (PVOID) &swp, &size);
|
---|
| 1307 | WinSetWindowPos(hwnd,
|
---|
| 1308 | HWND_TOP,
|
---|
| 1309 | swp.x,
|
---|
| 1310 | swp.y,
|
---|
| 1311 | swp.cx,
|
---|
| 1312 | swp.cy,
|
---|
| 1313 | swp.fl);
|
---|
| 1314 | }
|
---|
[551] | 1315 | if (!*wa->szCurrentPath1)
|
---|
| 1316 | save_dir2(wa->szCurrentPath1);
|
---|
| 1317 | MakeFullName(wa->szCurrentPath1);
|
---|
| 1318 | if (!*wa->szCurrentPath2)
|
---|
| 1319 | save_dir2(wa->szCurrentPath2);
|
---|
| 1320 | MakeFullName(wa->szCurrentPath2);
|
---|
| 1321 | WinSendDlgItemMsg(hwnd,
|
---|
| 1322 | WALK_PATH,
|
---|
| 1323 | EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
| 1324 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath1);
|
---|
| 1325 | WinSendDlgItemMsg(hwnd, WALK2_PATH, EM_SETTEXTLIMIT,
|
---|
| 1326 | MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
|
---|
| 1327 | WinSetDlgItemText(hwnd, WALK2_PATH, wa->szCurrentPath2);
|
---|
| 1328 | FillPathListBox(hwnd,
|
---|
| 1329 | WinWindowFromID(hwnd, WALK_DRIVELIST),
|
---|
| 1330 | WinWindowFromID(hwnd, WALK_DIRLIST),
|
---|
| 1331 | wa->szCurrentPath1, FALSE);
|
---|
| 1332 | FillPathListBox(hwnd,
|
---|
| 1333 | WinWindowFromID(hwnd, WALK2_DRIVELIST),
|
---|
| 1334 | WinWindowFromID(hwnd, WALK2_DIRLIST),
|
---|
| 1335 | wa->szCurrentPath2, FALSE);
|
---|
| 1336 | if (!PostMsg(hwnd, UM_SETUP4, MPVOID, MPVOID))
|
---|
| 1337 | okay = TRUE;
|
---|
| 1338 | {
|
---|
| 1339 | MRESULT ret;
|
---|
[2] | 1340 |
|
---|
[551] | 1341 | ret = WinDefDlgProc(hwnd, WM_INITDLG, mp1, mp2);
|
---|
| 1342 | WinSendMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
|
---|
| 1343 | WinInvalidateRect(WinWindowFromID(hwnd, WALK_PATH), NULL, TRUE);
|
---|
| 1344 | WinInvalidateRect(WinWindowFromID(hwnd, WALK2_PATH), NULL, TRUE);
|
---|
| 1345 | return ret;
|
---|
| 1346 | }
|
---|
[2] | 1347 |
|
---|
[551] | 1348 | case UM_SETUP4:
|
---|
| 1349 | okay = TRUE;
|
---|
| 1350 | return 0;
|
---|
[2] | 1351 |
|
---|
[551] | 1352 | case WM_PRESPARAMCHANGED:
|
---|
| 1353 | {
|
---|
| 1354 | ULONG AttrFound, AttrValue[64], cbRetLen;
|
---|
[2] | 1355 |
|
---|
[551] | 1356 | cbRetLen = WinQueryPresParam(hwnd, (ULONG) mp1, 0, &AttrFound,
|
---|
| 1357 | (ULONG) sizeof(AttrValue), &AttrValue, 0);
|
---|
| 1358 | if (cbRetLen) {
|
---|
| 1359 | switch (AttrFound) {
|
---|
| 1360 | case PP_FONTNAMESIZE:
|
---|
| 1361 | PrfWriteProfileData(fmprof,
|
---|
| 1362 | appname,
|
---|
| 1363 | "WalkFont", (PVOID) AttrValue, cbRetLen);
|
---|
| 1364 | *WalkFont = 0;
|
---|
| 1365 | WalkFontSize = sizeof(WalkFont);
|
---|
| 1366 | WinInvalidateRect(WinWindowFromID(hwnd, WALK_PATH), NULL, TRUE);
|
---|
| 1367 | break;
|
---|
[242] | 1368 | }
|
---|
[551] | 1369 | }
|
---|
| 1370 | }
|
---|
| 1371 | break;
|
---|
[2] | 1372 |
|
---|
[551] | 1373 | case UM_SETUP:
|
---|
| 1374 | {
|
---|
| 1375 | INT x;
|
---|
| 1376 | USHORT id[] = { WALK_PATH, WALK_DIRLIST,
|
---|
| 1377 | WALK2_PATH, WALK2_DIRLIST, 0
|
---|
| 1378 | };
|
---|
[2] | 1379 |
|
---|
[551] | 1380 | if (*WalkFont ||
|
---|
| 1381 | (PrfQueryProfileData(fmprof,
|
---|
| 1382 | appname,
|
---|
| 1383 | "WalkFont",
|
---|
| 1384 | (PVOID) WalkFont,
|
---|
| 1385 | &WalkFontSize) && WalkFontSize)) {
|
---|
| 1386 | for (x = 0; id[x]; x++)
|
---|
| 1387 | WinSetPresParam(WinWindowFromID(hwnd, id[x]),
|
---|
| 1388 | PP_FONTNAMESIZE, WalkFontSize, (PVOID) WalkFont);
|
---|
| 1389 | }
|
---|
| 1390 | }
|
---|
| 1391 | return 0;
|
---|
[2] | 1392 |
|
---|
[551] | 1393 | case UM_CONTROL:
|
---|
| 1394 | case WM_CONTROL:
|
---|
[574] | 1395 | wa = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
[551] | 1396 | if (SHORT1FROMMP(mp1) == WALK_DRIVELIST ||
|
---|
| 1397 | SHORT1FROMMP(mp1) == WALK_DIRLIST ||
|
---|
| 1398 | SHORT1FROMMP(mp1) == WALK2_DRIVELIST ||
|
---|
| 1399 | SHORT1FROMMP(mp1) == WALK2_DIRLIST) {
|
---|
| 1400 | sSelect = (USHORT) WinSendDlgItemMsg(hwnd,
|
---|
| 1401 | SHORT1FROMMP(mp1),
|
---|
| 1402 | LM_QUERYSELECTION, MPVOID, MPVOID);
|
---|
| 1403 | *szBuffer = 0;
|
---|
| 1404 | if (sSelect >= 0)
|
---|
| 1405 | WinSendDlgItemMsg(hwnd, SHORT1FROMMP(mp1), LM_QUERYITEMTEXT,
|
---|
| 1406 | MPFROM2SHORT(sSelect, CCHMAXPATH),
|
---|
| 1407 | MPFROMP(szBuffer));
|
---|
| 1408 | }
|
---|
| 1409 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 1410 | case WALK_DRIVELIST:
|
---|
| 1411 | if (okay && *szBuffer && SHORT2FROMMP(mp1) == LN_ENTER) {
|
---|
[2] | 1412 |
|
---|
[551] | 1413 | ULONG ulDirLen = CCHMAXPATH;
|
---|
| 1414 | APIRET rc;
|
---|
[2] | 1415 |
|
---|
[551] | 1416 | rc = DosQCurDir(toupper(*szBuffer) - '@', &szBuff[3], &ulDirLen);
|
---|
| 1417 | if (!rc) {
|
---|
| 1418 | strcpy(wa->szCurrentPath1, "C:\\");
|
---|
| 1419 | *wa->szCurrentPath1 = toupper(*szBuffer);
|
---|
| 1420 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath1);
|
---|
| 1421 | FillPathListBox(hwnd,
|
---|
| 1422 | WinWindowFromID(hwnd, WALK_DRIVELIST),
|
---|
| 1423 | WinWindowFromID(hwnd, WALK_DIRLIST),
|
---|
| 1424 | wa->szCurrentPath1, FALSE);
|
---|
| 1425 | }
|
---|
| 1426 | }
|
---|
| 1427 | break;
|
---|
[2] | 1428 |
|
---|
[551] | 1429 | case WALK_DIRLIST:
|
---|
| 1430 | if (okay && SHORT2FROMMP(mp1) == LN_ENTER) {
|
---|
[2] | 1431 |
|
---|
[551] | 1432 | ULONG ulSearchCount;
|
---|
[847] | 1433 | FILEFINDBUF3 findbuf;
|
---|
[551] | 1434 | HDIR hDir;
|
---|
| 1435 | APIRET rc;
|
---|
[2] | 1436 |
|
---|
[551] | 1437 | bstrip(szBuffer);
|
---|
| 1438 | if (*szBuffer) {
|
---|
| 1439 | strcpy(szBuff, wa->szCurrentPath1);
|
---|
| 1440 | if (szBuff[strlen(szBuff) - 1] != '\\')
|
---|
| 1441 | strcat(szBuff, "\\");
|
---|
| 1442 | strcat(szBuff, szBuffer);
|
---|
| 1443 | MakeFullName(szBuff);
|
---|
| 1444 | DosError(FERR_DISABLEHARDERR);
|
---|
| 1445 | hDir = HDIR_CREATE;
|
---|
[766] | 1446 | ulSearchCount = 1;
|
---|
[551] | 1447 | if (!IsRoot(szBuff)) {
|
---|
[847] | 1448 | rc = DosFindFirst(szBuff,
|
---|
| 1449 | &hDir,
|
---|
| 1450 | FILE_DIRECTORY |
|
---|
| 1451 | MUST_HAVE_DIRECTORY | FILE_READONLY |
|
---|
| 1452 | FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,
|
---|
| 1453 | &findbuf,
|
---|
| 1454 | sizeof(FILEFINDBUF3),
|
---|
| 1455 | &ulSearchCount, FIL_STANDARD);
|
---|
[551] | 1456 | if (!rc)
|
---|
| 1457 | DosFindClose(hDir);
|
---|
| 1458 | }
|
---|
| 1459 | else {
|
---|
| 1460 | findbuf.attrFile = FILE_DIRECTORY;
|
---|
| 1461 | rc = 0;
|
---|
| 1462 | }
|
---|
| 1463 | if (!rc && (findbuf.attrFile & FILE_DIRECTORY)) {
|
---|
| 1464 | strcpy(wa->szCurrentPath1, szBuff);
|
---|
| 1465 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath1);
|
---|
| 1466 | FillPathListBox(hwnd,
|
---|
| 1467 | WinWindowFromID(hwnd, WALK_DRIVELIST),
|
---|
| 1468 | WinWindowFromID(hwnd, WALK_DIRLIST),
|
---|
| 1469 | wa->szCurrentPath1, FALSE);
|
---|
| 1470 | }
|
---|
| 1471 | }
|
---|
| 1472 | }
|
---|
| 1473 | break;
|
---|
[2] | 1474 |
|
---|
[551] | 1475 | case WALK2_DRIVELIST:
|
---|
| 1476 | if (okay && *szBuffer && SHORT2FROMMP(mp1) == LN_ENTER) {
|
---|
[2] | 1477 |
|
---|
[551] | 1478 | ULONG ulDirLen = CCHMAXPATH;
|
---|
| 1479 | APIRET rc;
|
---|
[2] | 1480 |
|
---|
[551] | 1481 | rc = DosQCurDir(toupper(*szBuffer) - '@', &szBuff[3], &ulDirLen);
|
---|
| 1482 | if (!rc) {
|
---|
| 1483 | strcpy(wa->szCurrentPath2, "C:\\");
|
---|
| 1484 | *wa->szCurrentPath2 = toupper(*szBuffer);
|
---|
| 1485 | WinSetDlgItemText(hwnd, WALK2_PATH, wa->szCurrentPath2);
|
---|
| 1486 | FillPathListBox(hwnd,
|
---|
| 1487 | WinWindowFromID(hwnd, WALK2_DRIVELIST),
|
---|
| 1488 | WinWindowFromID(hwnd, WALK2_DIRLIST),
|
---|
| 1489 | wa->szCurrentPath2, FALSE);
|
---|
| 1490 | }
|
---|
| 1491 | }
|
---|
| 1492 | break;
|
---|
[2] | 1493 |
|
---|
[551] | 1494 | case WALK2_DIRLIST:
|
---|
| 1495 | if (okay && SHORT2FROMMP(mp1) == LN_ENTER) {
|
---|
[2] | 1496 |
|
---|
[551] | 1497 | ULONG ulSearchCount;
|
---|
[847] | 1498 | FILEFINDBUF3 findbuf;
|
---|
[551] | 1499 | HDIR hDir;
|
---|
| 1500 | APIRET rc;
|
---|
[2] | 1501 |
|
---|
[551] | 1502 | bstrip(szBuffer);
|
---|
| 1503 | if (*szBuffer) {
|
---|
| 1504 | strcpy(szBuff, wa->szCurrentPath2);
|
---|
| 1505 | if (szBuff[strlen(szBuff) - 1] != '\\')
|
---|
| 1506 | strcat(szBuff, "\\");
|
---|
| 1507 | strcat(szBuff, szBuffer);
|
---|
| 1508 | MakeFullName(szBuff);
|
---|
| 1509 | DosError(FERR_DISABLEHARDERR);
|
---|
| 1510 | hDir = HDIR_CREATE;
|
---|
[766] | 1511 | ulSearchCount = 1;
|
---|
[551] | 1512 | if (!IsRoot(szBuff)) {
|
---|
[847] | 1513 | rc = DosFindFirst(szBuff,
|
---|
| 1514 | &hDir,
|
---|
| 1515 | FILE_DIRECTORY |
|
---|
| 1516 | MUST_HAVE_DIRECTORY | FILE_READONLY |
|
---|
| 1517 | FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,
|
---|
| 1518 | &findbuf,
|
---|
| 1519 | sizeof(FILEFINDBUF3),
|
---|
| 1520 | &ulSearchCount, FIL_STANDARD);
|
---|
[551] | 1521 | if (!rc)
|
---|
| 1522 | DosFindClose(hDir);
|
---|
| 1523 | }
|
---|
| 1524 | else {
|
---|
| 1525 | findbuf.attrFile = FILE_DIRECTORY;
|
---|
| 1526 | rc = 0;
|
---|
| 1527 | }
|
---|
| 1528 | if (!rc && (findbuf.attrFile & FILE_DIRECTORY)) {
|
---|
| 1529 | strcpy(wa->szCurrentPath2, szBuff);
|
---|
| 1530 | WinSetDlgItemText(hwnd, WALK2_PATH, wa->szCurrentPath2);
|
---|
| 1531 | FillPathListBox(hwnd,
|
---|
| 1532 | WinWindowFromID(hwnd, WALK2_DRIVELIST),
|
---|
| 1533 | WinWindowFromID(hwnd, WALK2_DIRLIST),
|
---|
| 1534 | wa->szCurrentPath2, FALSE);
|
---|
| 1535 | }
|
---|
[242] | 1536 | }
|
---|
[551] | 1537 | }
|
---|
| 1538 | break;
|
---|
| 1539 | }
|
---|
| 1540 | return 0;
|
---|
| 1541 |
|
---|
| 1542 | case WM_COMMAND:
|
---|
[574] | 1543 | wa = WinQueryWindowPtr(hwnd, QWL_USER);
|
---|
[551] | 1544 | if (!wa)
|
---|
| 1545 | WinDismissDlg(hwnd, 0);
|
---|
| 1546 | *szBuff = 0;
|
---|
| 1547 | WinQueryDlgItemText(hwnd, WALK_PATH, CCHMAXPATH, szBuff);
|
---|
| 1548 | bstrip(szBuff);
|
---|
| 1549 | while ((p = strchr(szBuff, '/')) != NULL)
|
---|
| 1550 | *p = '\\';
|
---|
| 1551 | while (strlen(szBuff) > 3 && szBuff[strlen(szBuff) - 1] == '\\')
|
---|
| 1552 | szBuff[strlen(szBuff) - 1] = 0;
|
---|
| 1553 | MakeFullName(szBuff);
|
---|
[864] | 1554 | if (*szBuff && stricmp(szBuff, wa->szCurrentPath1) && SHORT1FROMMP(mp1) != DID_CANCEL) {
|
---|
[551] | 1555 | if (!SetDir(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT),
|
---|
| 1556 | QW_OWNER), hwnd, szBuff, 0))
|
---|
| 1557 | strcpy(wa->szCurrentPath1, szBuff);
|
---|
[865] | 1558 | else
|
---|
[242] | 1559 | return 0;
|
---|
[551] | 1560 | }
|
---|
| 1561 | WinSetDlgItemText(hwnd, WALK_PATH, wa->szCurrentPath1);
|
---|
| 1562 | *szBuff = 0;
|
---|
| 1563 | WinQueryDlgItemText(hwnd, WALK2_PATH, CCHMAXPATH, szBuff);
|
---|
| 1564 | bstrip(szBuff);
|
---|
| 1565 | while ((p = strchr(szBuff, '/')) != NULL)
|
---|
| 1566 | *p = '\\';
|
---|
| 1567 | while (strlen(szBuff) > 3 && szBuff[strlen(szBuff) - 1] == '\\')
|
---|
| 1568 | szBuff[strlen(szBuff) - 1] = 0;
|
---|
| 1569 | MakeFullName(szBuff);
|
---|
[864] | 1570 | if (*szBuff && stricmp(szBuff, wa->szCurrentPath2) && SHORT1FROMMP(mp1) != DID_CANCEL) {
|
---|
[551] | 1571 | if (!SetDir(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT),
|
---|
| 1572 | QW_OWNER), hwnd, szBuff, 0))
|
---|
| 1573 | strcpy(wa->szCurrentPath2, szBuff);
|
---|
[865] | 1574 | else
|
---|
[551] | 1575 | return 0;
|
---|
| 1576 | }
|
---|
| 1577 | WinSetDlgItemText(hwnd, WALK2_PATH, wa->szCurrentPath2);
|
---|
| 1578 | switch (SHORT1FROMMP(mp1)) {
|
---|
| 1579 | case DID_OK:
|
---|
[939] | 1580 | {
|
---|
| 1581 | SWP swp;
|
---|
| 1582 | ULONG size = sizeof(SWP);
|
---|
| 1583 |
|
---|
| 1584 | WinQueryWindowPos(hwnd, &swp);
|
---|
| 1585 | PrfWriteProfileData(fmprof, FM3Str, "WalkDir2.Position", (PVOID) &swp,
|
---|
| 1586 | size);
|
---|
| 1587 | }
|
---|
[551] | 1588 | WinDismissDlg(hwnd, 1);
|
---|
| 1589 | break;
|
---|
[2] | 1590 |
|
---|
[551] | 1591 | case IDM_HELP:
|
---|
| 1592 | if (hwndHelp)
|
---|
| 1593 | WinSendMsg(hwndHelp,
|
---|
| 1594 | HM_DISPLAY_HELP,
|
---|
| 1595 | MPFROM2SHORT(HELP_WALKEM2, 0), MPFROMSHORT(HM_RESOURCEID));
|
---|
| 1596 | break;
|
---|
[2] | 1597 |
|
---|
[551] | 1598 | case DID_CANCEL:
|
---|
[939] | 1599 | {
|
---|
| 1600 | SWP swp;
|
---|
| 1601 | ULONG size = sizeof(SWP);
|
---|
| 1602 |
|
---|
| 1603 | WinQueryWindowPos(hwnd, &swp);
|
---|
| 1604 | PrfWriteProfileData(fmprof, FM3Str, "WalkDir2.Position", (PVOID) &swp,
|
---|
| 1605 | size);
|
---|
| 1606 | }
|
---|
[551] | 1607 | WinDismissDlg(hwnd, 0);
|
---|
| 1608 | break;
|
---|
| 1609 | }
|
---|
| 1610 | return 0;
|
---|
[2] | 1611 |
|
---|
[551] | 1612 | case WM_CLOSE:
|
---|
| 1613 | break;
|
---|
| 1614 | }
|
---|
| 1615 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1616 | }
|
---|
| 1617 |
|
---|
[242] | 1618 | MRESULT EXPENTRY WalkTwoCmpDlgProc(HWND hwnd, ULONG msg, MPARAM mp1,
|
---|
| 1619 | MPARAM mp2)
|
---|
| 1620 | {
|
---|
[551] | 1621 | switch (msg) {
|
---|
| 1622 | case WM_INITDLG:
|
---|
| 1623 | WinSetWindowText(hwnd, GetPString(IDS_WALKCOMPAREDLGTEXT));
|
---|
| 1624 | return WalkTwoDlgProc(hwnd, UM_SETUP2, mp1, mp2);
|
---|
| 1625 | }
|
---|
| 1626 | return WalkTwoDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1627 | }
|
---|
| 1628 |
|
---|
[242] | 1629 | MRESULT EXPENTRY WalkTwoSetDlgProc(HWND hwnd, ULONG msg, MPARAM mp1,
|
---|
| 1630 | MPARAM mp2)
|
---|
| 1631 | {
|
---|
[551] | 1632 | switch (msg) {
|
---|
| 1633 | case WM_INITDLG:
|
---|
| 1634 | WinSetWindowText(hwnd, GetPString(IDS_WALKSETDIRSDLGTEXT));
|
---|
| 1635 | return WalkTwoDlgProc(hwnd, UM_SETUP2, mp1, mp2);
|
---|
| 1636 | }
|
---|
| 1637 | return WalkTwoDlgProc(hwnd, msg, mp1, mp2);
|
---|
[2] | 1638 | }
|
---|
[794] | 1639 |
|
---|
| 1640 | #pragma alloc_text(WALKER,FillPathListBox,WalkDlgProc,TextSubProc)
|
---|
| 1641 | #pragma alloc_text(WALKER,WalkAllDlgProc,WalkCopyDlgProc)
|
---|
| 1642 | #pragma alloc_text(WALKER,WalkMoveDlgProc,WalkExtractDlgProc,WalkTargetDlgProc)
|
---|
| 1643 | #pragma alloc_text(WALK2,WalkTwoDlgProc,WalkTwoCmpDlgProc,WalkTwoSetDlgProc)
|
---|
| 1644 | #pragma alloc_text(UDIRS,add_udir,remove_udir,remove_ldir,load_udirs)
|
---|
[807] | 1645 | #pragma alloc_text(UDIRS,save_udirs,load_setups,save_setups,add_setups)
|
---|
[794] | 1646 | #pragma alloc_text(UDIRS,remove_setup)
|
---|