Changeset 1394 for trunk/dll/notebook.c
- Timestamp:
- Feb 5, 2009, 5:17:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/notebook.c
r1391 r1394 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2004, 200 8Steven H. Levine9 Copyright (c) 2004, 2009 Steven H. Levine 10 10 11 11 01 Aug 04 SHL Rework lstrip/rstrip usage … … 31 31 29 Feb 08 GKY Changes to enable user settable command line length 32 32 08 Mar 08 JBS Ticket 230: Replace prefixless INI keys for default directory containers with 33 33 keys using a "DirCnr." prefix 34 34 06 Jul 08 GKY Update delete/undelete to include move to and open XWP trashcan 35 35 11 Jul 08 JBS Ticket 230: Simplified code and eliminated some local variables by incorporating 36 37 36 all the details view settings (both the global variables and those in the 37 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 38 38 19 Jul 08 JBS Ticket 197: Support accelerator keys in setting dialogs. 39 39 20 Jul 08 JBS Ticket 114: Support user-selectable env. strings in Tree container. … … 41 41 02 Aug 08 JBS Ticket 114: Improved code to avoid traps. 42 42 30 Nov 08 GKY Add the option of creating a subdirectory from the arcname 43 43 for the extract path to arc container. 44 44 25 Dec 08 GKY Add ProcessDirectoryThread to allow optional recursive drive scan at startup. 45 45 01 Jan 09 GKY Add option to rescan tree container on eject of removable media … … 202 202 case WM_INITDLG: 203 203 WinSendDlgItemMsg(hwnd, CFGA_VIRUS, EM_SETTEXTLIMIT, 204 204 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 205 205 WinSendDlgItemMsg(hwnd, CFGA_EXTRACTPATH, EM_SETTEXTLIMIT, 206 206 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 207 207 WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), FALSE); 208 208 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 216 216 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 217 217 switch (CHARMSG(&msg)->vkey) { 218 219 220 221 222 223 224 225 226 227 228 229 230 231 218 case VK_F3: 219 case VK_ENTER: 220 case VK_NEWLINE: 221 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 222 return 0; 223 break; 224 case VK_ESC: 225 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 226 return 0; 227 break; 228 case VK_F1: 229 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 230 return 0; 231 break; 232 232 } 233 233 } … … 251 251 switch (SHORT2FROMMP(mp1)) { 252 252 case EN_KILLFOCUS: 253 254 253 WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), FALSE); 254 break; 255 255 case EN_SETFOCUS: 256 257 256 WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), TRUE); 257 break; 258 258 } 259 259 break; … … 261 261 switch (SHORT2FROMMP(mp1)) { 262 262 case BN_CLICKED: 263 264 265 266 267 268 269 270 271 272 273 274 275 276 263 if (WinQueryButtonCheckstate(hwnd, CFGA_DEFARC)) { 264 265 ARC_TYPE *pat = arcsighead; // Hide dups 266 267 if (!WinDlgBox(HWND_DESKTOP, hwnd, 268 SBoxDlgProc, FM3ModHandle, ASEL_FRAME, 269 (PVOID) & pat) || !pat || !pat->id || !*pat->id) { 270 DosBeep(250, 100); // Complain 271 WinCheckButton(hwnd, CFGA_DEFARC, FALSE); 272 } 273 else 274 WinSetDlgItemText(hwnd, CFGA_DEFARCNAME, pat->id); 275 } 276 break; 277 277 default: 278 278 break; 279 279 } 280 280 break; … … 300 300 case IDM_HELP: 301 301 if (hwndHelp) 302 303 302 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 303 MPFROM2SHORT(HELP_CFGA, 0), MPFROMSHORT(HM_RESOURCEID)); 304 304 break; 305 305 306 306 case CFGA_FIND: 307 307 { 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 308 CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9]; 309 USHORT id; 310 HWND hwndFocus; 311 312 strcpy(filename, "*.EXE"); 313 hwndFocus = WinQueryFocus(HWND_DESKTOP); 314 if (hwndFocus) { 315 id = WinQueryWindowUShort(hwndFocus, QWS_ID); 316 switch (id) { 317 case CFGA_VIRUS: 318 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 319 BldQuotedFileName(szfilename, filename); 320 strcat(szfilename, " %p"); 321 WinSetDlgItemText(hwnd, id, szfilename); 322 } 323 break; 324 case CFGA_EXTRACTPATH: 325 strcpy(filename, extractpath); 326 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, 327 WalkExtractDlgProc, FM3ModHandle, WALK_FRAME, 328 MPFROMP(filename)) && *filename) 329 WinSetDlgItemText(hwnd, id, filename); 330 break; 331 default: 332 Runtime_Error(pszSrcFile, __LINE__, "bad case"); 333 break; 334 } 335 } 336 336 } 337 337 break; … … 342 342 fQuickArcFind = WinQueryButtonCheckstate(hwnd, CFGA_QUICKARCFIND); 343 343 PrfWriteProfileData(fmprof, 344 345 344 appname, 345 "QuickArcFind", &fQuickArcFind, sizeof(BOOL)); 346 346 fArcStuffVisible = WinQueryButtonCheckstate(hwnd, CFGA_ARCSTUFFVISIBLE); 347 347 PrfWriteProfileData(fmprof, 348 349 348 appname, 349 "ArcStuffVisible", &fArcStuffVisible, sizeof(BOOL)); 350 350 fFileNameCnrPath = WinQueryButtonCheckstate(hwnd, CFGA_FILENAMEPATH); 351 351 PrfWriteProfileData(fmprof, 352 353 352 appname, 353 "FileNamePathCnr", &fFileNameCnrPath, sizeof(BOOL)); 354 354 fFolderAfterExtract = WinQueryButtonCheckstate(hwnd, 355 355 CFGA_FOLDERAFTEREXTRACT); 356 356 PrfWriteProfileData(fmprof, 357 358 359 357 appname, 358 "FolderAfterExtract", 359 &fFolderAfterExtract, sizeof(BOOL)); 360 360 if (WinQueryButtonCheckstate(hwnd, CFGA_DEFARC)) { 361 361 … … 375 375 376 376 szCLBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 377 378 377 if (!szCLBuf) 378 return 0; //already complained 379 379 pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 380 380 if (!pszWorkBuf) { 381 382 381 free(szCLBuf); 382 return 0; //already complained 383 383 } 384 384 WinQueryDlgItemText(hwnd, CFGA_VIRUS, MaxComLineStrg, szCLBuf); 385 385 szCLBuf[MaxComLineStrg - 1] = 0; 386 386 if (strcmp(szCLBuf, virus)){ 387 388 389 390 387 NormalizeCmdLine(pszWorkBuf, szCLBuf); 388 memcpy(virus, pszWorkBuf, strlen(pszWorkBuf) + 1); 389 if (!strchr(virus, '%') && strlen(virus) > 3) 390 strcat(virus, " %p"); 391 391 } 392 392 free(pszWorkBuf); 393 393 free(szCLBuf); 394 394 if (!*virus) 395 395 strcpy(virus, "OS2SCAN.EXE %p /SUB /A"); 396 396 WinQueryDlgItemText(hwnd, CFGA_EXTRACTPATH, CCHMAXPATH, szPathBuf); 397 397 szPathBuf[CCHMAXPATH - 1] = 0; 398 398 bstrip(szPathBuf); 399 399 if (strcmp(extractpath, szPathBuf)) { 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 400 memcpy(extractpath, szPathBuf, strlen(szPathBuf) + 1); 401 if (*extractpath){ 402 MakeFullName(extractpath); 403 if (IsFile(extractpath)) { 404 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 405 GetPString(IDS_WARNINGTEXT), 406 GetPString(IDS_EXTPATHNOTVALIDTEXT), 407 extractpath); 408 if (ulResult == MBID_YES) 409 *extractpath = 0; 410 if (ulResult == MBID_CANCEL){ 411 WinDlgBox(HWND_DESKTOP, 412 hwnd, 413 CfgDlgProc, 414 FM3ModHandle, 415 CFG_FRAME, 416 MPFROMLONG(IDM_ARCHIVERSETTINGS)); 417 break; 418 } 419 } 420 } 421 421 } 422 422 } … … 428 428 fCancelAction = FALSE; 429 429 WinDlgBox(HWND_DESKTOP, 430 431 432 433 434 430 hwnd, 431 CfgDlgProc, 432 FM3ModHandle, 433 CFG_FRAME, 434 MPFROMLONG(IDM_ARCHIVERSETTINGS)); 435 435 } 436 436 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 443 443 case WM_INITDLG: 444 444 WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_SETTEXTLIMIT, 445 445 MPFROMSHORT(8), MPVOID); 446 446 WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_OVERRIDESETLIMITS, 447 447 MPFROMLONG(FILESTOGET_MAX), MPFROMLONG(FILESTOGET_MIN)); 448 448 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 449 449 break; … … 456 456 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 457 457 switch (CHARMSG(&msg)->vkey) { 458 459 460 461 462 463 464 465 466 467 468 469 470 471 458 case VK_F3: 459 case VK_ENTER: 460 case VK_NEWLINE: 461 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 462 return 0; 463 break; 464 case VK_ESC: 465 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 466 return 0; 467 break; 468 case VK_F1: 469 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 470 return 0; 471 break; 472 472 } 473 473 } … … 492 492 WinCheckButton(hwnd, CFGS_EJECTFLPYSCAN, fEjectFlpyScan); 493 493 WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_SETCURRENTVALUE, 494 494 MPFROMLONG(FilesToGet), MPVOID); 495 495 return 0; 496 496 … … 500 500 case CFGS_FORCELOWER: 501 501 { 502 503 504 505 506 507 508 509 510 511 512 513 514 502 BOOL temp; 503 504 temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1)); 505 if (temp) { 506 switch (SHORT1FROMMP(mp1)) { 507 case CFGS_FORCEUPPER: 508 WinCheckButton(hwnd, CFGS_FORCELOWER, FALSE); 509 break; 510 case CFGS_FORCELOWER: 511 WinCheckButton(hwnd, CFGS_FORCEUPPER, FALSE); 512 break; 513 } 514 } 515 515 } 516 516 break; … … 533 533 case IDM_HELP: 534 534 if (hwndHelp) 535 536 535 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 536 MPFROM2SHORT(HELP_CFGS, 0), MPFROMSHORT(HM_RESOURCEID)); 537 537 break; 538 538 } … … 542 542 fLoadLongnames = WinQueryButtonCheckstate(hwnd, CFGS_LOADLONGNAMES); 543 543 PrfWriteProfileData(fmprof, appname, "LoadLongname", &fLoadLongnames, 544 544 sizeof(BOOL)); 545 545 fLoadSubject = WinQueryButtonCheckstate(hwnd, CFGS_LOADSUBJECTS); 546 546 PrfWriteProfileData(fmprof, appname, "LoadSubject", &fLoadSubject, 547 547 sizeof(BOOL)); 548 548 fRemoteBug = WinQueryButtonCheckstate(hwnd, CFGS_REMOTEBUG); 549 549 PrfWriteProfileData(fmprof, appname, "RemoteBug", &fRemoteBug, 550 550 sizeof(BOOL)); 551 551 fRScanLocal = WinQueryButtonCheckstate(hwnd, CFGS_RSCANLOCAL); 552 552 PrfWriteProfileData(fmprof, appname, "RScanLocal", &fRScanLocal, 553 553 sizeof(BOOL)); 554 554 fRScanRemote = WinQueryButtonCheckstate(hwnd, CFGS_RSCANREMOTE); 555 555 PrfWriteProfileData(fmprof, appname, "RScanRemote", &fRScanRemote, 556 556 sizeof(BOOL)); 557 557 fRScanVirtual = WinQueryButtonCheckstate(hwnd, CFGS_RSCANVIRTUAL); 558 558 PrfWriteProfileData(fmprof, appname, "RScanVirtual", &fRScanVirtual, 559 559 sizeof(BOOL)); 560 560 fRScanSlow = WinQueryButtonCheckstate(hwnd, CFGS_RSCANSLOW); 561 561 PrfWriteProfileData(fmprof, appname, "RScanSlow", &fRScanSlow, 562 562 sizeof(BOOL)); 563 563 fRScanNoWrite = WinQueryButtonCheckstate(hwnd, CFGS_RSCANNOWRITE); 564 564 PrfWriteProfileData(fmprof, appname, "RScanNoWrite", &fRScanNoWrite, 565 565 sizeof(BOOL)); 566 566 fNoRemovableScan = WinQueryButtonCheckstate(hwnd, CFGS_NOREMOVABLESCAN); 567 567 PrfWriteProfileData(fmprof, appname, "NoRemovableScan", &fNoRemovableScan, 568 568 sizeof(BOOL)); 569 569 fEjectRemovableScan = WinQueryButtonCheckstate(hwnd, CFGS_EJECTREMOVABLESCAN); 570 570 PrfWriteProfileData(fmprof, appname, "EjectRemovableScan", &fEjectRemovableScan, 571 571 sizeof(BOOL)); 572 572 fEjectCDScan = WinQueryButtonCheckstate(hwnd, CFGS_EJECTCDSCAN); 573 573 PrfWriteProfileData(fmprof, appname, "EjectCDScan", &fEjectCDScan, 574 574 sizeof(BOOL)); 575 575 fEjectFlpyScan = WinQueryButtonCheckstate(hwnd, CFGS_EJECTFLPYSCAN); 576 576 PrfWriteProfileData(fmprof, appname, "EjectFlpyScan", &fEjectFlpyScan, 577 577 sizeof(BOOL)); 578 578 fNoIconsFiles = WinQueryButtonCheckstate(hwnd, CFGS_NOICONSFILES); 579 579 fNoIconsFiles = (fNoIconsFiles) ? FALSE : TRUE; 580 580 PrfWriteProfileData(fmprof, appname, "NoIconsFiles", 581 581 &fNoIconsFiles, sizeof(BOOL)); 582 582 fNoIconsDirs = WinQueryButtonCheckstate(hwnd, CFGS_NOICONSDIRS); 583 583 fNoIconsDirs = (fNoIconsDirs) ? FALSE : TRUE; 584 584 PrfWriteProfileData(fmprof, appname, "NoIconsDirs", 585 585 &fNoIconsDirs, sizeof(BOOL)); 586 586 fForceUpper = WinQueryButtonCheckstate(hwnd, CFGS_FORCEUPPER); 587 587 PrfWriteProfileData(fmprof, appname, "ForceUpper", 588 588 &fForceUpper, sizeof(BOOL)); 589 589 fForceLower = WinQueryButtonCheckstate(hwnd, CFGS_FORCELOWER); 590 590 PrfWriteProfileData(fmprof, appname, "ForceLower", 591 591 &fForceLower, sizeof(BOOL)); 592 592 { 593 593 WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_QUERYVALUE, 594 594 MPFROMP(&FilesToGet), MPFROM2SHORT(0, SPBQ_DONOTUPDATE)); 595 595 if (FilesToGet < FILESTOGET_MIN) 596 596 FilesToGet = FILESTOGET_MIN; 597 597 else if (FilesToGet > FILESTOGET_MAX) 598 598 FilesToGet = FILESTOGET_MAX; 599 599 PrfWriteProfileData(fmprof, 600 600 appname, "FilesToGet", &FilesToGet, sizeof(ULONG)); 601 601 } 602 602 break; … … 611 611 case WM_INITDLG: 612 612 WinSendDlgItemMsg(hwnd, CFGV_VIEWER, EM_SETTEXTLIMIT, 613 613 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 614 614 WinSendDlgItemMsg(hwnd, CFGV_EDITOR, EM_SETTEXTLIMIT, 615 615 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 616 616 WinSendDlgItemMsg(hwnd, CFGV_BINVIEW, EM_SETTEXTLIMIT, 617 617 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 618 618 WinSendDlgItemMsg(hwnd, CFGV_BINED, EM_SETTEXTLIMIT, 619 619 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 620 620 WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), FALSE); 621 621 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 629 629 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 630 630 switch (CHARMSG(&msg)->vkey) { 631 632 633 634 635 636 637 638 639 640 641 642 643 644 631 case VK_F3: 632 case VK_ENTER: 633 case VK_NEWLINE: 634 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 635 return 0; 636 break; 637 case VK_ESC: 638 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 639 return 0; 640 break; 641 case VK_F1: 642 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 643 return 0; 644 break; 645 645 } 646 646 } … … 666 666 switch (SHORT2FROMMP(mp1)) { 667 667 case EN_KILLFOCUS: 668 669 668 WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), FALSE); 669 break; 670 670 case EN_SETFOCUS: 671 672 671 WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), TRUE); 672 break; 673 673 } 674 674 break; … … 691 691 case IDM_HELP: 692 692 if (hwndHelp) 693 694 693 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 694 MPFROM2SHORT(HELP_CFGV, 0), MPFROMSHORT(HM_RESOURCEID)); 695 695 break; 696 696 697 697 case CFGV_FIND: 698 698 { 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 699 CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9]; 700 USHORT id; 701 HWND hwndFocus; 702 703 strcpy(filename, "*.EXE"); 704 hwndFocus = WinQueryFocus(HWND_DESKTOP); 705 if (hwndFocus) { 706 id = WinQueryWindowUShort(hwndFocus, QWS_ID); 707 switch (id) { 708 case CFGV_BINVIEW: 709 case CFGV_BINED: 710 case CFGV_VIEWER: 711 case CFGV_EDITOR: 712 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 713 BldQuotedFileName(szfilename, filename); 714 strcat(szfilename, " %a"); 715 WinSetDlgItemText(hwnd, id, szfilename); 716 } 717 break; 718 default: 719 Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id); 720 break; 721 } 722 } 723 723 } 724 724 break; … … 732 732 733 733 szCLBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 734 735 734 if (!szCLBuf) 735 return 0; //already complained 736 736 pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 737 737 if (!pszWorkBuf) { 738 739 738 free(szCLBuf); 739 return 0; //already complained 740 740 } 741 741 WinQueryDlgItemText(hwnd, CFGV_VIEWER, MaxComLineStrg, szCLBuf); 742 742 szCLBuf[MaxComLineStrg - 1] = 0; 743 743 if (strcmp(szCLBuf, viewer)){ 744 745 746 747 744 NormalizeCmdLine(pszWorkBuf, szCLBuf); 745 memcpy(viewer, pszWorkBuf, strlen(pszWorkBuf) + 1); 746 if (!strchr(viewer, '%') && strlen(viewer) > 3) 747 strcat(viewer, " %a"); 748 748 } 749 749 WinQueryDlgItemText(hwnd, CFGV_EDITOR, MaxComLineStrg, szCLBuf); 750 750 szCLBuf[MaxComLineStrg - 1] = 0; 751 751 if (strcmp(szCLBuf, editor)){ 752 753 754 755 752 NormalizeCmdLine(pszWorkBuf, szCLBuf); 753 memcpy(editor, pszWorkBuf, strlen(pszWorkBuf) + 1); 754 if (!strchr(editor, '%') && strlen(editor) > 3) 755 strcat(editor, " %a"); 756 756 } 757 757 WinQueryDlgItemText(hwnd, CFGV_BINVIEW, MaxComLineStrg, szCLBuf); 758 758 szCLBuf[MaxComLineStrg - 1] = 0; 759 759 if (strcmp(szCLBuf, binview)){ 760 761 762 763 760 NormalizeCmdLine(pszWorkBuf, szCLBuf); 761 memcpy(binview, pszWorkBuf, strlen(pszWorkBuf) + 1); 762 if (!strchr(binview, '%') && strlen(binview) > 3) 763 strcat(binview, " %a"); 764 764 } 765 765 WinQueryDlgItemText(hwnd, CFGV_BINED, MaxComLineStrg, szCLBuf); 766 766 szCLBuf[MaxComLineStrg - 1] = 0; 767 767 if (strcmp(szCLBuf, bined)){ 768 769 770 771 768 NormalizeCmdLine(pszWorkBuf, szCLBuf); 769 memcpy(bined, pszWorkBuf, strlen(pszWorkBuf) + 1); 770 if (!strchr(bined, '%') && strlen(bined) > 3) 771 strcat(bined, " %a"); 772 772 } 773 773 free(pszWorkBuf); … … 779 779 fUseNewViewer = WinQueryButtonCheckstate(hwnd, CFGV_USENEWVIEWER); 780 780 PrfWriteProfileData(fmprof, appname, "UseNewViewer", &fUseNewViewer, 781 781 sizeof(BOOL)); 782 782 fGuessType = WinQueryButtonCheckstate(hwnd, CFGV_GUESSTYPE); 783 783 PrfWriteProfileData(fmprof, appname, "GuessType", &fGuessType, 784 784 sizeof(BOOL)); 785 785 fViewChild = WinQueryButtonCheckstate(hwnd, CFGV_VIEWCHILD); 786 786 PrfWriteProfileData(fmprof, appname, "ViewChild", &fViewChild, 787 787 sizeof(BOOL)); 788 788 fCheckMM = WinQueryButtonCheckstate(hwnd, CFGV_CHECKMM); 789 789 PrfWriteProfileData(fmprof, appname, "CheckMM", &fCheckMM, sizeof(BOOL)); … … 795 795 fCancelAction = FALSE; 796 796 WinDlgBox(HWND_DESKTOP, 797 798 799 800 801 797 hwnd, 798 CfgDlgProc, 799 FM3ModHandle, 800 CFG_FRAME, 801 MPFROMLONG(IDM_VIEWERSETTINGS)); 802 802 } 803 803 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 809 809 case WM_INITDLG: 810 810 WinSendDlgItemMsg(hwnd, CFGH_RUNFTPWORKDIR, EM_SETTEXTLIMIT, 811 811 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 812 812 WinSendDlgItemMsg(hwnd, CFGH_RUNHTTPWORKDIR, EM_SETTEXTLIMIT, 813 813 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 814 814 WinSendDlgItemMsg(hwnd, CFGH_FTPRUN, EM_SETTEXTLIMIT, 815 815 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 816 816 WinSendDlgItemMsg(hwnd, CFGH_HTTPRUN, EM_SETTEXTLIMIT, 817 817 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 818 818 WinSendDlgItemMsg(hwnd, CFGH_MAILRUN, EM_SETTEXTLIMIT, 819 819 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 820 820 WinSendDlgItemMsg(hwnd, CFGH_RUNMAILWORKDIR, EM_SETTEXTLIMIT, 821 821 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 822 822 WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), FALSE); 823 823 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 831 831 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 832 832 switch (CHARMSG(&msg)->vkey) { 833 834 835 836 837 838 839 840 841 842 843 844 845 846 833 case VK_F3: 834 case VK_ENTER: 835 case VK_NEWLINE: 836 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 837 return 0; 838 break; 839 case VK_ESC: 840 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 841 return 0; 842 break; 843 case VK_F1: 844 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 845 return 0; 846 break; 847 847 } 848 848 } … … 874 874 switch (SHORT2FROMMP(mp1)) { 875 875 case EN_KILLFOCUS: 876 877 876 WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), FALSE); 877 break; 878 878 case EN_SETFOCUS: 879 880 879 WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), TRUE); 880 break; 881 881 } 882 882 break; … … 899 899 case IDM_HELP: 900 900 if (hwndHelp) 901 902 901 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 902 MPFROM2SHORT(HELP_CFGH, 0), MPFROMSHORT(HM_RESOURCEID)); 903 903 break; 904 904 905 905 case CFGH_FIND: 906 906 { 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 907 CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9]; 908 USHORT id; 909 HWND hwndFocus; 910 911 strcpy(filename, "*.EXE"); 912 hwndFocus = WinQueryFocus(HWND_DESKTOP); 913 if (hwndFocus) { 914 id = WinQueryWindowUShort(hwndFocus, QWS_ID); 915 switch (id) { 916 case CFGH_HTTPRUN: 917 case CFGH_FTPRUN: 918 case CFGH_MAILRUN: 919 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 920 BldQuotedFileName(szfilename, filename); 921 WinSetDlgItemText(hwnd, id, szfilename); 922 } 923 break; 924 case CFGH_RUNFTPWORKDIR: 925 strcpy(filename, ftprundir); 926 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, 927 WalkExtractDlgProc, FM3ModHandle, WALK_FRAME, 928 MPFROMP(filename)) && *filename) 929 WinSetDlgItemText(hwnd, id, filename); 930 break; 931 case CFGH_RUNHTTPWORKDIR: 932 strcpy(filename, httprundir); 933 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, 934 WalkExtractDlgProc, FM3ModHandle, WALK_FRAME, 935 MPFROMP(filename)) && *filename) 936 WinSetDlgItemText(hwnd, id, filename); 937 break; 938 case CFGH_RUNMAILWORKDIR: 939 strcpy(filename, mailrundir); 940 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, 941 WalkExtractDlgProc, FM3ModHandle, WALK_FRAME, 942 MPFROMP(filename)) && *filename) 943 WinSetDlgItemText(hwnd, id, filename); 944 break; 945 default: 946 Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id); 947 break; 948 } 949 } 950 950 } 951 951 break; … … 960 960 961 961 szCLBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 962 963 962 if (!szCLBuf) 963 return 0; //already complained 964 964 pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 965 965 if (!pszWorkBuf) { 966 967 966 free(szCLBuf); 967 return 0; //already complained 968 968 } 969 969 WinQueryDlgItemText(hwnd, CFGH_RUNHTTPWORKDIR, CCHMAXPATH, szPathBuf); … … 982 982 szCLBuf[MaxComLineStrg - 1] = 0; 983 983 if (strcmp(szCLBuf, ftprun)){ 984 985 984 NormalizeCmdLine(pszWorkBuf, szCLBuf); 985 memcpy(ftprun, pszWorkBuf, strlen(pszWorkBuf) + 1); 986 986 } 987 987 WinQueryDlgItemText(hwnd, CFGH_HTTPRUN, MaxComLineStrg, szCLBuf); 988 988 szCLBuf[MaxComLineStrg - 1] = 0; 989 989 if (strcmp(szCLBuf, httprun)){ 990 991 990 NormalizeCmdLine(pszWorkBuf, szCLBuf); 991 memcpy(httprun, pszWorkBuf, strlen(pszWorkBuf) + 1); 992 992 } 993 993 WinQueryDlgItemText(hwnd, CFGH_MAILRUN, MaxComLineStrg, szCLBuf); 994 994 szCLBuf[MaxComLineStrg - 1] = 0; 995 995 if (strcmp(szCLBuf, mailrun)){ 996 997 996 NormalizeCmdLine(pszWorkBuf, szCLBuf); 997 memcpy(mailrun, pszWorkBuf, strlen(pszWorkBuf) + 1); 998 998 } 999 999 free(pszWorkBuf); … … 1007 1007 fHttpRunWPSDefault = WinQueryButtonCheckstate(hwnd, CFGH_HTTPRUNWPSDEFAULT); 1008 1008 PrfWriteProfileData(fmprof, appname, "HttpRunWPSDefault", &fHttpRunWPSDefault, 1009 1009 sizeof(BOOL)); 1010 1010 fFtpRunWPSDefault = WinQueryButtonCheckstate(hwnd, CFGH_FTPRUNWPSDEFAULT); 1011 1011 PrfWriteProfileData(fmprof, appname, "FtpRunWPSDefault", &fFtpRunWPSDefault, 1012 1012 sizeof(BOOL)); 1013 1013 fLibPathStrictHttpRun = WinQueryButtonCheckstate(hwnd, CFGH_LIBPATHSTRICTHTTPRUN); 1014 1014 PrfWriteProfileData(fmprof, appname, "LibPathStrictHttpRun", 1015 1015 &fLibPathStrictHttpRun, sizeof(BOOL)); 1016 1016 fLibPathStrictFtpRun = WinQueryButtonCheckstate(hwnd, CFGH_LIBPATHSTRICTFTPRUN); 1017 1017 PrfWriteProfileData(fmprof, appname, "LibPathStrictFtpRun", 1018 1018 &fLibPathStrictFtpRun, sizeof(BOOL)); 1019 1019 fLibPathStrictMailRun = WinQueryButtonCheckstate(hwnd, CFGH_LIBPATHSTRICTMAILRUN); 1020 1020 PrfWriteProfileData(fmprof, appname, "LibPathStrictMailRun", 1021 1021 &fLibPathStrictMailRun, sizeof(BOOL)); 1022 1022 fNoMailtoMailRun = WinQueryButtonCheckstate(hwnd, CFGH_NOMAILTOMAILRUN); 1023 1023 PrfWriteProfileData(fmprof, appname, "NoMailtoMailRun", 1024 1024 &fNoMailtoMailRun, sizeof(BOOL)); 1025 1025 break; 1026 1026 } … … 1029 1029 fCancelAction = FALSE; 1030 1030 WinDlgBox(HWND_DESKTOP, 1031 1032 1033 1034 1035 1031 hwnd, 1032 CfgDlgProc, 1033 FM3ModHandle, 1034 CFG_FRAME, 1035 MPFROMLONG(IDM_VIEWERSETTINGS)); 1036 1036 } 1037 1037 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 1058 1058 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 1059 1059 switch (CHARMSG(&msg)->vkey) { 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1060 case VK_F3: 1061 case VK_ENTER: 1062 case VK_NEWLINE: 1063 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 1064 return 0; 1065 break; 1066 case VK_ESC: 1067 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 1068 return 0; 1069 break; 1070 case VK_F1: 1071 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 1072 return 0; 1073 break; 1074 1074 } 1075 1075 } … … 1091 1091 case IDM_HELP: 1092 1092 if (hwndHelp) 1093 1094 1095 1093 WinSendMsg(hwndHelp, 1094 HM_DISPLAY_HELP, 1095 MPFROM2SHORT(HELP_CFGB, 0), MPFROMSHORT(HM_RESOURCEID)); 1096 1096 break; 1097 1097 } … … 1101 1101 fToolbarHelp = WinQueryButtonCheckstate(hwnd, CFGB_TOOLBARHELP); 1102 1102 PrfWriteProfileData(fmprof, 1103 1103 FM3Str, "ToolbarHelp", &fToolbarHelp, sizeof(BOOL)); 1104 1104 fDrivebarHelp = WinQueryButtonCheckstate(hwnd, CFGB_DRIVEBARHELP); 1105 1105 PrfWriteProfileData(fmprof, 1106 1106 FM3Str, "DrivebarHelp", &fDrivebarHelp, sizeof(BOOL)); 1107 1107 fOtherHelp = WinQueryButtonCheckstate(hwnd, CFGB_OTHERHELP); 1108 1108 PrfWriteProfileData(fmprof, 1109 1109 FM3Str, "OtherHelp", &fOtherHelp, sizeof(BOOL)); 1110 1110 break; 1111 1111 } … … 1120 1120 case WM_INITDLG: 1121 1121 WinSendDlgItemMsg(hwnd, 1122 1123 1122 CFG5_FILTER, 1123 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 1124 1124 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 1125 1125 break; … … 1132 1132 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 1133 1133 switch (CHARMSG(&msg)->vkey) { 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1134 case VK_F3: 1135 case VK_ENTER: 1136 case VK_NEWLINE: 1137 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 1138 return 0; 1139 break; 1140 case VK_ESC: 1141 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 1142 return 0; 1143 break; 1144 case VK_F1: 1145 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 1146 return 0; 1147 break; 1148 1148 } 1149 1149 } … … 1160 1160 1161 1161 if (!PrfQueryProfileData(fmprof, 1162 1163 1164 1165 1162 appname, 1163 "TreeflWindowAttr", 1164 (PVOID) & flWindowAttr, &ulSize)) 1165 flWindowAttr |= (CV_TREE | CA_TREELINE | CV_ICON | CV_MINI | CV_FLOW); 1166 1166 WinCheckButton(hwnd, CFG5_ICON, ((flWindowAttr & CV_ICON) != FALSE)); 1167 1167 WinCheckButton(hwnd, CFG5_MINIICONS, 1168 1168 ((flWindowAttr & CV_MINI) != FALSE)); 1169 1169 memset(&mask, 0, sizeof(mask)); 1170 1170 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 1171 1171 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 1172 1172 mask.fIsTree = TRUE; 1173 1173 ulSize = sizeof(MASK); 1174 1174 if (PrfQueryProfileData(fmprof, appname, "TreeFilter", &mask, &ulSize)) { 1175 1175 SetMask(NULL, &mask); 1176 1176 } 1177 1177 if (!mask.attrFile) 1178 1179 1180 1178 mask.attrFile = (FILE_READONLY | FILE_NORMAL | 1179 FILE_ARCHIVED | FILE_DIRECTORY | 1180 FILE_HIDDEN | FILE_SYSTEM); 1181 1181 strcpy(mask.prompt, GetPString(IDS_TREEFILTERTITLETEXT)); 1182 1182 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 1191 1191 WinCheckButton(hwnd, CFG6_SORTREVERSE, FALSE); 1192 1192 if (TreesortFlags & SORT_FIRSTEXTENSION) 1193 1193 WinCheckButton(hwnd, CFG6_SORTFIRST, TRUE); 1194 1194 else if (TreesortFlags & SORT_LASTEXTENSION) 1195 1195 WinCheckButton(hwnd, CFG6_SORTLAST, TRUE); 1196 1196 else if (TreesortFlags & SORT_SIZE) 1197 1197 WinCheckButton(hwnd, CFG6_SORTSIZE, TRUE); 1198 1198 else if (TreesortFlags & SORT_EASIZE) 1199 1199 WinCheckButton(hwnd, CFG6_SORTEASIZE, TRUE); 1200 1200 else if (TreesortFlags & SORT_LWDATE) 1201 1201 WinCheckButton(hwnd, CFG6_SORTLWDATE, TRUE); 1202 1202 else if (TreesortFlags & SORT_LADATE) 1203 1203 WinCheckButton(hwnd, CFG6_SORTLADATE, TRUE); 1204 1204 else if (TreesortFlags & SORT_CRDATE) 1205 1205 WinCheckButton(hwnd, CFG6_SORTCRDATE, TRUE); 1206 1206 else if (TreesortFlags & SORT_FILENAME) 1207 1207 WinCheckButton(hwnd, CFG6_SORTFILENAME, TRUE); 1208 1208 else 1209 1209 WinCheckButton(hwnd, CFG6_SORTNAME, TRUE); 1210 1210 if (TreesortFlags & SORT_REVERSE) 1211 1211 WinCheckButton(hwnd, CFG6_SORTREVERSE, TRUE); 1212 1212 } 1213 1213 return 0; … … 1215 1215 case UM_SETUP5: 1216 1216 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc, 1217 1217 FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) { 1218 1218 SetMask(NULL, &mask); 1219 1219 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 1226 1226 switch (SHORT2FROMMP(mp1)) { 1227 1227 case EN_SETFOCUS: 1228 1229 1230 1228 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 1229 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); 1230 break; 1231 1231 } 1232 1232 break; … … 1249 1249 case IDM_HELP: 1250 1250 if (hwndHelp) 1251 1252 1253 1251 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1252 MPFROM2SHORT(HELP_TREEVIEW, 0), 1253 MPFROMSHORT(HM_RESOURCEID)); 1254 1254 break; 1255 1255 } … … 1261 1261 1262 1262 if (WinQueryButtonCheckstate(hwnd, CFG5_ICON)) 1263 1263 flWindowAttr |= CV_ICON; 1264 1264 else 1265 1265 flWindowAttr |= CV_TEXT; 1266 1266 if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS)) 1267 1267 flWindowAttr |= CV_MINI; 1268 1268 flWindowAttr |= (CV_TREE | CV_FLOW | CA_TREELINE); 1269 1269 PrfWriteProfileData(fmprof, 1270 1271 1270 appname, 1271 "TreeflWindowAttr", &flWindowAttr, sizeof(ULONG)); 1272 1272 if (hwndTree) { 1273 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1274 CNRINFO cnri; 1275 1276 memset(&cnri, 0, sizeof(cnri)); 1277 cnri.cb = sizeof(cnri); 1278 WinSendMsg(WinWindowFromID 1279 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 1280 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 1281 cnri.flWindowAttr = flWindowAttr; 1282 WinSendMsg(WinWindowFromID 1283 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 1284 CM_SETCNRINFO, MPFROMP(&cnri), 1285 MPFROMLONG(CMA_FLWINDOWATTR)); 1286 1286 } 1287 1287 } … … 1310 1310 TreesortFlags |= SORT_REVERSE; 1311 1311 PrfWriteProfileData(fmprof, appname, "TreeSort", &TreesortFlags, 1312 1312 sizeof(INT)); 1313 1313 if (hwndTree) 1314 1314 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESORT, 0), MPVOID); … … 1320 1320 1321 1321 dcd = WinQueryWindowPtr(WinWindowFromID(WinWindowFromID(hwndTree, 1322 1323 1322 FID_CLIENT), 1323 TREE_CNR), QWL_USER); 1324 1324 if (dcd && dcd->size == sizeof(DIRCNRDATA)) { 1325 1326 1325 dcd->mask = mask; 1326 PostMsg(hwndTree, UM_FILTER, MPVOID, MPVOID); 1327 1327 } 1328 1328 } … … 1340 1340 case WM_INITDLG: 1341 1341 WinSendDlgItemMsg(hwnd, CFGT_ENVVARLIST, EM_SETTEXTLIMIT, 1342 1342 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 1343 1343 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 1344 1344 break; … … 1364 1364 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 1365 1365 switch (CHARMSG(&msg)->vkey) { 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1366 case VK_F3: 1367 case VK_ENTER: 1368 case VK_NEWLINE: 1369 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 1370 return 0; 1371 break; 1372 case VK_ESC: 1373 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 1374 return 0; 1375 break; 1376 case VK_F1: 1377 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 1378 return 0; 1379 break; 1380 1380 } 1381 1381 } … … 1397 1397 case IDM_HELP: 1398 1398 if (hwndHelp) 1399 1400 1399 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1400 MPFROM2SHORT(HELP_CFGT, 0), MPFROMSHORT(HM_RESOURCEID)); 1401 1401 break; 1402 1402 } … … 1406 1406 fVTreeOpensWPS = WinQueryButtonCheckstate(hwnd, CFGT_VTREEOPENSWPS); 1407 1407 PrfWriteProfileData(fmprof, FM3Str, "VTreeOpensWPS", &fVTreeOpensWPS, 1408 1408 sizeof(BOOL)); 1409 1409 fCollapseFirst = WinQueryButtonCheckstate(hwnd, CFGT_COLLAPSEFIRST); 1410 1410 PrfWriteProfileData(fmprof, appname, "CollapseFirst", &fCollapseFirst, 1411 1411 sizeof(BOOL)); 1412 1412 fSwitchTreeOnFocus = WinQueryButtonCheckstate(hwnd, 1413 1413 CFGT_SWITCHTREEONFOCUS); 1414 1414 PrfWriteProfileData(fmprof, appname, "SwitchTreeOnFocus", 1415 1415 &fSwitchTreeOnFocus, sizeof(BOOL)); 1416 1416 fSwitchTreeExpand = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREEEXPAND); 1417 1417 PrfWriteProfileData(fmprof, appname, "SwitchTreeExpand", 1418 1418 &fSwitchTreeExpand, sizeof(BOOL)); 1419 1419 fSwitchTree = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREE); 1420 1420 PrfWriteProfileData(fmprof, appname, "SwitchTree", &fSwitchTree, 1421 1421 sizeof(BOOL)); 1422 1422 fFollowTree = WinQueryButtonCheckstate(hwnd, CFGT_FOLLOWTREE); 1423 1423 PrfWriteProfileData(fmprof, appname, "FollowTree", &fFollowTree, 1424 1424 sizeof(BOOL)); 1425 1425 fTopDir = WinQueryButtonCheckstate(hwnd, CFGT_TOPDIR); 1426 1426 PrfWriteProfileData(fmprof, appname, "TopDir", (PVOID) & fTopDir, 1427 1427 sizeof(BOOL)); 1428 1428 fDCOpens = WinQueryButtonCheckstate(hwnd, CFGT_DCOPENS); 1429 1429 PrfWriteProfileData(fmprof, FM3Str, "DoubleClickOpens", &fDCOpens, 1430 1430 sizeof(BOOL)); 1431 1431 fShowEnvChanged = (fShowEnv != WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV)); 1432 1432 fShowEnv = WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV); … … 1435 1435 char * pszTemp = xmalloc(WinQueryDlgItemTextLength(hwnd, CFGT_ENVVARLIST) + 1, pszSrcFile, __LINE__); 1436 1436 if (pszTemp) { 1437 1438 1439 1440 1441 1442 1443 1444 1437 WinQueryDlgItemText(hwnd, CFGT_ENVVARLIST, MaxComLineStrg, pszTemp); 1438 strupr(pszTemp); 1439 if (strcmp(pszTemp, pszTreeEnvVarList)) { 1440 fTreeEnvVarListChanged = TRUE; 1441 strcpy(pszTreeEnvVarList, pszTemp); 1442 PrfWriteProfileString(fmprof, appname, "TreeEnvVarList", pszTreeEnvVarList); 1443 } 1444 free(pszTemp); 1445 1445 } 1446 1446 if (hwndTree && (fShowEnvChanged || (fShowEnv && fTreeEnvVarListChanged))) 1447 1447 { 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1448 PCNRITEM pci = WinSendMsg(WinWindowFromID 1449 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), CM_QUERYRECORDEMPHASIS, 1450 MPFROMLONG(CMA_FIRST), 1451 MPFROMSHORT(CRA_SELECTED)); 1452 PostMsg(WinWindowFromID 1453 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), WM_COMMAND, 1454 MPFROM2SHORT(IDM_RESCAN, 0), MPVOID); 1455 pszTemp = xstrdup(pci->pszFileName, pszSrcFile, __LINE__); 1456 if (pszTemp) { 1457 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTemp), MPVOID)) 1458 free(pszTemp); 1459 /* pszTemp is freed in the UM_SHOWME code */ 1460 } 1461 1461 } 1462 1462 } … … 1471 1471 case WM_INITDLG: 1472 1472 WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_SETTEXTLIMIT, 1473 1473 MPFROMSHORT(8), MPVOID); 1474 1474 WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_OVERRIDESETLIMITS, 1475 1475 MPFROMLONG(CMDLNLNGTH_MAX), MPFROMLONG(CMDLNLNGTH_MIN)); 1476 1476 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 1477 1477 break; … … 1484 1484 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 1485 1485 switch (CHARMSG(&msg)->vkey) { 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1486 case VK_F3: 1487 case VK_ENTER: 1488 case VK_NEWLINE: 1489 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 1490 return 0; 1491 break; 1492 case VK_ESC: 1493 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 1494 return 0; 1495 break; 1496 case VK_F1: 1497 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 1498 return 0; 1499 break; 1500 1500 } 1501 1501 } … … 1522 1522 WinCheckButton(hwnd, CFGG_TRASHCAN, fTrashCan); 1523 1523 WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_SETCURRENTVALUE, 1524 1524 MPFROMLONG(MaxComLineStrg), MPVOID); 1525 1525 return 0; 1526 1526 … … 1539 1539 switch (SHORT2FROMMP(mp1)) { 1540 1540 case EN_SETFOCUS: 1541 1542 1543 1541 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 1542 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); 1543 break; 1544 1544 } 1545 1545 break; … … 1562 1562 case IDM_HELP: 1563 1563 if (hwndHelp) 1564 1565 1566 1564 WinSendMsg(hwndHelp, 1565 HM_DISPLAY_HELP, 1566 MPFROM2SHORT(HELP_CFGG, 0), MPFROMSHORT(HM_RESOURCEID)); 1567 1567 break; 1568 1568 } … … 1578 1578 PrfWriteProfileData(fmprof, FM3Str, "NoDead", &fNoDead, sizeof(BOOL)); 1579 1579 PrfWriteProfileData(fmprof, 1580 1580 FM3Str, "NoFinger", &fNoFinger, sizeof(BOOL)); 1581 1581 WinDestroyPointer(hptrFinger); 1582 1582 if (!fNoDead) 1583 1583 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER_ICON); 1584 1584 else 1585 1585 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER2_ICON); 1586 1586 } 1587 1587 fLinkSetsIcon = WinQueryButtonCheckstate(hwnd, CFGG_LINKSETSICON); 1588 1588 PrfWriteProfileData(fmprof, 1589 1590 1589 appname, 1590 "LinkSetsIcon", &fLinkSetsIcon, sizeof(BOOL)); 1591 1591 fCustomFileDlg = WinQueryButtonCheckstate(hwnd, CFGG_CUSTOMFILEDLG); 1592 1592 PrfWriteProfileData(fmprof, 1593 1594 1593 FM3Str, 1594 "CustomFileDlg", &fCustomFileDlg, sizeof(BOOL)); 1595 1595 fDullMin = WinQueryButtonCheckstate(hwnd, CFGG_BORING); 1596 1596 PrfWriteProfileData(fmprof, 1597 1597 FM3Str, "DullDatabar", &fDullMin, sizeof(BOOL)); 1598 1598 fConfirmDelete = WinQueryButtonCheckstate(hwnd, CFGG_CONFIRMDELETE); 1599 1599 PrfWriteProfileData(fmprof, 1600 1601 1600 appname, 1601 "ConfirmDelete", &fConfirmDelete, sizeof(BOOL)); 1602 1602 fDontMoveMouse = WinQueryButtonCheckstate(hwnd, CFGG_DONTMOVEMOUSE); 1603 1603 PrfWriteProfileData(fmprof, 1604 1605 1604 appname, 1605 "DontMoveMouse", &fDontMoveMouse, sizeof(BOOL)); 1606 1606 fCopyDefault = WinQueryButtonCheckstate(hwnd, CFGG_DEFAULTCOPY); 1607 1607 PrfWriteProfileData(fmprof, appname, "DefaultCopy", 1608 1608 &fCopyDefault, sizeof(BOOL)); 1609 1609 fRealIdle = WinQueryButtonCheckstate(hwnd, CFGG_IDLECOPY); 1610 1610 PrfWriteProfileData(fmprof, appname, "IdleCopy", 1611 1611 &fRealIdle, sizeof(BOOL)); 1612 1612 fDragndropDlg = WinQueryButtonCheckstate(hwnd, CFGG_DNDDLG); 1613 1613 PrfWriteProfileData(fmprof, appname, "Drag&DropDlg", 1614 1614 &fDragndropDlg, sizeof(BOOL)); 1615 1615 fVerify = WinQueryButtonCheckstate(hwnd, CFGG_VERIFYWRITES); 1616 1616 PrfWriteProfileData(fmprof, appname, "VerifyWrites", 1617 1617 &fVerify, sizeof(BOOL)); 1618 1618 DosSetVerify(fVerify); 1619 1619 fDefaultDeletePerm = WinQueryButtonCheckstate(hwnd, 1620 1620 CFGG_DEFAULTDELETEPERM); 1621 1621 PrfWriteProfileData(fmprof, appname, "DefaultDeletePerm", 1622 1622 &fDefaultDeletePerm, sizeof(BOOL)); 1623 1623 fFM2Deletes = WinQueryButtonCheckstate(hwnd, CFGG_FM2DELETES); 1624 1624 PrfWriteProfileData(fmprof, FM3Str, "FM2Deletes", 1625 1625 &fFM2Deletes, sizeof(BOOL)); 1626 1626 fTrashCan = WinQueryButtonCheckstate(hwnd, CFGG_TRASHCAN); 1627 1627 PrfWriteProfileData(fmprof, FM3Str, "TrashCan", 1628 1628 &fTrashCan, sizeof(BOOL)); 1629 1629 fConfirmTarget = WinQueryButtonCheckstate(hwnd, CFGG_CONFIRMTARGET); 1630 1630 PrfWriteProfileData(fmprof, appname, "ConfirmTarget", 1631 1631 &fConfirmTarget, sizeof(BOOL)); 1632 1632 { 1633 1633 WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_QUERYVALUE, 1634 1634 MPFROMP(&MaxComLineStrg), MPFROM2SHORT(0, SPBQ_DONOTUPDATE)); 1635 1635 if (MaxComLineStrg < CMDLNLNGTH_MIN) 1636 1636 MaxComLineStrg = CMDLNLNGTH_MIN; 1637 1637 else if (MaxComLineStrg > CMDLNLNGTH_MAX) 1638 1638 MaxComLineStrg = CMDLNLNGTH_MAX; 1639 1639 PrfWriteProfileData(fmprof, 1640 1640 appname, "MaxComLineStrg", &MaxComLineStrg, sizeof(ULONG)); 1641 1641 } 1642 1642 break; … … 1650 1650 case WM_INITDLG: 1651 1651 WinSendDlgItemMsg(hwnd, CFGC_COMPARE, EM_SETTEXTLIMIT, 1652 1652 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 1653 1653 WinSendDlgItemMsg(hwnd, CFGC_DIRCOMPARE, EM_SETTEXTLIMIT, 1654 1654 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 1655 1655 WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), FALSE); 1656 1656 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 1664 1664 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 1665 1665 switch (CHARMSG(&msg)->vkey) { 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1666 case VK_F3: 1667 case VK_ENTER: 1668 case VK_NEWLINE: 1669 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 1670 return 0; 1671 break; 1672 case VK_ESC: 1673 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 1674 return 0; 1675 break; 1676 case VK_F1: 1677 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 1678 return 0; 1679 break; 1680 1680 } 1681 1681 } … … 1693 1693 switch (SHORT2FROMMP(mp1)) { 1694 1694 case EN_KILLFOCUS: 1695 1696 1695 WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), FALSE); 1696 break; 1697 1697 case EN_SETFOCUS: 1698 1699 1698 WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), TRUE); 1699 break; 1700 1700 } 1701 1701 break; … … 1718 1718 case IDM_HELP: 1719 1719 if (hwndHelp) 1720 1721 1720 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1721 MPFROM2SHORT(HELP_CFGC, 0), MPFROMSHORT(HM_RESOURCEID)); 1722 1722 break; 1723 1723 1724 1724 case CFGC_FIND: 1725 1725 { 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1726 CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9]; 1727 USHORT id; 1728 HWND hwndFocus; 1729 1730 strcpy(filename, "*.EXE"); 1731 hwndFocus = WinQueryFocus(HWND_DESKTOP); 1732 if (hwndFocus) { 1733 id = WinQueryWindowUShort(hwndFocus, QWS_ID); 1734 switch (id) { 1735 case CFGC_COMPARE: 1736 case CFGC_DIRCOMPARE: 1737 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 1738 BldQuotedFileName(szfilename, filename); 1739 strcat(szfilename, " %a"); 1740 WinSetDlgItemText(hwnd, id, szfilename); 1741 } 1742 break; 1743 default: 1744 Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id); 1745 break; 1746 } 1747 } 1748 1748 } 1749 1749 break; … … 1757 1757 1758 1758 szCLBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 1759 1760 1759 if (!szCLBuf) 1760 return 0; //already complained 1761 1761 pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 1762 1762 if (!pszWorkBuf) { 1763 1764 1763 free(szCLBuf); 1764 return 0; //already complained 1765 1765 } 1766 1766 WinQueryDlgItemText(hwnd, CFGC_DIRCOMPARE, MaxComLineStrg, szCLBuf); 1767 1768 1769 1770 1771 1772 1773 1767 szCLBuf[MaxComLineStrg - 1] = 0; 1768 if (strcmp(szCLBuf, dircompare)){ 1769 NormalizeCmdLine(pszWorkBuf, szCLBuf); 1770 memcpy(dircompare, pszWorkBuf, strlen(pszWorkBuf) + 1); 1771 if (!strchr(dircompare, '%') && strlen(dircompare) > 3) 1772 strcat(dircompare, " %a"); 1773 } 1774 1774 PrfWriteProfileString(fmprof, appname, "DirCompare", dircompare); 1775 1775 WinQueryDlgItemText(hwnd, CFGC_COMPARE, MaxComLineStrg, szCLBuf); 1776 1776 szCLBuf[MaxComLineStrg - 1] = 0; 1777 1777 if (strcmp(szCLBuf, compare)){ 1778 1779 1780 1781 1778 NormalizeCmdLine(pszWorkBuf, szCLBuf); 1779 memcpy(compare, pszWorkBuf, strlen(pszWorkBuf) + 1); 1780 if (!strchr(compare, '%') && strlen(compare) > 3) 1781 strcat(compare, " %a"); 1782 1782 } 1783 1783 free(pszWorkBuf); … … 1790 1790 fCancelAction = FALSE; 1791 1791 WinDlgBox(HWND_DESKTOP, 1792 1793 1794 1795 1796 1792 hwnd, 1793 CfgDlgProc, 1794 FM3ModHandle, 1795 CFG_FRAME, 1796 MPFROMLONG(IDM_COMPARESETTINGS)); 1797 1797 } 1798 1798 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 1815 1815 WinCheckButton(hwnd, CFGD_NOSEARCH, fNoSearch); 1816 1816 WinCheckButton(hwnd, CFGD_EXTENDEDSEL, 1817 1817 ((ulCnrType & CCS_EXTENDSEL) != 0)); 1818 1818 WinCheckButton(hwnd, CFGD_MULTIPLESEL, 1819 1819 ((ulCnrType & CCS_MULTIPLESEL) != 0)); 1820 1820 WinCheckButton(hwnd, CFGD_LEAVETREE, fLeaveTree); 1821 1821 WinCheckButton(hwnd, CFGD_NOFOLDMENU, fNoFoldMenu); … … 1829 1829 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 1830 1830 switch (CHARMSG(&msg)->vkey) { 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1831 case VK_F3: 1832 case VK_ENTER: 1833 case VK_NEWLINE: 1834 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 1835 return 0; 1836 break; 1837 case VK_ESC: 1838 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 1839 return 0; 1840 break; 1841 case VK_F1: 1842 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 1843 return 0; 1844 break; 1845 1845 } 1846 1846 } … … 1862 1862 case IDM_HELP: 1863 1863 if (hwndHelp) 1864 1865 1864 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1865 MPFROM2SHORT(HELP_CFGD, 0), MPFROMSHORT(HM_RESOURCEID)); 1866 1866 break; 1867 1867 } … … 1875 1875 ulCnrType |= CCS_MULTIPLESEL; 1876 1876 PrfWriteProfileData(fmprof, appname, "ContainerType", 1877 1877 (PVOID) & ulCnrType, sizeof(BOOL)); 1878 1878 fMinOnOpen = WinQueryButtonCheckstate(hwnd, CFGD_MINONOPEN); 1879 1879 PrfWriteProfileData(fmprof, FM3Str, "MinDirOnOpen", &fMinOnOpen, 1880 1880 sizeof(BOOL)); 1881 1881 fLeaveTree = WinQueryButtonCheckstate(hwnd, CFGD_LEAVETREE); 1882 1882 PrfWriteProfileData(fmprof, appname, "LeaveTree", &fLeaveTree, 1883 1883 sizeof(BOOL)); 1884 1884 fNoFoldMenu = WinQueryButtonCheckstate(hwnd, CFGD_NOFOLDMENU); 1885 1885 PrfWriteProfileData(fmprof, appname, "NoFoldMenu", &fNoFoldMenu, 1886 1886 sizeof(BOOL)); 1887 1887 fSelectedAlways = WinQueryButtonCheckstate(hwnd, CFGD_SELECTEDALWAYS); 1888 1888 PrfWriteProfileData(fmprof, appname, "SelectedAlways", &fSelectedAlways, 1889 1889 sizeof(BOOL)); 1890 1890 fNoSearch = WinQueryButtonCheckstate(hwnd, CFGD_NOSEARCH); 1891 1891 PrfWriteProfileData(fmprof, appname, "NoSearch", &fNoSearch, 1892 1892 sizeof(BOOL)); 1893 1893 fLookInDir = WinQueryButtonCheckstate(hwnd, CFGD_LOOKINDIR); 1894 1894 PrfWriteProfileData(fmprof, FM3Str, "LookInDir", (PVOID) & fLookInDir, 1895 1895 sizeof(BOOL)); 1896 1896 fUnHilite = WinQueryButtonCheckstate(hwnd, CFGD_UNHILITE); 1897 1897 PrfWriteProfileData(fmprof, appname, "UnHilite", 1898 1898 &fUnHilite, sizeof(BOOL)); 1899 1899 { 1900 1900 BOOL fOldSyncUpdates = WinQueryButtonCheckstate(hwnd, CFGD_SYNCUPDATES); 1901 1901 1902 1902 if (fOldSyncUpdates != fSyncUpdates) { 1903 1904 1905 1906 1907 1903 fSyncUpdates = fOldSyncUpdates; 1904 if (hwndMain && !strcmp(realappname, FM3Str)) { 1905 // Save state and restore to refresh windows with new settings 1906 if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) { 1907 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2)); 1908 1908 // PostMsg(hwndMain, UM_RESTORE, MPVOID, MPVOID); 1909 PostMsg(MainObjectHwnd, UM_RESTORE,GetPString(IDS_FM2TEMPTEXT), MPVOID);1910 1911 1909 PostMsg(MainObjectHwnd, UM_RESTORE, (PSZ)GetPString(IDS_FM2TEMPTEXT), MPVOID); 1910 } 1911 } 1912 1912 } 1913 1913 } 1914 1914 PrfWriteProfileData(fmprof, appname, "SyncUpdates", 1915 1915 &fSyncUpdates, sizeof(BOOL)); 1916 1916 if (!(ulCnrType & (CCS_EXTENDSEL | CCS_MULTIPLESEL))) 1917 1917 saymsg(MB_ENTER | MB_ICONEXCLAMATION, 1918 1919 1920 1918 HWND_DESKTOP, 1919 GetPString(IDS_WARNINGTEXT), 1920 GetPString(IDS_SELECTTYPEERRORTEXT)); 1921 1921 break; // WM_CLOSE 1922 1922 } … … 1938 1938 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 1939 1939 switch (CHARMSG(&msg)->vkey) { 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1940 case VK_F3: 1941 case VK_ENTER: 1942 case VK_NEWLINE: 1943 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 1944 return 0; 1945 break; 1946 case VK_ESC: 1947 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 1948 return 0; 1949 break; 1950 case VK_F1: 1951 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 1952 return 0; 1953 break; 1954 1954 } 1955 1955 } … … 1998 1998 switch (SHORT1FROMMP(mp1)) { 1999 1999 case CFGM_RECENTDIRS: 2000 2001 2002 2003 2004 2005 2006 2000 sprintf(s, 2001 GetPString(IDS_RECENTHELPWHICHTEXT), 2002 (!oh && th) ? 2003 GetPString(IDS_RECENTONLYTEXT) : 2004 (oh && th) ? 2005 GetPString(IDS_ALLONLYTEXT) : GetPString(IDS_NONE)); 2006 break; 2007 2007 } 2008 2008 if (*s) 2009 2009 WinSetDlgItemText(hwnd, SHORT1FROMMP(mp1), s); 2010 2010 } 2011 2011 return 0; … … 2018 2018 case CFGM_STARTMIN: 2019 2019 if (WinQueryButtonCheckstate(hwnd, CFGM_STARTMIN)) { 2020 2021 2020 WinCheckButton(hwnd, CFGM_STARTMAX, FALSE); 2021 WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMAX), FALSE); 2022 2022 } 2023 2023 else 2024 2024 WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMAX), TRUE); 2025 2025 break; 2026 2026 case CFGM_STARTMAX: 2027 2027 if (WinQueryButtonCheckstate(hwnd, CFGM_STARTMAX)) { 2028 2029 2028 WinCheckButton(hwnd, CFGM_STARTMIN, FALSE); 2029 WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMIN), FALSE); 2030 2030 } 2031 2031 else 2032 2032 WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMIN), TRUE); 2033 2033 break; 2034 2034 } … … 2050 2050 case IDM_HELP: 2051 2051 if (hwndHelp) 2052 2053 2052 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2053 MPFROM2SHORT(HELP_CFGM, 0), MPFROMSHORT(HM_RESOURCEID)); 2054 2054 break; 2055 2055 } … … 2059 2059 if (hwndMain && !strcmp(realappname, FM3Str)) { 2060 2060 if (fFreeTree != WinQueryButtonCheckstate(hwnd, CFGM_FREETREE)) 2061 2061 PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_FREETREE, 0), MPVOID); 2062 2062 if (fAutoTile != WinQueryButtonCheckstate(hwnd, CFGM_AUTOTILE)) 2063 2063 PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_AUTOTILE, 0), MPVOID); 2064 2064 if (fSplitStatus != WinQueryButtonCheckstate(hwnd, CFGM_SPLITSTATUS)) { 2065 2066 2067 2068 2065 fSplitStatus = (fSplitStatus) ? FALSE : TRUE; 2066 PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_BLINK, 0), MPVOID); 2067 PrfWriteProfileData(fmprof, FM3Str, "SplitStatus", &fSplitStatus, 2068 sizeof(BOOL)); 2069 2069 } 2070 2070 } 2071 2071 fUserListSwitches = WinQueryButtonCheckstate(hwnd, CFGM_USERLISTSWITCHES); 2072 2072 PrfWriteProfileData(fmprof, FM3Str, "UserListSwitches", 2073 2073 (PVOID) & fUserListSwitches, sizeof(BOOL)); 2074 2074 fExternalINIs = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALINIS); 2075 2075 PrfWriteProfileData(fmprof, FM3Str, "ExternalINIs", 2076 2076 (PVOID) & fExternalINIs, sizeof(BOOL)); 2077 2077 fExternalArcboxes = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALARCBOXES); 2078 2078 PrfWriteProfileData(fmprof, FM3Str, "ExternalArcboxes", 2079 2079 (PVOID) & fExternalArcboxes, sizeof(BOOL)); 2080 2080 fExternalCollector = 2081 2081 WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALCOLLECTOR); 2082 2082 PrfWriteProfileData(fmprof, FM3Str, "ExternalCollector", 2083 2083 (PVOID) & fExternalCollector, sizeof(BOOL)); 2084 2084 fExternalViewer = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALVIEWER); 2085 2085 PrfWriteProfileData(fmprof, FM3Str, "ExternalViewer", 2086 2086 (PVOID) & fExternalViewer, sizeof(BOOL)); 2087 2087 { 2088 2088 long test; … … 2093 2093 } 2094 2094 PrfWriteProfileData(fmprof, 2095 2096 2095 appname, 2096 "AutoAddDirs", (PVOID) & fAutoAddDirs, sizeof(BOOL)); 2097 2097 PrfWriteProfileData(fmprof, 2098 2099 2100 2098 appname, 2099 "AutoAddAllDirs", 2100 (PVOID) & fAutoAddAllDirs, sizeof(BOOL)); 2101 2101 fwsAnimate = WinQueryButtonCheckstate(hwnd, CFGM_WSANIMATE); 2102 2102 if (fwsAnimate) 2103 2103 fwsAnimate = WS_ANIMATE; 2104 2104 PrfWriteProfileData(fmprof, 2105 2106 2105 appname, 2106 "WS_ANIMATE", (PVOID) & fwsAnimate, sizeof(ULONG)); 2107 2107 fSaveState = WinQueryButtonCheckstate(hwnd, CFGM_SAVESTATE); 2108 2108 PrfWriteProfileData(fmprof, 2109 2110 2109 FM3Str, 2110 "SaveState", (PVOID) & fSaveState, sizeof(BOOL)); 2111 2111 fStartMinimized = WinQueryButtonCheckstate(hwnd, CFGM_STARTMIN); 2112 2112 PrfWriteProfileData(fmprof, 2113 2114 2115 2113 appname, 2114 "StartMinimized", 2115 (PVOID) & fStartMinimized, sizeof(BOOL)); 2116 2116 fStartMaximized = WinQueryButtonCheckstate(hwnd, CFGM_STARTMAX); 2117 2117 PrfWriteProfileData(fmprof, 2118 2119 2120 2118 appname, 2119 "StartMaximized", 2120 (PVOID) & fStartMaximized, sizeof(BOOL)); 2121 2121 fDataMin = WinQueryButtonCheckstate(hwnd, CFGM_DATAMIN); 2122 2122 PrfWriteProfileData(fmprof, 2123 2123 FM3Str, "DataMin", (PVOID) & fDataMin, sizeof(BOOL)); 2124 2124 fTileBackwards = WinQueryButtonCheckstate(hwnd, CFGM_TILEBACKWARDS); 2125 2125 PrfWriteProfileData(fmprof, 2126 2127 2128 2126 FM3Str, 2127 "TileBackwards", 2128 (PVOID) & fTileBackwards, sizeof(BOOL)); 2129 2129 fNoTreeGap = WinQueryButtonCheckstate(hwnd, CFGM_NOTREEGAP); 2130 2130 PrfWriteProfileData(fmprof, 2131 2132 2131 FM3Str, 2132 "NoTreeGap", (PVOID) & fNoTreeGap, sizeof(BOOL)); 2133 2133 fBlueLED = WinQueryButtonCheckstate(hwnd, CFGM_BLUELED); 2134 2134 PrfWriteProfileData(fmprof, 2135 2135 appname, "BlueLED", (PVOID) & fBlueLED, sizeof(BOOL)); 2136 2136 { 2137 2137 BOOL dummy; … … 2139 2139 dummy = WinQueryButtonCheckstate(hwnd, CFGM_SHOWTARGET); 2140 2140 if (dummy != fShowTarget) { 2141 2142 2143 2144 2145 2146 2147 2148 2149 2141 fShowTarget = dummy; 2142 PrfWriteProfileData(fmprof, 2143 appname, 2144 "ShowTarget", 2145 (PVOID) & fShowTarget, sizeof(BOOL)); 2146 if (hwndMain) 2147 PostMsg(WinQueryWindow(hwndMain, QW_PARENT), 2148 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 2149 SetTargetDir(hwnd, TRUE); 2150 2150 } 2151 2151 dummy = WinQueryButtonCheckstate(hwnd, CFGM_SEPARATEPARMS); 2152 2152 if (dummy != fSeparateParms) { 2153 2154 2155 2156 2157 2158 2159 2153 fSeparateParms = dummy; 2154 PrfWriteProfileData(fmprof, 2155 FM3Str, 2156 "SeparateParms", 2157 (PVOID) & fSeparateParms, sizeof(BOOL)); 2158 WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), 2159 UM_UNDO, MPVOID, MPVOID); 2160 2160 } 2161 2161 } … … 2172 2172 case WM_INITDLG: 2173 2173 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETTEXTLIMIT, 2174 2174 MPFROMSHORT(8), MPVOID); 2175 2175 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_OVERRIDESETLIMITS, 2176 2176 MPFROMLONG(1000), MPFROMLONG(50)); 2177 2177 WinSendDlgItemMsg(hwnd, 2178 2179 2178 CFG5_FILTER, 2179 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 2180 2180 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 2181 2181 break; … … 2188 2188 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 2189 2189 switch (CHARMSG(&msg)->vkey) { 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2190 case VK_F3: 2191 case VK_ENTER: 2192 case VK_NEWLINE: 2193 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 2194 return 0; 2195 break; 2196 case VK_ESC: 2197 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 2198 return 0; 2199 break; 2200 case VK_F1: 2201 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 2202 return 0; 2203 break; 2204 2204 } 2205 2205 } … … 2216 2216 2217 2217 if (!PrfQueryProfileData(fmprof, 2218 2219 2220 2218 appname, 2219 "DirflWindowAttr", &flWindowAttr, &ulSize)) 2220 flWindowAttr = (CV_NAME | CV_MINI | CA_DETAILSVIEWTITLES | CV_FLOW); 2221 2221 if (flWindowAttr & CV_ICON) 2222 2222 WinCheckButton(hwnd, CFG5_ICON, TRUE); 2223 2223 if (flWindowAttr & CV_NAME) 2224 2224 WinCheckButton(hwnd, CFG5_NAME, TRUE); 2225 2225 if (flWindowAttr & CV_TEXT) 2226 2226 WinCheckButton(hwnd, CFG5_TEXT, TRUE); 2227 2227 if (flWindowAttr & CV_DETAIL) 2228 2228 WinCheckButton(hwnd, CFG5_DETAIL, TRUE); 2229 2229 if (flWindowAttr & CV_MINI) 2230 2230 WinCheckButton(hwnd, CFG5_MINIICONS, TRUE); 2231 2231 if (flWindowAttr & CA_DETAILSVIEWTITLES) 2232 2232 WinCheckButton(hwnd, CFG5_SHOWTITLES, TRUE); 2233 2233 WinCheckButton(hwnd, CFG5_SHOWLNAMES, dsDirCnrDefault.detailslongname); 2234 2234 WinCheckButton(hwnd, CFG5_SHOWSUBJECT, dsDirCnrDefault.detailssubject); … … 2245 2245 memset(&mask, 0, sizeof(mask)); 2246 2246 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 2247 2247 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 2248 2248 ulSize = sizeof(MASK); 2249 2249 if (PrfQueryProfileData(fmprof, appname, "DirFilter", &mask, &ulSize)) 2250 2250 SetMask(NULL, &mask); 2251 2251 if (!mask.attrFile) 2252 2253 2252 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 2253 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 2254 2254 strcpy(mask.prompt, GetPString(IDS_DEFDIRFILTERTITLETEXT)); 2255 2255 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 2257 2257 WinCheckButton(hwnd, CFG5_SUBJECTLENGTHMAX, dsDirCnrDefault.fSubjectLengthMax); 2258 2258 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETCURRENTVALUE, 2259 2259 MPFROMLONG(dsDirCnrDefault.SubjectDisplayWidth), MPVOID); 2260 2260 } 2261 2261 return 0; … … 2263 2263 case UM_SETUP5: 2264 2264 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc, 2265 2265 FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) { 2266 2266 SetMask(NULL, &mask); 2267 2267 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 2274 2274 switch (SHORT2FROMMP(mp1)) { 2275 2275 case EN_SETFOCUS: 2276 2277 2278 2276 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 2277 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); 2278 break; 2279 2279 } 2280 2280 break; … … 2297 2297 case IDM_HELP: 2298 2298 if (hwndHelp) 2299 2300 2299 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2300 MPFROM2SHORT(HELP_CFG5, 0), MPFROMSHORT(HM_RESOURCEID)); 2301 2301 break; 2302 2302 } … … 2308 2308 2309 2309 if (WinQueryButtonCheckstate(hwnd, CFG5_ICON)) 2310 2310 flWindowAttr |= CV_ICON; 2311 2311 if (WinQueryButtonCheckstate(hwnd, CFG5_NAME)) 2312 2312 flWindowAttr |= CV_NAME; 2313 2313 if (WinQueryButtonCheckstate(hwnd, CFG5_TEXT)) 2314 2314 flWindowAttr |= CV_TEXT; 2315 2315 if (WinQueryButtonCheckstate(hwnd, CFG5_DETAIL)) 2316 2316 flWindowAttr |= CV_DETAIL; 2317 2317 if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS)) 2318 2318 flWindowAttr |= CV_MINI; 2319 2319 if (WinQueryButtonCheckstate(hwnd, CFG5_SHOWTITLES)) 2320 2320 flWindowAttr |= CA_DETAILSVIEWTITLES; 2321 2321 flWindowAttr |= CV_FLOW; 2322 2322 PrfWriteProfileData(fmprof, 2323 2324 2323 appname, 2324 "DirflWindowAttr", &flWindowAttr, sizeof(ULONG)); 2325 2325 } 2326 2326 dsDirCnrDefault.detailslongname = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLNAMES); 2327 2327 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname", 2328 2328 &dsDirCnrDefault.detailslongname, sizeof(BOOL)); 2329 2329 dsDirCnrDefault.detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT); 2330 2330 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject", 2331 2331 &dsDirCnrDefault.detailssubject, sizeof(BOOL)); 2332 2332 dsDirCnrDefault.detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT); 2333 2333 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA", 2334 2334 &dsDirCnrDefault.detailsea, sizeof(BOOL)); 2335 2335 dsDirCnrDefault.detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE); 2336 2336 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize", 2337 2337 &dsDirCnrDefault.detailssize, sizeof(BOOL)); 2338 2338 dsDirCnrDefault.detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON); 2339 2339 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon", 2340 2340 &dsDirCnrDefault.detailsicon, sizeof(BOOL)); 2341 2341 dsDirCnrDefault.detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE); 2342 2342 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate", 2343 2343 &dsDirCnrDefault.detailslwdate, sizeof(BOOL)); 2344 2344 dsDirCnrDefault.detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME); 2345 2345 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime", 2346 2346 &dsDirCnrDefault.detailslwtime, sizeof(BOOL)); 2347 2347 dsDirCnrDefault.detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE); 2348 2348 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate", 2349 2349 &dsDirCnrDefault.detailsladate, sizeof(BOOL)); 2350 2350 dsDirCnrDefault.detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME); 2351 2351 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime", 2352 2352 &dsDirCnrDefault.detailslatime, sizeof(BOOL)); 2353 2353 dsDirCnrDefault.detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE); 2354 2354 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate", 2355 2355 &dsDirCnrDefault.detailscrdate, sizeof(BOOL)); 2356 2356 dsDirCnrDefault.detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME); 2357 2357 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime", 2358 2358 &dsDirCnrDefault.detailscrtime, sizeof(BOOL)); 2359 2359 dsDirCnrDefault.detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR); 2360 2360 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr", 2361 2361 &dsDirCnrDefault.detailsattr, sizeof(BOOL)); 2362 2362 dsDirCnrDefault.fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE); 2363 2363 PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectInLeftPane", 2364 2364 &dsDirCnrDefault.fSubjectInLeftPane, sizeof(BOOL)); 2365 2365 dsDirCnrDefault.fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX); 2366 2366 PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectLengthMax", 2367 2367 &dsDirCnrDefault.fSubjectLengthMax, sizeof(BOOL)); 2368 2368 *mask.prompt = 0; 2369 2369 PrfWriteProfileData(fmprof, appname, "DirFilter", &mask, sizeof(MASK)); 2370 2370 { 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2371 if (!WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX)) { 2372 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_QUERYVALUE, 2373 MPFROMP(&dsDirCnrDefault.SubjectDisplayWidth), MPFROM2SHORT(0, SPBQ_DONOTUPDATE)); 2374 if (dsDirCnrDefault.SubjectDisplayWidth < 50) 2375 dsDirCnrDefault.SubjectDisplayWidth = 0; 2376 else if (dsDirCnrDefault.SubjectDisplayWidth > 1000) 2377 dsDirCnrDefault.SubjectDisplayWidth = 1000; 2378 } 2379 else 2380 dsDirCnrDefault.SubjectDisplayWidth = 0; 2381 PrfWriteProfileData(fmprof, 2382 appname, "DirCnr.SubjectDisplayWidth", 2383 &dsDirCnrDefault.SubjectDisplayWidth, sizeof(ULONG)); 2384 2384 } 2385 2385 break; … … 2402 2402 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 2403 2403 switch (CHARMSG(&msg)->vkey) { 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2404 case VK_F3: 2405 case VK_ENTER: 2406 case VK_NEWLINE: 2407 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 2408 return 0; 2409 break; 2410 case VK_ESC: 2411 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 2412 return 0; 2413 break; 2414 case VK_F1: 2415 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 2416 return 0; 2417 break; 2418 2418 } 2419 2419 } … … 2463 2463 case CFG6_SORTDIRSLAST: 2464 2464 { 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2465 BOOL temp; 2466 2467 temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1)); 2468 if (temp) { 2469 switch (SHORT1FROMMP(mp1)) { 2470 case CFG6_SORTDIRSFIRST: 2471 WinCheckButton(hwnd, CFG6_SORTDIRSLAST, FALSE); 2472 break; 2473 case CFG6_SORTDIRSLAST: 2474 WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, FALSE); 2475 break; 2476 } 2477 } 2478 2478 } 2479 2479 break; … … 2496 2496 case IDM_HELP: 2497 2497 if (hwndHelp) 2498 2499 2498 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2499 MPFROM2SHORT(HELP_CFG6, 0), MPFROMSHORT(HM_RESOURCEID)); 2500 2500 break; 2501 2501 } … … 2539 2539 case WM_INITDLG: 2540 2540 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETTEXTLIMIT, 2541 2541 MPFROMSHORT(8), MPVOID); 2542 2542 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_OVERRIDESETLIMITS, 2543 2543 MPFROMLONG(1000), MPFROMLONG(50)); 2544 2544 WinSendDlgItemMsg(hwnd, CFG5_FILTER, EM_SETTEXTLIMIT, 2545 2545 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 2546 2546 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 2547 2547 break; … … 2554 2554 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 2555 2555 switch (CHARMSG(&msg)->vkey) { 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2556 case VK_F3: 2557 case VK_ENTER: 2558 case VK_NEWLINE: 2559 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 2560 return 0; 2561 break; 2562 case VK_ESC: 2563 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 2564 return 0; 2565 break; 2566 case VK_F1: 2567 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 2568 return 0; 2569 break; 2570 2570 } 2571 2571 } … … 2583 2583 2584 2584 if (!PrfQueryProfileData(fmprof, 2585 2586 2587 2585 appname, 2586 "CollectorflWindowAttr", &flWindowAttr, &ulSize)) 2587 flWindowAttr = (CV_NAME | CA_DETAILSVIEWTITLES | CV_MINI | CV_FLOW); 2588 2588 if (flWindowAttr & CV_ICON) 2589 2589 WinCheckButton(hwnd, CFG5_ICON, TRUE); 2590 2590 if (flWindowAttr & CV_NAME) 2591 2591 WinCheckButton(hwnd, CFG5_NAME, TRUE); 2592 2592 if (flWindowAttr & CV_TEXT) 2593 2593 WinCheckButton(hwnd, CFG5_TEXT, TRUE); 2594 2594 if (flWindowAttr & CV_DETAIL) 2595 2595 WinCheckButton(hwnd, CFG5_DETAIL, TRUE); 2596 2596 if (flWindowAttr & CV_MINI) 2597 2597 WinCheckButton(hwnd, CFG5_MINIICONS, TRUE); 2598 2598 if (flWindowAttr & CA_DETAILSVIEWTITLES) 2599 2599 WinCheckButton(hwnd, CFG5_SHOWTITLES, TRUE); 2600 2600 memset(&mask, 0, sizeof(mask)); 2601 2601 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 2602 2602 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 2603 2603 ulSize = sizeof(MASK); 2604 2604 if (PrfQueryProfileData(fmprof, 2605 2606 2605 appname, "CollectorFilter", &mask, &ulSize)) { 2606 SetMask(NULL, &mask); 2607 2607 } 2608 2608 if (!mask.attrFile) 2609 2610 2609 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 2610 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 2611 2611 strcpy(mask.prompt, GetPString(IDS_DEFCOLFILTERTITLETEXT)); 2612 2612 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 2632 2632 WinCheckButton(hwnd, CFG5_SUBJECTLENGTHMAX, ds.fSubjectLengthMax); 2633 2633 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETCURRENTVALUE, 2634 2634 MPFROMLONG(ds.SubjectDisplayWidth), MPVOID); 2635 2635 2636 2636 } … … 2639 2639 case UM_SETUP5: 2640 2640 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc, 2641 2641 FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) { 2642 2642 SetMask(NULL, &mask); 2643 2643 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 2650 2650 switch (SHORT2FROMMP(mp1)) { 2651 2651 case EN_SETFOCUS: 2652 2653 2654 2652 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 2653 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); 2654 break; 2655 2655 } 2656 2656 break; … … 2673 2673 case IDM_HELP: 2674 2674 if (hwndHelp) 2675 2676 2675 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2676 MPFROM2SHORT(HELP_CFG7, 0), MPFROMSHORT(HM_RESOURCEID)); 2677 2677 break; 2678 2678 } … … 2681 2681 case WM_CLOSE: 2682 2682 fExternalCollector = WinQueryButtonCheckstate(hwnd, 2683 2683 CFG5_EXTERNALCOLLECTOR); 2684 2684 PrfWriteProfileData(fmprof, FM3Str, "ExternalCollector", 2685 2685 &fExternalCollector, sizeof(BOOL)); 2686 2686 { 2687 2687 ULONG flWindowAttr = 0; 2688 2688 2689 2689 if (WinQueryButtonCheckstate(hwnd, CFG5_ICON)) 2690 2690 flWindowAttr |= CV_ICON; 2691 2691 if (WinQueryButtonCheckstate(hwnd, CFG5_NAME)) 2692 2692 flWindowAttr |= CV_NAME; 2693 2693 if (WinQueryButtonCheckstate(hwnd, CFG5_TEXT)) 2694 2694 flWindowAttr |= CV_TEXT; 2695 2695 if (WinQueryButtonCheckstate(hwnd, CFG5_DETAIL)) 2696 2696 flWindowAttr |= CV_DETAIL; 2697 2697 if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS)) 2698 2698 flWindowAttr |= CV_MINI; 2699 2699 if (WinQueryButtonCheckstate(hwnd, CFG5_SHOWTITLES)) 2700 2700 flWindowAttr |= CA_DETAILSVIEWTITLES; 2701 2701 flWindowAttr |= CV_FLOW; 2702 2702 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 2703 2703 &flWindowAttr, sizeof(ULONG)); 2704 2704 } 2705 2705 { … … 2709 2709 ds.detailslongname = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLNAMES); 2710 2710 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLongname", 2711 2711 &ds.detailslongname, sizeof(BOOL)); 2712 2712 ds.detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT); 2713 2713 PrfWriteProfileData(fmprof, appname, "Collector.DetailsSubject", 2714 2714 &ds.detailssubject, sizeof(BOOL)); 2715 2715 ds.detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWEAS); 2716 2716 PrfWriteProfileData(fmprof, appname, "Collector.DetailsEA", 2717 2717 &ds.detailsea, sizeof(BOOL)); 2718 2718 ds.detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE); 2719 2719 PrfWriteProfileData(fmprof, appname, "Collector.DetailsSize", 2720 2720 &ds.detailssize, sizeof(BOOL)); 2721 2721 ds.detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON); 2722 2722 PrfWriteProfileData(fmprof, appname, "Collector.DetailsIcon", 2723 2723 &ds.detailsicon, sizeof(BOOL)); 2724 2724 ds.detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE); 2725 2725 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLWDate", 2726 2726 &ds.detailslwdate, sizeof(BOOL)); 2727 2727 ds.detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME); 2728 2728 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLWTime", 2729 2729 &ds.detailslwtime, sizeof(BOOL)); 2730 2730 ds.detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE); 2731 2731 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLADate", 2732 2732 &ds.detailsladate, sizeof(BOOL)); 2733 2733 ds.detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME); 2734 2734 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLATime", 2735 2735 &ds.detailslatime, sizeof(BOOL)); 2736 2736 ds.detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE); 2737 2737 PrfWriteProfileData(fmprof, appname, "Collector.DetailsCRDate", 2738 2738 &ds.detailscrdate, sizeof(BOOL)); 2739 2739 ds.detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME); 2740 2740 PrfWriteProfileData(fmprof, appname, "Collector.DetailsCRTime", 2741 2741 &ds.detailscrtime, sizeof(BOOL)); 2742 2742 ds.detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR); 2743 2743 PrfWriteProfileData(fmprof, appname, "Collector.DetailsAttr", 2744 2744 &ds.detailsattr, sizeof(BOOL)); 2745 2745 ds.fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE); 2746 2746 PrfWriteProfileData(fmprof, appname, "Collector.SubjectInLeftPane", 2747 2747 &ds.fSubjectInLeftPane, sizeof(BOOL)); 2748 2748 ds.fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX); 2749 2749 PrfWriteProfileData(fmprof, appname, "Collector.SubjectLengthMax", 2750 2750 &ds.fSubjectLengthMax, sizeof(BOOL)); 2751 2751 *mask.prompt = 0; 2752 2752 PrfWriteProfileData(fmprof, 2753 2753 appname, "CollectorFilter", &mask, sizeof(MASK)); 2754 2754 { 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2755 if (!WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX)) { 2756 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_QUERYVALUE, 2757 MPFROMP(&ds.SubjectDisplayWidth), MPFROM2SHORT(0, SPBQ_DONOTUPDATE)); 2758 if (ds.SubjectDisplayWidth < 50) 2759 ds.SubjectDisplayWidth = 0; 2760 else if (ds.SubjectDisplayWidth > 1000) 2761 ds.SubjectDisplayWidth = 1000; 2762 } 2763 else 2764 ds.SubjectDisplayWidth = 0; 2765 PrfWriteProfileData(fmprof, 2766 appname, "Collector.SubjectDisplayWidth", 2767 &ds.SubjectDisplayWidth, sizeof(ULONG)); 2768 2768 } 2769 2769 } … … 2787 2787 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 2788 2788 switch (CHARMSG(&msg)->vkey) { 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2789 case VK_F3: 2790 case VK_ENTER: 2791 case VK_NEWLINE: 2792 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 2793 return 0; 2794 break; 2795 case VK_ESC: 2796 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 2797 return 0; 2798 break; 2799 case VK_F1: 2800 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 2801 return 0; 2802 break; 2803 2803 } 2804 2804 } … … 2848 2848 case CFG6_SORTDIRSLAST: 2849 2849 { 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2850 BOOL temp; 2851 2852 temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1)); 2853 if (temp) { 2854 switch (SHORT1FROMMP(mp1)) { 2855 case CFG6_SORTDIRSFIRST: 2856 WinCheckButton(hwnd, CFG6_SORTDIRSLAST, FALSE); 2857 break; 2858 case CFG6_SORTDIRSLAST: 2859 WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, FALSE); 2860 break; 2861 } 2862 } 2863 2863 } 2864 2864 break; … … 2881 2881 case IDM_HELP: 2882 2882 if (hwndHelp) 2883 2884 2883 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2884 MPFROM2SHORT(HELP_CFG8, 0), MPFROMSHORT(HM_RESOURCEID)); 2885 2885 break; 2886 2886 } … … 2912 2912 CollectorsortFlags |= SORT_REVERSE; 2913 2913 PrfWriteProfileData(fmprof, 2914 2915 2914 appname, 2915 "CollectorSort", &CollectorsortFlags, sizeof(INT)); 2916 2916 break; 2917 2917 } … … 2932 2932 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 2933 2933 switch (CHARMSG(&msg)->vkey) { 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2934 case VK_F3: 2935 case VK_ENTER: 2936 case VK_NEWLINE: 2937 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 2938 return 0; 2939 break; 2940 case VK_ESC: 2941 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 2942 return 0; 2943 break; 2944 case VK_F1: 2945 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 2946 return 0; 2947 break; 2948 2948 } 2949 2949 } … … 2954 2954 case IDM_HELP: 2955 2955 if (hwndHelp) 2956 2957 2956 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2957 MPFROM2SHORT(HELP_CFG9, 0), MPFROMSHORT(HM_RESOURCEID)); 2958 2958 return 0; 2959 2959 case CFG9_MAXIMUMUI: 2960 2960 if (hwndMain) { 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2961 if (MenuInvisible) 2962 WinSendMsg(hwndMain, WM_COMMAND, 2963 MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 2964 if (!fAutoView) 2965 WinSendMsg(hwndMain, WM_COMMAND, 2966 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 2967 if (!fDrivebar) 2968 WinSendMsg(hwndMain, WM_COMMAND, 2969 MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID); 2970 if (!fToolbar) 2971 WinSendMsg(hwndMain, WM_COMMAND, 2972 MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 2973 if (!fMoreButtons) 2974 WinSendMsg(hwndMain, WM_COMMAND, 2975 MPFROM2SHORT(IDM_MOREBUTTONS, 0), MPVOID); 2976 if (!fUserComboBox) 2977 WinSendMsg(hwndMain, WM_COMMAND, 2978 MPFROM2SHORT(IDM_USERLIST, 0), MPVOID); 2979 2979 } 2980 2980 return 0; 2981 2981 case CFG9_MINIMUMUI: 2982 2982 if (hwndMain) { 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 2983 if (!MenuInvisible) 2984 WinSendMsg(hwndMain, WM_COMMAND, 2985 MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 2986 if (fAutoView) 2987 WinSendMsg(hwndMain, WM_COMMAND, 2988 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 2989 if (fToolbar) 2990 WinSendMsg(hwndMain, WM_COMMAND, 2991 MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 2992 if (fMoreButtons) 2993 WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_MOREBUTTONS, 0), 2994 MPVOID); 2995 if (fUserComboBox) 2996 WinSendMsg(hwndMain, WM_COMMAND, 2997 MPFROM2SHORT(IDM_USERLIST, 0), MPVOID); 2998 saymsg(MB_ENTER | MB_ICONASTERISK, 2999 hwnd, 3000 GetPString(IDS_DONTFORGETTEXT), 3001 GetPString(IDS_UNHIDEMENUWARNTEXT)); 3002 3002 } 3003 3003 return 0; … … 3013 3013 fDragndropDlg = TRUE; 3014 3014 { 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3015 ULONG flWindowAttr; 3016 3017 flWindowAttr = CV_DETAIL | CV_FLOW | CA_DETAILSVIEWTITLES; 3018 PrfWriteProfileData(fmprof, 3019 appname, 3020 "DirflWindowAttr", &flWindowAttr, sizeof(ULONG)); 3021 PrfWriteProfileData(fmprof, 3022 appname, 3023 "CollectorflWindowAttr", 3024 &flWindowAttr, sizeof(ULONG)); 3025 PrfWriteProfileData(fmprof, 3026 appname, "Collector.Fontnamesize", NULL, 0); 3027 3027 } 3028 3028 dsDirCnrDefault.detailslongname = TRUE; … … 3040 3040 if (hwndTree) { 3041 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3042 CNRINFO cnri; 3043 ULONG flWindowAttr = CV_TREE | CV_ICON | CV_FLOW | CA_TREELINE; 3044 3045 memset(&cnri, 0, sizeof(cnri)); 3046 cnri.cb = sizeof(cnri); 3047 WinSendMsg(WinWindowFromID 3048 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3049 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3050 cnri.flWindowAttr = flWindowAttr; 3051 WinSendMsg(WinWindowFromID 3052 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3053 CM_SETCNRINFO, MPFROMP(&cnri), 3054 MPFROMLONG(CMA_FLWINDOWATTR)); 3055 3055 } 3056 3056 break; … … 3067 3067 fDragndropDlg = TRUE; 3068 3068 { 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3069 ULONG flWindowAttr; 3070 3071 flWindowAttr = CV_DETAIL | CV_FLOW | CV_MINI; 3072 PrfWriteProfileData(fmprof, 3073 appname, 3074 "DirflWindowAttr", &flWindowAttr, sizeof(ULONG)); 3075 PrfWriteProfileData(fmprof, 3076 appname, 3077 "CollectorflWindowAttr", 3078 &flWindowAttr, sizeof(ULONG)); 3079 //fixme to allow user to change presparams 1-10-09 GKY 3080 PrfWriteProfileData(fmprof, 3081 appname, 3082 "Collector.Fontnamesize", 3083 FNT_8HELVETICA, 3084 strlen(FNT_8HELVETICA) + 1); 3085 3085 } 3086 3086 dsDirCnrDefault.detailslongname = TRUE; … … 3098 3098 if (hwndTree) { 3099 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3100 CNRINFO cnri; 3101 ULONG flWindowAttr = CV_TREE | CV_MINI | CV_TEXT | 3102 CV_FLOW | CA_TREELINE; 3103 3104 memset(&cnri, 0, sizeof(cnri)); 3105 cnri.cb = sizeof(cnri); 3106 WinSendMsg(WinWindowFromID 3107 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3108 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3109 cnri.flWindowAttr = flWindowAttr; 3110 WinSendMsg(WinWindowFromID 3111 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3112 CM_SETCNRINFO, MPFROMP(&cnri), 3113 MPFROMLONG(CMA_FLWINDOWATTR)); 3114 3114 } 3115 3115 break; 3116 3116 case CFG9_MAXFILENAMES: 3117 3117 if (hwndMain && fAutoView) 3118 3119 3118 WinSendMsg(hwndMain, WM_COMMAND, 3119 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 3120 3120 fForceUpper = FALSE; 3121 3121 fForceLower = TRUE; … … 3129 3129 fNoIconsDirs = TRUE; 3130 3130 { 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3131 ULONG flWindowAttr; 3132 3133 flWindowAttr = CV_TEXT | CV_FLOW; 3134 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3135 &flWindowAttr, sizeof(ULONG)); 3136 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3137 &flWindowAttr, sizeof(ULONG)); 3138 //fixme to allow user to change presparams 1-10-09 GKY 3139 PrfWriteProfileData(fmprof, appname, "Collector.Fontnamesize", 3140 FNT_8HELVETICA, 3141 strlen(FNT_8HELVETICA) + 1); 3142 3142 } 3143 3143 if (hwndTree) { 3144 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3145 CNRINFO cnri; 3146 ULONG flWindowAttr = CV_TREE | CV_TEXT | CV_FLOW | CA_TREELINE; 3147 3148 memset(&cnri, 0, sizeof(cnri)); 3149 cnri.cb = sizeof(cnri); 3150 WinSendMsg(WinWindowFromID 3151 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3152 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3153 cnri.flWindowAttr = flWindowAttr; 3154 WinSendMsg(WinWindowFromID 3155 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3156 CM_SETCNRINFO, MPFROMP(&cnri), 3157 MPFROMLONG(CMA_FLWINDOWATTR)); 3158 3158 } 3159 3159 break; … … 3225 3225 fNoTreeGap = TRUE; 3226 3226 { 3227 3228 3229 3230 3231 3232 3233 3227 ULONG flWindowAttr; 3228 3229 flWindowAttr = (CV_NAME | CV_MINI | CV_FLOW | CA_DETAILSVIEWTITLES); 3230 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3231 &flWindowAttr, sizeof(ULONG)); 3232 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3233 &flWindowAttr, sizeof(ULONG)); 3234 3234 } 3235 3235 dsDirCnrDefault.detailslongname = FALSE; … … 3249 3249 if (hwndMain) { 3250 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3251 SWP swp; 3252 3253 if (WinQueryWindowPos(hwndMain, &swp)) { 3254 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 3255 swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE); 3256 } 3257 if (MenuInvisible) 3258 WinSendMsg(hwndMain, WM_COMMAND, 3259 MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 3260 if (fAutoView) 3261 WinSendMsg(hwndMain, WM_COMMAND, 3262 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 3263 if (fToolbar) 3264 WinSendMsg(hwndMain, WM_COMMAND, 3265 MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 3266 if (!fDrivebar) 3267 WinSendMsg(hwndMain, WM_COMMAND, 3268 MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID); 3269 if (!fMoreButtons) 3270 WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_MOREBUTTONS, 0), 3271 MPVOID); 3272 if (!fUserComboBox) 3273 WinSendMsg(hwndMain, WM_COMMAND, 3274 MPFROM2SHORT(IDM_USERLIST, 0), MPVOID); 3275 3275 } 3276 3276 if (hwndTree) { 3277 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3278 CNRINFO cnri; 3279 ULONG flWindowAttr = (CV_TREE | CV_TEXT | CV_MINI | 3280 CV_FLOW | CA_TREELINE); 3281 3282 memset(&cnri, 0, sizeof(cnri)); 3283 cnri.cb = sizeof(cnri); 3284 WinSendMsg(WinWindowFromID 3285 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3286 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3287 cnri.flWindowAttr = flWindowAttr; 3288 WinSendMsg(WinWindowFromID 3289 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3290 CM_SETCNRINFO, MPFROMP(&cnri), 3291 MPFROMLONG(CMA_FLWINDOWATTR)); 3292 3292 } 3293 3293 break; … … 3342 3342 fNoTreeGap = FALSE; 3343 3343 { 3344 3345 3346 3347 3348 3349 3350 3344 ULONG flWindowAttr; 3345 3346 flWindowAttr = (CV_NAME | CV_MINI | CV_FLOW | CA_DETAILSVIEWTITLES); 3347 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3348 &flWindowAttr, sizeof(ULONG)); 3349 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3350 &flWindowAttr, sizeof(ULONG)); 3351 3351 } 3352 3352 dsDirCnrDefault.detailslongname = FALSE; … … 3366 3366 if (hwndMain) { 3367 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3368 SWP swp; 3369 3370 if (WinQueryWindowPos(hwndMain, &swp)) { 3371 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 3372 swp.cx / 5, 3373 swp.cy - 3374 (WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2), 3375 SWP_MOVE | SWP_SIZE); 3376 } 3377 3377 } 3378 3378 if (hwndTree) { 3379 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3380 CNRINFO cnri; 3381 ULONG flWindowAttr = (CV_TREE | CV_TEXT | 3382 CV_FLOW | CA_TREELINE | CV_MINI); 3383 3384 memset(&cnri, 0, sizeof(cnri)); 3385 cnri.cb = sizeof(cnri); 3386 WinSendMsg(WinWindowFromID 3387 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3388 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3389 cnri.flWindowAttr = flWindowAttr; 3390 WinSendMsg(WinWindowFromID 3391 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3392 CM_SETCNRINFO, MPFROMP(&cnri), 3393 MPFROMLONG(CMA_FLWINDOWATTR)); 3394 3394 } 3395 3395 break; … … 3406 3406 fDCOpens = FALSE; 3407 3407 { 3408 3409 3410 3411 3412 3413 3414 3408 ULONG flWindowAttr; 3409 3410 flWindowAttr = CV_NAME | CV_FLOW | CA_DETAILSVIEWTITLES; 3411 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3412 &flWindowAttr, sizeof(ULONG)); 3413 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3414 &flWindowAttr, sizeof(ULONG)); 3415 3415 } 3416 3416 fLinkSetsIcon = FALSE; … … 3423 3423 fUserListSwitches = TRUE; 3424 3424 WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), UM_UNDO, MPVOID, 3425 3425 MPVOID); 3426 3426 if (hwndTree) { 3427 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3428 CNRINFO cnri; 3429 ULONG flWindowAttr = CV_TREE | CV_MINI | CV_ICON | 3430 CV_FLOW | CA_TREELINE; 3431 3432 memset(&cnri, 0, sizeof(cnri)); 3433 cnri.cb = sizeof(cnri); 3434 WinSendMsg(WinWindowFromID 3435 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3436 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3437 cnri.flWindowAttr = flWindowAttr; 3438 WinSendMsg(WinWindowFromID 3439 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3440 CM_SETCNRINFO, MPFROMP(&cnri), 3441 MPFROMLONG(CMA_FLWINDOWATTR)); 3442 3442 } 3443 3443 if (hwndMain) { 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3444 if (fAutoView) 3445 WinSendMsg(hwndMain, WM_COMMAND, 3446 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 3447 if (!fDrivebar) 3448 WinSendMsg(hwndMain, WM_COMMAND, 3449 MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID); 3450 { 3451 SWP swp; 3452 3453 if (WinQueryWindowPos(hwndMain, &swp)) { 3454 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 3455 swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE); 3456 } 3457 } 3458 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2L)); 3459 PostMsg(MainObjectHwnd, UM_SETDIR, MPFROMLONG(1L), MPVOID); 3460 3460 } 3461 3461 return 0; … … 3471 3471 fTopDir = FALSE; 3472 3472 if (hwndMain) { 3473 3474 3475 3473 if (!fTextTools) 3474 WinSendMsg(hwndMain, WM_COMMAND, 3475 MPFROM2SHORT(IDM_TEXTTOOLS, 0), MPVOID); 3476 3476 } 3477 3477 { 3478 3479 3480 3481 3482 3483 3484 3478 ULONG flWindowAttr; 3479 3480 flWindowAttr = CV_TEXT | CV_FLOW | CA_DETAILSVIEWTITLES; 3481 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3482 &flWindowAttr, sizeof(ULONG)); 3483 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3484 &flWindowAttr, sizeof(ULONG)); 3485 3485 } 3486 3486 if (hwndTree) { 3487 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3488 CNRINFO cnri; 3489 ULONG flWindowAttr = CV_TREE | CV_TEXT | CV_FLOW | CA_TREELINE; 3490 3491 memset(&cnri, 0, sizeof(cnri)); 3492 cnri.cb = sizeof(cnri); 3493 WinSendMsg(WinWindowFromID 3494 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3495 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3496 cnri.flWindowAttr = flWindowAttr; 3497 WinSendMsg(WinWindowFromID 3498 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3499 CM_SETCNRINFO, MPFROMP(&cnri), 3500 MPFROMLONG(CMA_FLWINDOWATTR)); 3501 3501 } 3502 3502 /* intentional fallthru */ 3503 3503 case CFG9_1X: 3504 3504 if (SHORT1FROMMP(mp1) == CFG9_1X) { 3505 3506 3507 3508 3509 3510 3511 3512 3505 fTileBackwards = FALSE; 3506 ulCnrType = CCS_MULTIPLESEL | CCS_EXTENDSEL; 3507 fSwitchTree = FALSE; 3508 fSwitchTreeOnFocus = FALSE; 3509 fSwitchTreeExpand = FALSE; 3510 fCollapseFirst = FALSE; 3511 fFollowTree = FALSE; 3512 fNoSearch = TRUE; 3513 3513 } 3514 3514 fAutoTile = TRUE; … … 3524 3524 fUserListSwitches = TRUE; 3525 3525 WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), UM_UNDO, MPVOID, 3526 3526 MPVOID); 3527 3527 if (hwndTree) { 3528 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3529 CNRINFO cnri; 3530 ULONG flWindowAttr = CV_TREE | CV_ICON | CV_FLOW | CA_TREELINE; 3531 3532 memset(&cnri, 0, sizeof(cnri)); 3533 cnri.cb = sizeof(cnri); 3534 WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, FID_CLIENT), 3535 TREE_CNR), 3536 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3537 cnri.flWindowAttr = flWindowAttr; 3538 WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, FID_CLIENT), 3539 TREE_CNR), 3540 CM_SETCNRINFO, 3541 MPFROMP(&cnri), MPFROMLONG(CMA_FLWINDOWATTR)); 3542 3542 } 3543 3543 if (hwndMain) { 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3544 if (fAutoView) 3545 WinSendMsg(hwndMain, WM_COMMAND, 3546 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 3547 if (fUserComboBox) 3548 WinSendMsg(hwndMain, WM_COMMAND, 3549 MPFROM2SHORT(IDM_USERLIST, 0), MPVOID); 3550 { 3551 SWP swp; 3552 3553 if (WinQueryWindowPos(hwndMain, &swp)) { 3554 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 3555 swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE); 3556 } 3557 } 3558 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2L)); 3559 PostMsg(MainObjectHwnd, UM_SETDIR, MPVOID, MPVOID); 3560 3560 } 3561 3561 return 0; … … 3573 3573 // Save new details settings and refresh windows 3574 3574 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname", 3575 3575 &dsDirCnrDefault.detailslongname, sizeof(BOOL)); 3576 3576 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject", 3577 3577 &dsDirCnrDefault.detailssubject, sizeof(BOOL)); 3578 3578 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA", 3579 3579 &dsDirCnrDefault.detailsea, sizeof(BOOL)); 3580 3580 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize", 3581 3581 &dsDirCnrDefault.detailssize, sizeof(BOOL)); 3582 3582 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon", 3583 3583 &dsDirCnrDefault.detailsicon, sizeof(BOOL)); 3584 3584 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate", 3585 3585 &dsDirCnrDefault.detailslwdate, sizeof(BOOL)); 3586 3586 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime", 3587 3587 &dsDirCnrDefault.detailslwtime, sizeof(BOOL)); 3588 3588 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate", 3589 3589 &dsDirCnrDefault.detailsladate, sizeof(BOOL)); 3590 3590 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime", 3591 3591 &dsDirCnrDefault.detailslatime, sizeof(BOOL)); 3592 3592 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate", 3593 3593 &dsDirCnrDefault.detailscrdate, sizeof(BOOL)); 3594 3594 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime", 3595 3595 &dsDirCnrDefault.detailscrtime, sizeof(BOOL)); 3596 3596 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr", 3597 3597 &dsDirCnrDefault.detailsattr, sizeof(BOOL)); 3598 3598 if (hwndMain) { 3599 3599 // Save state and restore to refresh windows with new settings 3600 3600 if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) { 3601 3602 3603 3604 PostMsg(MainObjectHwnd, UM_RESTORE,GetPString(IDS_FM2TEMPTEXT), MPVOID);3601 // Tell window procedure to close container windows 3602 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2)); 3603 // Restore saved state 3604 PostMsg(MainObjectHwnd, UM_RESTORE, (PSZ)GetPString(IDS_FM2TEMPTEXT), MPVOID); 3605 3605 } 3606 3606 } 3607 3607 WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), 3608 3608 UM_UNDO, MPVOID, MPVOID); 3609 3609 return 0; 3610 3610 … … 3664 3664 haccelCfg = WinLoadAccelTable(hab, FM3ModHandle, CFG_FRAME); 3665 3665 if (haccelCfg == NULLHANDLE) 3666 3666 Win_Error(hwndNotebook, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 3667 3667 } 3668 3668 if (haccelCfg != NULLHANDLE) { 3669 3669 if (!WinSetAccelTable(hab, haccelCfg, hwndNotebook)) 3670 3670 Win_Error(hwndNotebook, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 3671 3671 // else 3672 3672 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_DRIVELIST %x %x", hwndFrame, haccelDriveList); 3673 3673 } 3674 3674 … … 3679 3679 hwndTemp = WinQueryWindow(hwnd, QW_OWNER); 3680 3680 if (hwndTemp != HWND_DESKTOP) { 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3681 HWND hwndMenu; 3682 // Owner is frame if not applet 3683 hwndMenu = WinWindowFromID(hwndTemp, FID_MENU); 3684 if (hwndMenu == NULLHANDLE) 3685 Runtime_Error(pszSrcFile, __LINE__, "FID_MENU"); 3686 else { 3687 MENUITEM mi; 3688 BOOL ok; 3689 memset(&mi, 0, sizeof(mi)); 3690 ok = (BOOL)WinSendMsg(hwndMenu, 3691 MM_QUERYITEM, 3692 MPFROM2SHORT(IDM_NOTEBOOKSUBMENU, TRUE), 3693 MPFROMP(&mi)); 3694 if (!ok) 3695 Runtime_Error(pszSrcFile, __LINE__, "IDM_NOTEBOOKSUBMENU"); 3696 else { 3697 mp2 = WinSendMsg(mi.hwndSubMenu, MM_QUERYDEFAULTITEMID, MPVOID, MPVOID); 3698 //if (!mp2) // causes spurious error message on new installs GKY 1-9-09 3699 // mp2 = MPFROMLONG(IDM_QUICKSETTINGS); 3700 //Runtime_Error(pszSrcFile, __LINE__, "MM_QUERYDEFAULTITEMID"); 3701 } 3702 } 3703 3703 } 3704 3704 } … … 3706 3706 PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID); 3707 3707 WinSendDlgItemMsg(hwnd, 3708 3709 3710 3708 CFG_NOTEBOOK, 3709 BKM_SETDIMENSIONS, 3710 MPFROM2SHORT(82, 24), MPFROMLONG(BKA_MAJORTAB)); 3711 3711 WinSendDlgItemMsg(hwnd, 3712 3713 3714 3712 CFG_NOTEBOOK, 3713 BKM_SETDIMENSIONS, 3714 MPFROM2SHORT(20, 20), MPFROMLONG(BKA_PAGEBUTTON)); 3715 3715 WinSendDlgItemMsg(hwnd, 3716 3717 3718 3716 CFG_NOTEBOOK, 3717 BKM_SETDIMENSIONS, 3718 MPFROM2SHORT(0, 0), MPFROMLONG(BKA_MINORTAB)); 3719 3719 3720 3720 // Build and insert notebook pages 3721 3721 for (x = 0; np[x].usFrameId; x++) { 3722 3722 hwndTemp = WinLoadDlg(HWND_DESKTOP, 3723 3724 3723 HWND_DESKTOP, 3724 np[x].pfnPageProc, FM3ModHandle, np[x].usFrameId, MPVOID); 3725 3725 if (!hwndTemp) { 3726 3727 3726 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, 3727 "Can not load settings page %u", x); 3728 3728 } 3729 3729 else { 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3730 WinSetWindowULong(hwndTemp, QWL_USER, (ULONG)hwnd); 3731 np[x].hwnd = hwndTemp; 3732 np[x].ulPageId = (ULONG)WinSendDlgItemMsg(hwnd, 3733 CFG_NOTEBOOK, 3734 BKM_INSERTPAGE, 3735 MPFROMLONG(BKA_FIRST), 3736 MPFROM2SHORT(BKA_AUTOPAGESIZE | 3737 BKA_STATUSTEXTON | 3738 BKA_MAJOR, attrib)); 3739 attrib = BKA_LAST; 3740 WinSendDlgItemMsg(hwnd, 3741 CFG_NOTEBOOK, 3742 BKM_SETPAGEWINDOWHWND, 3743 MPFROMLONG(np[x].ulPageId), MPFROMLONG(np[x].hwnd)); 3744 WinSendDlgItemMsg(hwnd, 3745 CFG_NOTEBOOK, 3746 BKM_SETTABTEXT, 3747 MPFROMLONG(np[x].ulPageId), 3748 MPFROMP(GetPString(np[x].ulTitle))); 3749 WinSendDlgItemMsg(hwnd, 3750 CFG_NOTEBOOK, 3751 BKM_SETSTATUSLINETEXT, 3752 MPFROMLONG(np[x].ulPageId), 3753 MPFROMP(GetPString(np[x].ulTitle + 1))); 3754 3755 if (LONGFROMMP(mp2) == np[x].usMenuId) 3756 uPageIndex = x; // Remember selected page 3757 3757 } 3758 3758 } // for pages … … 3763 3763 // 15 Feb 08 SHL fixme to do just once? 3764 3764 if (mp2 == MPFROMLONG(IDM_QUICKSETTINGS) && 3765 3766 3767 3765 x-- > 0 && 3766 np[x].hwnd && 3767 np[x].usFrameId == CFG9_FRAME) 3768 3768 { 3769 3769 // 10 Jan 08 SHL fixme to document what UM_SETDIR 1 means 3770 3770 //PostMsg(MainObjectHwnd, UM_SETDIR, MPFROMLONG(1), MPVOID); 3771 3771 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3772 3772 BKM_TURNTOPAGE, MPFROMLONG(np[x].ulPageId), MPVOID); 3773 3773 PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(np[x].hwnd), MPVOID); 3774 3774 PostMsg(np[x].hwnd, WM_COMMAND, MPFROM2SHORT(IDM_HELP, 0), MPVOID); … … 3776 3776 else if (uPageIndex >= x) { 3777 3777 Runtime_Error(pszSrcFile, __LINE__, "uPageIndex corrupted (%u)", 3778 3778 uPageIndex); 3779 3779 uPageIndex = 0; 3780 3780 } 3781 3781 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3782 3782 BKM_TURNTOPAGE, MPFROMLONG(np[uPageIndex].ulPageId), MPVOID); 3783 3783 // 15 Feb 08 SHL fixme to put focus on first field of page 3784 3784 … … 3802 3802 if (CHARMSG(&msg)->fs & KC_VIRTUALKEY) { 3803 3803 switch (CHARMSG(&msg)->vkey) { 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3804 case VK_F3: 3805 case VK_ENTER: 3806 case VK_NEWLINE: 3807 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_OK, MPVOID); 3808 return 0; 3809 break; 3810 case VK_ESC: 3811 PostMsg(hwnd, WM_COMMAND, (MPARAM)DID_CANCEL, MPVOID); 3812 return 0; 3813 break; 3814 case VK_F1: 3815 PostMsg(hwnd, WM_COMMAND, (MPARAM)IDM_HELP, MPVOID); 3816 return 0; 3817 break; 3818 3818 } 3819 3819 } … … 3831 3831 SaveLastPageIndex(hwnd); 3832 3832 ulPageId = (ULONG) WinSendDlgItemMsg(hwnd, 3833 3834 3835 3836 3833 CFG_NOTEBOOK, 3834 BKM_QUERYPAGEID, 3835 MPFROMLONG(0), 3836 MPFROM2SHORT(BKA_TOP, 0)); 3837 3837 hwndTemp = (HWND) WinSendDlgItemMsg(hwnd, 3838 3839 3840 3838 CFG_NOTEBOOK, 3839 BKM_QUERYPAGEWINDOWHWND, 3840 MPFROMLONG(ulPageId), MPVOID); 3841 3841 if (hwndTemp) 3842 3842 WinSendMsg(hwndTemp, UM_UNDO, MPVOID, MPVOID); 3843 3843 3844 3844 WinDismissDlg(hwnd, 0); … … 3847 3847 case IDM_HELP: /* relay message to appropriate page's window */ 3848 3848 ulPageId = (ULONG) WinSendDlgItemMsg(hwnd, 3849 3850 3851 3852 3849 CFG_NOTEBOOK, 3850 BKM_QUERYPAGEID, 3851 MPFROMLONG(0), 3852 MPFROM2SHORT(BKA_TOP, 0)); 3853 3853 hwndTemp = (HWND) WinSendDlgItemMsg(hwnd, 3854 3855 3856 3854 CFG_NOTEBOOK, 3855 BKM_QUERYPAGEWINDOWHWND, 3856 MPFROMLONG(ulPageId), MPVOID); 3857 3857 if (hwndTemp) 3858 3858 PostMsg(hwndTemp, WM_COMMAND, MPFROM2SHORT(IDM_HELP, 0), MPVOID); 3859 3859 break; 3860 3860 } … … 3864 3864 for (x = 0; np[x].usFrameId; x++) { 3865 3865 if (np[x].hwnd) 3866 3866 WinSendMsg(np[x].hwnd, UM_UNDO, MPVOID, MPVOID); 3867 3867 } 3868 3868 break; … … 3871 3871 if (np[0].usFrameId) { 3872 3872 for (x = 1; np[x].usFrameId; x++) { 3873 3874 3875 3876 3877 3873 if (np[x].hwnd) { 3874 WinSendMsg(np[x].hwnd, WM_CLOSE, MPVOID, MPVOID); 3875 np[x].hwnd = (HWND) 0; 3876 np[x].ulPageId = 0; 3877 } 3878 3878 } 3879 3879 WinSendMsg(np[0].hwnd, WM_CLOSE, MPVOID, MPVOID); … … 3908 3908 if (fIsLite) { 3909 3909 WinSendMsg(hwndMenu, 3910 3911 3910 MM_DELETEITEM, 3911 MPFROM2SHORT(IDM_QUICKSETTINGS, FALSE), MPVOID); 3912 3912 // If fm/2 lite drop quick setting page 3913 3913 for (x = 0; np[x].usFrameId && np[x].usFrameId != CFG9_FRAME; x++) … … 3928 3928 if (hwndOwner != HWND_DESKTOP) { 3929 3929 ulPageId = (ULONG)WinSendDlgItemMsg(hwnd, 3930 3931 3932 3933 3930 CFG_NOTEBOOK, 3931 BKM_QUERYPAGEID, 3932 MPFROMLONG(0), 3933 MPFROM2SHORT(BKA_TOP, 0)); 3934 3934 if (!ulPageId) 3935 3935 Runtime_Error(pszSrcFile, __LINE__, "BKM_QUERYPAGEID"); 3936 3936 else { 3937 3937 for (x = 0; np[x].usMenuId && np[x].ulPageId != ulPageId; x++) 3938 3938 ; // Scan 3939 3939 if (!np[x].usMenuId) 3940 3940 Runtime_Error(pszSrcFile, __LINE__, "bad menu id %lu", ulPageId); 3941 3941 else { 3942 3943 3944 3945 3942 PrfWriteProfileData(fmprof, FM3Str, pszIK_LastSettingsPage, 3943 (PVOID)&x, sizeof(x)); 3944 hwndMenu = WinWindowFromID(hwndOwner, FID_MENU); 3945 SetConditionalCascade(hwndMenu, IDM_NOTEBOOKSUBMENU, np[x].usMenuId); 3946 3946 } 3947 3947 }
Note:
See TracChangeset
for help on using the changeset viewer.