Changeset 1161 for trunk/dll/notebook.c
- Timestamp:
- Sep 5, 2008, 11:42:27 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/notebook.c
r1109 r1161 49 49 #define INCL_DOS 50 50 #define INCL_WIN 51 #define INCL_LONGLONG 51 #define INCL_LONGLONG // dircnrs.h 52 52 53 53 #include "fm3dlg.h" 54 54 #include "fm3str.h" 55 #include "pathutil.h" 56 #include "errutil.h" 57 #include "strutil.h" 55 #include "pathutil.h" // BldQuotedFileName 56 #include "errutil.h" // Dos_Error... 57 #include "strutil.h" // GetPString 58 58 #include "notebook.h" 59 #include "getnames.h" // CustomFileDlg 60 #include "mainwnd.h" // SaveDirCnrState 61 #include "walkem.h" // WalkExtractDlgProc 59 62 #include "fm3dll.h" 63 #include "misc.h" // LoadDetailsSwitches, SetConditionalCascade 60 64 #include "fortify.h" 61 65 … … 75 79 case WM_INITDLG: 76 80 WinSendDlgItemMsg(hwnd, CFGA_VIRUS, EM_SETTEXTLIMIT, 77 81 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 78 82 WinSendDlgItemMsg(hwnd, CFGA_EXTRACTPATH, EM_SETTEXTLIMIT, 79 83 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 80 84 WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), FALSE); 81 85 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 123 127 switch (SHORT2FROMMP(mp1)) { 124 128 case EN_KILLFOCUS: 125 126 129 WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), FALSE); 130 break; 127 131 case EN_SETFOCUS: 128 129 132 WinEnableWindow(WinWindowFromID(hwnd, CFGA_FIND), TRUE); 133 break; 130 134 } 131 135 break; … … 133 137 switch (SHORT2FROMMP(mp1)) { 134 138 case BN_CLICKED: 135 136 137 ARC_TYPE *pat = arcsighead;// Hide dups138 139 140 141 142 DosBeep(250, 100);// Complain143 144 145 146 147 148 139 if (WinQueryButtonCheckstate(hwnd, CFGA_DEFARC)) { 140 141 ARC_TYPE *pat = arcsighead; // Hide dups 142 143 if (!WinDlgBox(HWND_DESKTOP, hwnd, 144 SBoxDlgProc, FM3ModHandle, ASEL_FRAME, 145 (PVOID) & pat) || !pat || !pat->id || !*pat->id) { 146 DosBeep(250, 100); // Complain 147 WinCheckButton(hwnd, CFGA_DEFARC, FALSE); 148 } 149 else 150 WinSetDlgItemText(hwnd, CFGA_DEFARCNAME, pat->id); 151 } 152 break; 149 153 default: 150 154 break; 151 155 } 152 156 break; … … 172 176 case IDM_HELP: 173 177 if (hwndHelp) 174 175 178 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 179 MPFROM2SHORT(HELP_CFGA, 0), MPFROMSHORT(HM_RESOURCEID)); 176 180 break; 177 181 178 182 case CFGA_FIND: 179 183 { 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 184 CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9]; 185 USHORT id; 186 HWND hwndFocus; 187 188 strcpy(filename, "*.EXE"); 189 hwndFocus = WinQueryFocus(HWND_DESKTOP); 190 if (hwndFocus) { 191 id = WinQueryWindowUShort(hwndFocus, QWS_ID); 192 switch (id) { 193 case CFGA_VIRUS: 194 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 195 BldQuotedFileName(szfilename, filename); 196 strcat(szfilename, " %p"); 197 WinSetDlgItemText(hwnd, id, szfilename); 198 } 199 break; 200 case CFGA_EXTRACTPATH: 201 strcpy(filename, extractpath); 202 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, 203 WalkExtractDlgProc, FM3ModHandle, WALK_FRAME, 204 MPFROMP(filename)) && *filename) 205 WinSetDlgItemText(hwnd, id, filename); 206 break; 207 default: 208 Runtime_Error(pszSrcFile, __LINE__, "bad case"); 209 break; 210 } 211 } 208 212 } 209 213 break; … … 214 218 fQuickArcFind = WinQueryButtonCheckstate(hwnd, CFGA_QUICKARCFIND); 215 219 PrfWriteProfileData(fmprof, 216 217 220 appname, 221 "QuickArcFind", &fQuickArcFind, sizeof(BOOL)); 218 222 fArcStuffVisible = WinQueryButtonCheckstate(hwnd, CFGA_ARCSTUFFVISIBLE); 219 223 PrfWriteProfileData(fmprof, 220 221 224 appname, 225 "ArcStuffVisible", &fArcStuffVisible, sizeof(BOOL)); 222 226 fFolderAfterExtract = WinQueryButtonCheckstate(hwnd, 223 227 CFGA_FOLDERAFTEREXTRACT); 224 228 PrfWriteProfileData(fmprof, 225 226 227 229 appname, 230 "FolderAfterExtract", 231 &fFolderAfterExtract, sizeof(BOOL)); 228 232 if (WinQueryButtonCheckstate(hwnd, CFGA_DEFARC)) { 229 233 … … 253 257 szCLBuf[MaxComLineStrg - 1] = 0; 254 258 if (strcmp(szCLBuf, virus)){ 255 256 257 258 259 NormalizeCmdLine(pszWorkBuf, szCLBuf); 260 memcpy(virus, pszWorkBuf, strlen(pszWorkBuf) + 1); 261 if (!strchr(virus, '%') && strlen(virus) > 3) 262 strcat(virus, " %p"); 259 263 } 260 264 free(pszWorkBuf); 261 265 free(szCLBuf); 262 266 if (!*virus) 263 267 strcpy(virus, "OS2SCAN.EXE %p /SUB /A"); 264 268 WinQueryDlgItemText(hwnd, CFGA_EXTRACTPATH, CCHMAXPATH, szPathBuf); 265 269 szPathBuf[CCHMAXPATH - 1] = 0; 266 270 bstrip(szPathBuf); 267 271 if (strcmp(extractpath, szPathBuf)) { 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 272 memcpy(extractpath, szPathBuf, strlen(szPathBuf) + 1); 273 if (*extractpath){ 274 MakeFullName(extractpath); 275 if (IsFile(extractpath)) { 276 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 277 GetPString(IDS_WARNINGTEXT), 278 GetPString(IDS_EXTPATHNOTVALIDTEXT), 279 extractpath); 280 if (ulResult == MBID_YES) 281 *extractpath = 0; 282 if (ulResult == MBID_CANCEL){ 283 WinDlgBox(HWND_DESKTOP, 284 hwnd, 285 CfgDlgProc, 286 FM3ModHandle, 287 CFG_FRAME, 288 MPFROMLONG(IDM_ARCHIVERSETTINGS)); 289 break; 290 } 291 } 292 } 289 293 } 290 294 } … … 296 300 fCancelAction = FALSE; 297 301 WinDlgBox(HWND_DESKTOP, 298 299 300 301 302 302 hwnd, 303 CfgDlgProc, 304 FM3ModHandle, 305 CFG_FRAME, 306 MPFROMLONG(IDM_ARCHIVERSETTINGS)); 303 307 } 304 308 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 311 315 case WM_INITDLG: 312 316 WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_SETTEXTLIMIT, 313 317 MPFROMSHORT(8), MPVOID); 314 318 WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_OVERRIDESETLIMITS, 315 319 MPFROMLONG(FILESTOGET_MAX), MPFROMLONG(FILESTOGET_MIN)); 316 320 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 317 321 break; … … 352 356 WinCheckButton(hwnd, CFGS_REMOTEBUG, fRemoteBug); 353 357 WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_SETCURRENTVALUE, 354 358 MPFROMLONG(FilesToGet), MPVOID); 355 359 return 0; 356 360 … … 360 364 case CFGS_FORCELOWER: 361 365 { 362 363 364 365 366 367 368 369 370 371 372 373 374 366 BOOL temp; 367 368 temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1)); 369 if (temp) { 370 switch (SHORT1FROMMP(mp1)) { 371 case CFGS_FORCEUPPER: 372 WinCheckButton(hwnd, CFGS_FORCELOWER, FALSE); 373 break; 374 case CFGS_FORCELOWER: 375 WinCheckButton(hwnd, CFGS_FORCEUPPER, FALSE); 376 break; 377 } 378 } 375 379 } 376 380 break; … … 393 397 case IDM_HELP: 394 398 if (hwndHelp) 395 396 399 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 400 MPFROM2SHORT(HELP_CFGS, 0), MPFROMSHORT(HM_RESOURCEID)); 397 401 break; 398 402 } … … 402 406 fLoadLongnames = WinQueryButtonCheckstate(hwnd, CFGS_LOADLONGNAMES); 403 407 PrfWriteProfileData(fmprof, appname, "LoadLongname", &fLoadLongnames, 404 408 sizeof(BOOL)); 405 409 fLoadSubject = WinQueryButtonCheckstate(hwnd, CFGS_LOADSUBJECTS); 406 410 PrfWriteProfileData(fmprof, appname, "LoadSubject", &fLoadSubject, 407 411 sizeof(BOOL)); 408 412 fRemoteBug = WinQueryButtonCheckstate(hwnd, CFGS_REMOTEBUG); 409 413 PrfWriteProfileData(fmprof, appname, "RemoteBug", &fRemoteBug, 410 414 sizeof(BOOL)); 411 415 fNoRemovableScan = WinQueryButtonCheckstate(hwnd, CFGS_NOREMOVABLESCAN); 412 416 PrfWriteProfileData(fmprof, FM3Str, "NoRemovableScan", &fNoRemovableScan, 413 417 sizeof(BOOL)); 414 418 fNoIconsFiles = WinQueryButtonCheckstate(hwnd, CFGS_NOICONSFILES); 415 419 fNoIconsFiles = (fNoIconsFiles) ? FALSE : TRUE; 416 420 PrfWriteProfileData(fmprof, appname, "NoIconsFiles", 417 421 &fNoIconsFiles, sizeof(BOOL)); 418 422 fNoIconsDirs = WinQueryButtonCheckstate(hwnd, CFGS_NOICONSDIRS); 419 423 fNoIconsDirs = (fNoIconsDirs) ? FALSE : TRUE; 420 424 PrfWriteProfileData(fmprof, appname, "NoIconsDirs", 421 425 &fNoIconsDirs, sizeof(BOOL)); 422 426 fForceUpper = WinQueryButtonCheckstate(hwnd, CFGS_FORCEUPPER); 423 427 PrfWriteProfileData(fmprof, appname, "ForceUpper", 424 428 &fForceUpper, sizeof(BOOL)); 425 429 fForceLower = WinQueryButtonCheckstate(hwnd, CFGS_FORCELOWER); 426 430 PrfWriteProfileData(fmprof, appname, "ForceLower", 427 431 &fForceLower, sizeof(BOOL)); 428 432 { 429 433 WinSendDlgItemMsg(hwnd, CFGS_FILESTOGET, SPBM_QUERYVALUE, 430 434 MPFROMP(&FilesToGet), MPFROM2SHORT(0, SPBQ_DONOTUPDATE)); 431 435 if (FilesToGet < FILESTOGET_MIN) 432 436 FilesToGet = FILESTOGET_MIN; 433 437 else if (FilesToGet > FILESTOGET_MAX) 434 438 FilesToGet = FILESTOGET_MAX; 435 439 PrfWriteProfileData(fmprof, 436 440 appname, "FilesToGet", &FilesToGet, sizeof(ULONG)); 437 441 } 438 442 break; … … 447 451 case WM_INITDLG: 448 452 WinSendDlgItemMsg(hwnd, CFGV_VIEWER, EM_SETTEXTLIMIT, 449 453 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 450 454 WinSendDlgItemMsg(hwnd, CFGV_EDITOR, EM_SETTEXTLIMIT, 451 455 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 452 456 WinSendDlgItemMsg(hwnd, CFGV_BINVIEW, EM_SETTEXTLIMIT, 453 457 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 454 458 WinSendDlgItemMsg(hwnd, CFGV_BINED, EM_SETTEXTLIMIT, 455 459 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 456 460 WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), FALSE); 457 461 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 502 506 switch (SHORT2FROMMP(mp1)) { 503 507 case EN_KILLFOCUS: 504 505 508 WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), FALSE); 509 break; 506 510 case EN_SETFOCUS: 507 508 511 WinEnableWindow(WinWindowFromID(hwnd, CFGV_FIND), TRUE); 512 break; 509 513 } 510 514 break; … … 527 531 case IDM_HELP: 528 532 if (hwndHelp) 529 530 533 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 534 MPFROM2SHORT(HELP_CFGV, 0), MPFROMSHORT(HM_RESOURCEID)); 531 535 break; 532 536 533 537 case CFGV_FIND: 534 538 { 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 539 CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9]; 540 USHORT id; 541 HWND hwndFocus; 542 543 strcpy(filename, "*.EXE"); 544 hwndFocus = WinQueryFocus(HWND_DESKTOP); 545 if (hwndFocus) { 546 id = WinQueryWindowUShort(hwndFocus, QWS_ID); 547 switch (id) { 548 case CFGV_BINVIEW: 549 case CFGV_BINED: 550 case CFGV_VIEWER: 551 case CFGV_EDITOR: 552 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 553 BldQuotedFileName(szfilename, filename); 554 strcat(szfilename, " %a"); 555 WinSetDlgItemText(hwnd, id, szfilename); 556 } 557 break; 558 default: 559 Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id); 560 break; 561 } 562 } 559 563 } 560 564 break; … … 578 582 szCLBuf[MaxComLineStrg - 1] = 0; 579 583 if (strcmp(szCLBuf, viewer)){ 580 581 582 583 584 NormalizeCmdLine(pszWorkBuf, szCLBuf); 585 memcpy(viewer, pszWorkBuf, strlen(pszWorkBuf) + 1); 586 if (!strchr(viewer, '%') && strlen(viewer) > 3) 587 strcat(viewer, " %a"); 584 588 } 585 589 WinQueryDlgItemText(hwnd, CFGV_EDITOR, MaxComLineStrg, szCLBuf); 586 590 szCLBuf[MaxComLineStrg - 1] = 0; 587 591 if (strcmp(szCLBuf, editor)){ 588 589 590 591 592 NormalizeCmdLine(pszWorkBuf, szCLBuf); 593 memcpy(editor, pszWorkBuf, strlen(pszWorkBuf) + 1); 594 if (!strchr(editor, '%') && strlen(editor) > 3) 595 strcat(editor, " %a"); 592 596 } 593 597 WinQueryDlgItemText(hwnd, CFGV_BINVIEW, MaxComLineStrg, szCLBuf); 594 598 szCLBuf[MaxComLineStrg - 1] = 0; 595 599 if (strcmp(szCLBuf, binview)){ 596 597 598 599 600 NormalizeCmdLine(pszWorkBuf, szCLBuf); 601 memcpy(binview, pszWorkBuf, strlen(pszWorkBuf) + 1); 602 if (!strchr(binview, '%') && strlen(binview) > 3) 603 strcat(binview, " %a"); 600 604 } 601 605 WinQueryDlgItemText(hwnd, CFGV_BINED, MaxComLineStrg, szCLBuf); 602 606 szCLBuf[MaxComLineStrg - 1] = 0; 603 607 if (strcmp(szCLBuf, bined)){ 604 605 606 607 608 NormalizeCmdLine(pszWorkBuf, szCLBuf); 609 memcpy(bined, pszWorkBuf, strlen(pszWorkBuf) + 1); 610 if (!strchr(bined, '%') && strlen(bined) > 3) 611 strcat(bined, " %a"); 608 612 } 609 613 free(pszWorkBuf); … … 615 619 fUseNewViewer = WinQueryButtonCheckstate(hwnd, CFGV_USENEWVIEWER); 616 620 PrfWriteProfileData(fmprof, appname, "UseNewViewer", &fUseNewViewer, 617 621 sizeof(BOOL)); 618 622 fGuessType = WinQueryButtonCheckstate(hwnd, CFGV_GUESSTYPE); 619 623 PrfWriteProfileData(fmprof, appname, "GuessType", &fGuessType, 620 624 sizeof(BOOL)); 621 625 fViewChild = WinQueryButtonCheckstate(hwnd, CFGV_VIEWCHILD); 622 626 PrfWriteProfileData(fmprof, appname, "ViewChild", &fViewChild, 623 627 sizeof(BOOL)); 624 628 fCheckMM = WinQueryButtonCheckstate(hwnd, CFGV_CHECKMM); 625 629 PrfWriteProfileData(fmprof, appname, "CheckMM", &fCheckMM, sizeof(BOOL)); … … 631 635 fCancelAction = FALSE; 632 636 WinDlgBox(HWND_DESKTOP, 633 634 635 636 637 637 hwnd, 638 CfgDlgProc, 639 FM3ModHandle, 640 CFG_FRAME, 641 MPFROMLONG(IDM_VIEWERSETTINGS)); 638 642 } 639 643 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 645 649 case WM_INITDLG: 646 650 WinSendDlgItemMsg(hwnd, CFGH_RUNFTPWORKDIR, EM_SETTEXTLIMIT, 647 651 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 648 652 WinSendDlgItemMsg(hwnd, CFGH_RUNHTTPWORKDIR, EM_SETTEXTLIMIT, 649 653 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 650 654 WinSendDlgItemMsg(hwnd, CFGH_FTPRUN, EM_SETTEXTLIMIT, 651 655 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 652 656 WinSendDlgItemMsg(hwnd, CFGH_HTTPRUN, EM_SETTEXTLIMIT, 653 657 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 654 658 WinSendDlgItemMsg(hwnd, CFGH_MAILRUN, EM_SETTEXTLIMIT, 655 659 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 656 660 WinSendDlgItemMsg(hwnd, CFGH_RUNMAILWORKDIR, EM_SETTEXTLIMIT, 657 661 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 658 662 WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), FALSE); 659 663 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 710 714 switch (SHORT2FROMMP(mp1)) { 711 715 case EN_KILLFOCUS: 712 713 716 WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), FALSE); 717 break; 714 718 case EN_SETFOCUS: 715 716 719 WinEnableWindow(WinWindowFromID(hwnd, CFGH_FIND), TRUE); 720 break; 717 721 } 718 722 break; … … 735 739 case IDM_HELP: 736 740 if (hwndHelp) 737 738 741 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 742 MPFROM2SHORT(HELP_CFGH, 0), MPFROMSHORT(HM_RESOURCEID)); 739 743 break; 740 744 741 745 case CFGH_FIND: 742 746 { 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 747 CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9]; 748 USHORT id; 749 HWND hwndFocus; 750 751 strcpy(filename, "*.EXE"); 752 hwndFocus = WinQueryFocus(HWND_DESKTOP); 753 if (hwndFocus) { 754 id = WinQueryWindowUShort(hwndFocus, QWS_ID); 755 switch (id) { 756 case CFGH_HTTPRUN: 757 case CFGH_FTPRUN: 758 case CFGH_MAILRUN: 759 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 760 BldQuotedFileName(szfilename, filename); 761 WinSetDlgItemText(hwnd, id, szfilename); 762 } 763 break; 764 case CFGH_RUNFTPWORKDIR: 765 strcpy(filename, ftprundir); 766 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, 767 WalkExtractDlgProc, FM3ModHandle, WALK_FRAME, 768 MPFROMP(filename)) && *filename) 769 WinSetDlgItemText(hwnd, id, filename); 770 break; 771 case CFGH_RUNHTTPWORKDIR: 772 strcpy(filename, httprundir); 773 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, 774 WalkExtractDlgProc, FM3ModHandle, WALK_FRAME, 775 MPFROMP(filename)) && *filename) 776 WinSetDlgItemText(hwnd, id, filename); 777 break; 778 case CFGH_RUNMAILWORKDIR: 779 strcpy(filename, mailrundir); 780 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, 781 WalkExtractDlgProc, FM3ModHandle, WALK_FRAME, 782 MPFROMP(filename)) && *filename) 783 WinSetDlgItemText(hwnd, id, filename); 784 break; 785 default: 786 Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id); 787 break; 788 } 789 } 786 790 } 787 791 break; … … 818 822 szCLBuf[MaxComLineStrg - 1] = 0; 819 823 if (strcmp(szCLBuf, ftprun)){ 820 821 824 NormalizeCmdLine(pszWorkBuf, szCLBuf); 825 memcpy(ftprun, pszWorkBuf, strlen(pszWorkBuf) + 1); 822 826 } 823 827 WinQueryDlgItemText(hwnd, CFGH_HTTPRUN, MaxComLineStrg, szCLBuf); 824 828 szCLBuf[MaxComLineStrg - 1] = 0; 825 829 if (strcmp(szCLBuf, httprun)){ 826 827 830 NormalizeCmdLine(pszWorkBuf, szCLBuf); 831 memcpy(httprun, pszWorkBuf, strlen(pszWorkBuf) + 1); 828 832 } 829 833 WinQueryDlgItemText(hwnd, CFGH_MAILRUN, MaxComLineStrg, szCLBuf); 830 834 szCLBuf[MaxComLineStrg - 1] = 0; 831 835 if (strcmp(szCLBuf, mailrun)){ 832 833 836 NormalizeCmdLine(pszWorkBuf, szCLBuf); 837 memcpy(mailrun, pszWorkBuf, strlen(pszWorkBuf) + 1); 834 838 } 835 839 free(pszWorkBuf); … … 843 847 fHttpRunWPSDefault = WinQueryButtonCheckstate(hwnd, CFGH_HTTPRUNWPSDEFAULT); 844 848 PrfWriteProfileData(fmprof, appname, "HttpRunWPSDefault", &fHttpRunWPSDefault, 845 849 sizeof(BOOL)); 846 850 fFtpRunWPSDefault = WinQueryButtonCheckstate(hwnd, CFGH_FTPRUNWPSDEFAULT); 847 851 PrfWriteProfileData(fmprof, appname, "FtpRunWPSDefault", &fFtpRunWPSDefault, 848 852 sizeof(BOOL)); 849 853 fLibPathStrictHttpRun = WinQueryButtonCheckstate(hwnd, CFGH_LIBPATHSTRICTHTTPRUN); 850 854 PrfWriteProfileData(fmprof, appname, "LibPathStrictHttpRun", 851 855 &fLibPathStrictHttpRun, sizeof(BOOL)); 852 856 fLibPathStrictFtpRun = WinQueryButtonCheckstate(hwnd, CFGH_LIBPATHSTRICTFTPRUN); 853 857 PrfWriteProfileData(fmprof, appname, "LibPathStrictFtpRun", 854 858 &fLibPathStrictFtpRun, sizeof(BOOL)); 855 859 fLibPathStrictMailRun = WinQueryButtonCheckstate(hwnd, CFGH_LIBPATHSTRICTMAILRUN); 856 860 PrfWriteProfileData(fmprof, appname, "LibPathStrictMailRun", 857 861 &fLibPathStrictMailRun, sizeof(BOOL)); 858 862 fNoMailtoMailRun = WinQueryButtonCheckstate(hwnd, CFGH_NOMAILTOMAILRUN); 859 863 PrfWriteProfileData(fmprof, appname, "NoMailtoMailRun", 860 864 &fNoMailtoMailRun, sizeof(BOOL)); 861 865 break; 862 866 } … … 865 869 fCancelAction = FALSE; 866 870 WinDlgBox(HWND_DESKTOP, 867 868 869 870 871 871 hwnd, 872 CfgDlgProc, 873 FM3ModHandle, 874 CFG_FRAME, 875 MPFROMLONG(IDM_VIEWERSETTINGS)); 872 876 } 873 877 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 927 931 case IDM_HELP: 928 932 if (hwndHelp) 929 930 931 933 WinSendMsg(hwndHelp, 934 HM_DISPLAY_HELP, 935 MPFROM2SHORT(HELP_CFGB, 0), MPFROMSHORT(HM_RESOURCEID)); 932 936 break; 933 937 } … … 937 941 fToolbarHelp = WinQueryButtonCheckstate(hwnd, CFGB_TOOLBARHELP); 938 942 PrfWriteProfileData(fmprof, 939 943 FM3Str, "ToolbarHelp", &fToolbarHelp, sizeof(BOOL)); 940 944 fDrivebarHelp = WinQueryButtonCheckstate(hwnd, CFGB_DRIVEBARHELP); 941 945 PrfWriteProfileData(fmprof, 942 946 FM3Str, "DrivebarHelp", &fDrivebarHelp, sizeof(BOOL)); 943 947 fOtherHelp = WinQueryButtonCheckstate(hwnd, CFGB_OTHERHELP); 944 948 PrfWriteProfileData(fmprof, 945 949 FM3Str, "OtherHelp", &fOtherHelp, sizeof(BOOL)); 946 950 break; 947 951 } … … 956 960 case WM_INITDLG: 957 961 WinSendDlgItemMsg(hwnd, 958 959 962 CFG5_FILTER, 963 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 960 964 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 961 965 break; … … 996 1000 997 1001 if (!PrfQueryProfileData(fmprof, 998 999 1000 1001 1002 appname, 1003 "TreeflWindowAttr", 1004 (PVOID) & flWindowAttr, &ulSize)) 1005 flWindowAttr |= (CV_TREE | CA_TREELINE | CV_ICON | CV_MINI | CV_FLOW); 1002 1006 WinCheckButton(hwnd, CFG5_ICON, ((flWindowAttr & CV_ICON) != FALSE)); 1003 1007 WinCheckButton(hwnd, CFG5_MINIICONS, 1004 1008 ((flWindowAttr & CV_MINI) != FALSE)); 1005 1009 memset(&mask, 0, sizeof(mask)); 1006 1010 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 1007 1011 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 1008 1012 mask.fIsTree = TRUE; 1009 1013 ulSize = sizeof(MASK); 1010 1014 if (PrfQueryProfileData(fmprof, appname, "TreeFilter", &mask, &ulSize)) { 1011 1015 SetMask(NULL, &mask); 1012 1016 } 1013 1017 if (!mask.attrFile) 1014 1015 1016 1018 mask.attrFile = (FILE_READONLY | FILE_NORMAL | 1019 FILE_ARCHIVED | FILE_DIRECTORY | 1020 FILE_HIDDEN | FILE_SYSTEM); 1017 1021 strcpy(mask.prompt, GetPString(IDS_TREEFILTERTITLETEXT)); 1018 1022 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 1027 1031 WinCheckButton(hwnd, CFG6_SORTREVERSE, FALSE); 1028 1032 if (TreesortFlags & SORT_FIRSTEXTENSION) 1029 1033 WinCheckButton(hwnd, CFG6_SORTFIRST, TRUE); 1030 1034 else if (TreesortFlags & SORT_LASTEXTENSION) 1031 1035 WinCheckButton(hwnd, CFG6_SORTLAST, TRUE); 1032 1036 else if (TreesortFlags & SORT_SIZE) 1033 1037 WinCheckButton(hwnd, CFG6_SORTSIZE, TRUE); 1034 1038 else if (TreesortFlags & SORT_EASIZE) 1035 1039 WinCheckButton(hwnd, CFG6_SORTEASIZE, TRUE); 1036 1040 else if (TreesortFlags & SORT_LWDATE) 1037 1041 WinCheckButton(hwnd, CFG6_SORTLWDATE, TRUE); 1038 1042 else if (TreesortFlags & SORT_LADATE) 1039 1043 WinCheckButton(hwnd, CFG6_SORTLADATE, TRUE); 1040 1044 else if (TreesortFlags & SORT_CRDATE) 1041 1045 WinCheckButton(hwnd, CFG6_SORTCRDATE, TRUE); 1042 1046 else if (TreesortFlags & SORT_FILENAME) 1043 1047 WinCheckButton(hwnd, CFG6_SORTFILENAME, TRUE); 1044 1048 else 1045 1049 WinCheckButton(hwnd, CFG6_SORTNAME, TRUE); 1046 1050 if (TreesortFlags & SORT_REVERSE) 1047 1051 WinCheckButton(hwnd, CFG6_SORTREVERSE, TRUE); 1048 1052 } 1049 1053 return 0; … … 1051 1055 case UM_SETUP5: 1052 1056 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc, 1053 1057 FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) { 1054 1058 SetMask(NULL, &mask); 1055 1059 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 1062 1066 switch (SHORT2FROMMP(mp1)) { 1063 1067 case EN_SETFOCUS: 1064 1065 1066 1068 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 1069 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); 1070 break; 1067 1071 } 1068 1072 break; … … 1085 1089 case IDM_HELP: 1086 1090 if (hwndHelp) 1087 1088 1089 1091 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1092 MPFROM2SHORT(HELP_TREEVIEW, 0), 1093 MPFROMSHORT(HM_RESOURCEID)); 1090 1094 break; 1091 1095 } … … 1097 1101 1098 1102 if (WinQueryButtonCheckstate(hwnd, CFG5_ICON)) 1099 1103 flWindowAttr |= CV_ICON; 1100 1104 else 1101 1105 flWindowAttr |= CV_TEXT; 1102 1106 if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS)) 1103 1107 flWindowAttr |= CV_MINI; 1104 1108 flWindowAttr |= (CV_TREE | CV_FLOW | CA_TREELINE); 1105 1109 PrfWriteProfileData(fmprof, 1106 1107 1110 appname, 1111 "TreeflWindowAttr", &flWindowAttr, sizeof(ULONG)); 1108 1112 if (hwndTree) { 1109 1113 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1114 CNRINFO cnri; 1115 1116 memset(&cnri, 0, sizeof(cnri)); 1117 cnri.cb = sizeof(cnri); 1118 WinSendMsg(WinWindowFromID 1119 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 1120 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 1121 cnri.flWindowAttr = flWindowAttr; 1122 WinSendMsg(WinWindowFromID 1123 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 1124 CM_SETCNRINFO, MPFROMP(&cnri), 1125 MPFROMLONG(CMA_FLWINDOWATTR)); 1122 1126 } 1123 1127 } … … 1146 1150 TreesortFlags |= SORT_REVERSE; 1147 1151 PrfWriteProfileData(fmprof, appname, "TreeSort", &TreesortFlags, 1148 1152 sizeof(INT)); 1149 1153 if (hwndTree) 1150 1154 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESORT, 0), MPVOID); … … 1156 1160 1157 1161 dcd = WinQueryWindowPtr(WinWindowFromID(WinWindowFromID(hwndTree, 1158 1159 1162 FID_CLIENT), 1163 TREE_CNR), QWL_USER); 1160 1164 if (dcd && dcd->size == sizeof(DIRCNRDATA)) { 1161 1162 1165 dcd->mask = mask; 1166 PostMsg(hwndTree, UM_FILTER, MPVOID, MPVOID); 1163 1167 } 1164 1168 } … … 1176 1180 case WM_INITDLG: 1177 1181 WinSendDlgItemMsg(hwnd, CFGT_ENVVARLIST, EM_SETTEXTLIMIT, 1178 1182 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 1179 1183 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 1180 1184 break; … … 1233 1237 case IDM_HELP: 1234 1238 if (hwndHelp) 1235 1236 1239 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1240 MPFROM2SHORT(HELP_CFGT, 0), MPFROMSHORT(HM_RESOURCEID)); 1237 1241 break; 1238 1242 } … … 1242 1246 fVTreeOpensWPS = WinQueryButtonCheckstate(hwnd, CFGT_VTREEOPENSWPS); 1243 1247 PrfWriteProfileData(fmprof, FM3Str, "VTreeOpensWPS", &fVTreeOpensWPS, 1244 1248 sizeof(BOOL)); 1245 1249 fCollapseFirst = WinQueryButtonCheckstate(hwnd, CFGT_COLLAPSEFIRST); 1246 1250 PrfWriteProfileData(fmprof, appname, "CollapseFirst", &fCollapseFirst, 1247 1251 sizeof(BOOL)); 1248 1252 fSwitchTreeOnFocus = WinQueryButtonCheckstate(hwnd, 1249 1253 CFGT_SWITCHTREEONFOCUS); 1250 1254 PrfWriteProfileData(fmprof, appname, "SwitchTreeOnFocus", 1251 1255 &fSwitchTreeOnFocus, sizeof(BOOL)); 1252 1256 fSwitchTreeExpand = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREEEXPAND); 1253 1257 PrfWriteProfileData(fmprof, appname, "SwitchTreeExpand", 1254 1258 &fSwitchTreeExpand, sizeof(BOOL)); 1255 1259 fSwitchTree = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREE); 1256 1260 PrfWriteProfileData(fmprof, appname, "SwitchTree", &fSwitchTree, 1257 1261 sizeof(BOOL)); 1258 1262 fFollowTree = WinQueryButtonCheckstate(hwnd, CFGT_FOLLOWTREE); 1259 1263 PrfWriteProfileData(fmprof, appname, "FollowTree", &fFollowTree, 1260 1264 sizeof(BOOL)); 1261 1265 fTopDir = WinQueryButtonCheckstate(hwnd, CFGT_TOPDIR); 1262 1266 PrfWriteProfileData(fmprof, appname, "TopDir", (PVOID) & fTopDir, 1263 1267 sizeof(BOOL)); 1264 1268 fDCOpens = WinQueryButtonCheckstate(hwnd, CFGT_DCOPENS); 1265 1269 PrfWriteProfileData(fmprof, FM3Str, "DoubleClickOpens", &fDCOpens, 1266 1270 sizeof(BOOL)); 1267 1271 fShowEnvChanged = (fShowEnv != WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV)); 1268 1272 fShowEnv = WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV); … … 1282 1286 if (hwndTree && (fShowEnvChanged || (fShowEnv && fTreeEnvVarListChanged))) 1283 1287 { 1284 1285 1286 1287 1288 PCNRITEM pci = WinSendMsg(WinWindowFromID 1289 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), CM_QUERYRECORDEMPHASIS, 1290 MPFROMLONG(CMA_FIRST), 1291 MPFROMSHORT(CRA_SELECTED)); 1288 1292 PostMsg(WinWindowFromID 1289 1290 1291 1292 1293 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), WM_COMMAND, 1294 MPFROM2SHORT(IDM_RESCAN, 0), MPVOID); 1295 pszTemp = xstrdup(pci->pszFileName, pszSrcFile, __LINE__); 1296 if (pszTemp) { 1293 1297 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTemp), MPVOID)) 1294 1298 free(pszTemp); 1295 1296 1299 /* pszTemp is freed in the UM_SHOWME code */ 1300 } 1297 1301 } 1298 1302 } … … 1307 1311 case WM_INITDLG: 1308 1312 WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_SETTEXTLIMIT, 1309 1313 MPFROMSHORT(8), MPVOID); 1310 1314 WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_OVERRIDESETLIMITS, 1311 1315 MPFROMLONG(CMDLNLNGTH_MAX), MPFROMLONG(CMDLNLNGTH_MIN)); 1312 1316 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 1313 1317 break; … … 1358 1362 WinCheckButton(hwnd, CFGG_TRASHCAN, fTrashCan); 1359 1363 WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_SETCURRENTVALUE, 1360 1364 MPFROMLONG(MaxComLineStrg), MPVOID); 1361 1365 return 0; 1362 1366 … … 1375 1379 switch (SHORT2FROMMP(mp1)) { 1376 1380 case EN_SETFOCUS: 1377 1378 1379 1381 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 1382 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); 1383 break; 1380 1384 } 1381 1385 break; … … 1398 1402 case IDM_HELP: 1399 1403 if (hwndHelp) 1400 1401 1402 1404 WinSendMsg(hwndHelp, 1405 HM_DISPLAY_HELP, 1406 MPFROM2SHORT(HELP_CFGG, 0), MPFROMSHORT(HM_RESOURCEID)); 1403 1407 break; 1404 1408 } … … 1414 1418 PrfWriteProfileData(fmprof, FM3Str, "NoDead", &fNoDead, sizeof(BOOL)); 1415 1419 PrfWriteProfileData(fmprof, 1416 1420 FM3Str, "NoFinger", &fNoFinger, sizeof(BOOL)); 1417 1421 WinDestroyPointer(hptrFinger); 1418 1422 if (!fNoDead) 1419 1423 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER_ICON); 1420 1424 else 1421 1425 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER2_ICON); 1422 1426 } 1423 1427 fLinkSetsIcon = WinQueryButtonCheckstate(hwnd, CFGG_LINKSETSICON); 1424 1428 PrfWriteProfileData(fmprof, 1425 1426 1429 appname, 1430 "LinkSetsIcon", &fLinkSetsIcon, sizeof(BOOL)); 1427 1431 fCustomFileDlg = WinQueryButtonCheckstate(hwnd, CFGG_CUSTOMFILEDLG); 1428 1432 PrfWriteProfileData(fmprof, 1429 1430 1433 FM3Str, 1434 "CustomFileDlg", &fCustomFileDlg, sizeof(BOOL)); 1431 1435 fDullMin = WinQueryButtonCheckstate(hwnd, CFGG_BORING); 1432 1436 PrfWriteProfileData(fmprof, 1433 1437 FM3Str, "DullDatabar", &fDullMin, sizeof(BOOL)); 1434 1438 fConfirmDelete = WinQueryButtonCheckstate(hwnd, CFGG_CONFIRMDELETE); 1435 1439 PrfWriteProfileData(fmprof, 1436 1437 1440 appname, 1441 "ConfirmDelete", &fConfirmDelete, sizeof(BOOL)); 1438 1442 fDontMoveMouse = WinQueryButtonCheckstate(hwnd, CFGG_DONTMOVEMOUSE); 1439 1443 PrfWriteProfileData(fmprof, 1440 1441 1444 appname, 1445 "DontMoveMouse", &fDontMoveMouse, sizeof(BOOL)); 1442 1446 fCopyDefault = WinQueryButtonCheckstate(hwnd, CFGG_DEFAULTCOPY); 1443 1447 PrfWriteProfileData(fmprof, appname, "DefaultCopy", 1444 1448 &fCopyDefault, sizeof(BOOL)); 1445 1449 fRealIdle = WinQueryButtonCheckstate(hwnd, CFGG_IDLECOPY); 1446 1450 PrfWriteProfileData(fmprof, appname, "IdleCopy", 1447 1451 &fRealIdle, sizeof(BOOL)); 1448 1452 fDragndropDlg = WinQueryButtonCheckstate(hwnd, CFGG_DNDDLG); 1449 1453 PrfWriteProfileData(fmprof, appname, "Drag&DropDlg", 1450 1454 &fDragndropDlg, sizeof(BOOL)); 1451 1455 fVerify = WinQueryButtonCheckstate(hwnd, CFGG_VERIFYWRITES); 1452 1456 PrfWriteProfileData(fmprof, appname, "VerifyWrites", 1453 1457 &fVerify, sizeof(BOOL)); 1454 1458 DosSetVerify(fVerify); 1455 1459 fDefaultDeletePerm = WinQueryButtonCheckstate(hwnd, 1456 1460 CFGG_DEFAULTDELETEPERM); 1457 1461 PrfWriteProfileData(fmprof, appname, "DefaultDeletePerm", 1458 1462 &fDefaultDeletePerm, sizeof(BOOL)); 1459 1463 fFM2Deletes = WinQueryButtonCheckstate(hwnd, CFGG_FM2DELETES); 1460 1464 PrfWriteProfileData(fmprof, FM3Str, "FM2Deletes", … … 1462 1466 fTrashCan = WinQueryButtonCheckstate(hwnd, CFGG_TRASHCAN); 1463 1467 PrfWriteProfileData(fmprof, FM3Str, "TrashCan", 1464 1468 &fTrashCan, sizeof(BOOL)); 1465 1469 fConfirmTarget = WinQueryButtonCheckstate(hwnd, CFGG_CONFIRMTARGET); 1466 1470 PrfWriteProfileData(fmprof, appname, "ConfirmTarget", … … 1468 1472 { 1469 1473 WinSendDlgItemMsg(hwnd, CFGG_CMDLNLNGTH, SPBM_QUERYVALUE, 1470 1474 MPFROMP(&MaxComLineStrg), MPFROM2SHORT(0, SPBQ_DONOTUPDATE)); 1471 1475 if (MaxComLineStrg < CMDLNLNGTH_MIN) 1472 1476 MaxComLineStrg = CMDLNLNGTH_MIN; 1473 1477 else if (MaxComLineStrg > CMDLNLNGTH_MAX) 1474 1478 MaxComLineStrg = CMDLNLNGTH_MAX; 1475 1479 PrfWriteProfileData(fmprof, 1476 1480 appname, "MaxComLineStrg", &MaxComLineStrg, sizeof(ULONG)); 1477 1481 } 1478 1482 break; … … 1486 1490 case WM_INITDLG: 1487 1491 WinSendDlgItemMsg(hwnd, CFGC_COMPARE, EM_SETTEXTLIMIT, 1488 1492 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 1489 1493 WinSendDlgItemMsg(hwnd, CFGC_DIRCOMPARE, EM_SETTEXTLIMIT, 1490 1494 MPFROM2SHORT(MaxComLineStrg, 0), MPVOID); 1491 1495 WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), FALSE); 1492 1496 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); … … 1529 1533 switch (SHORT2FROMMP(mp1)) { 1530 1534 case EN_KILLFOCUS: 1531 1532 1535 WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), FALSE); 1536 break; 1533 1537 case EN_SETFOCUS: 1534 1535 1538 WinEnableWindow(WinWindowFromID(hwnd, CFGC_FIND), TRUE); 1539 break; 1536 1540 } 1537 1541 break; … … 1554 1558 case IDM_HELP: 1555 1559 if (hwndHelp) 1556 1557 1560 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1561 MPFROM2SHORT(HELP_CFGC, 0), MPFROMSHORT(HM_RESOURCEID)); 1558 1562 break; 1559 1563 1560 1564 case CFGC_FIND: 1561 1565 { 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1566 CHAR filename[CCHMAXPATH + 9], szfilename[CCHMAXPATH + 9]; 1567 USHORT id; 1568 HWND hwndFocus; 1569 1570 strcpy(filename, "*.EXE"); 1571 hwndFocus = WinQueryFocus(HWND_DESKTOP); 1572 if (hwndFocus) { 1573 id = WinQueryWindowUShort(hwndFocus, QWS_ID); 1574 switch (id) { 1575 case CFGC_COMPARE: 1576 case CFGC_DIRCOMPARE: 1577 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 1578 BldQuotedFileName(szfilename, filename); 1579 strcat(szfilename, " %a"); 1580 WinSetDlgItemText(hwnd, id, szfilename); 1581 } 1582 break; 1583 default: 1584 Runtime_Error(pszSrcFile, __LINE__, "bad case %d", id); 1585 break; 1586 } 1587 } 1584 1588 } 1585 1589 break; … … 1601 1605 } 1602 1606 WinQueryDlgItemText(hwnd, CFGC_DIRCOMPARE, MaxComLineStrg, szCLBuf); 1603 1604 1605 1606 1607 1608 1609 1607 szCLBuf[MaxComLineStrg - 1] = 0; 1608 if (strcmp(szCLBuf, dircompare)){ 1609 NormalizeCmdLine(pszWorkBuf, szCLBuf); 1610 memcpy(dircompare, pszWorkBuf, strlen(pszWorkBuf) + 1); 1611 if (!strchr(dircompare, '%') && strlen(dircompare) > 3) 1612 strcat(dircompare, " %a"); 1613 } 1610 1614 PrfWriteProfileString(fmprof, appname, "DirCompare", dircompare); 1611 1615 WinQueryDlgItemText(hwnd, CFGC_COMPARE, MaxComLineStrg, szCLBuf); … … 1626 1630 fCancelAction = FALSE; 1627 1631 WinDlgBox(HWND_DESKTOP, 1628 1629 1630 1631 1632 1632 hwnd, 1633 CfgDlgProc, 1634 FM3ModHandle, 1635 CFG_FRAME, 1636 MPFROMLONG(IDM_COMPARESETTINGS)); 1633 1637 } 1634 1638 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 1651 1655 WinCheckButton(hwnd, CFGD_NOSEARCH, fNoSearch); 1652 1656 WinCheckButton(hwnd, CFGD_EXTENDEDSEL, 1653 1657 ((ulCnrType & CCS_EXTENDSEL) != 0)); 1654 1658 WinCheckButton(hwnd, CFGD_MULTIPLESEL, 1655 1659 ((ulCnrType & CCS_MULTIPLESEL) != 0)); 1656 1660 WinCheckButton(hwnd, CFGD_LEAVETREE, fLeaveTree); 1657 1661 WinCheckButton(hwnd, CFGD_NOFOLDMENU, fNoFoldMenu); … … 1698 1702 case IDM_HELP: 1699 1703 if (hwndHelp) 1700 1701 1704 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1705 MPFROM2SHORT(HELP_CFGD, 0), MPFROMSHORT(HM_RESOURCEID)); 1702 1706 break; 1703 1707 } … … 1711 1715 ulCnrType |= CCS_MULTIPLESEL; 1712 1716 PrfWriteProfileData(fmprof, appname, "ContainerType", 1713 1717 (PVOID) & ulCnrType, sizeof(BOOL)); 1714 1718 fMinOnOpen = WinQueryButtonCheckstate(hwnd, CFGD_MINONOPEN); 1715 1719 PrfWriteProfileData(fmprof, FM3Str, "MinDirOnOpen", &fMinOnOpen, 1716 1720 sizeof(BOOL)); 1717 1721 fLeaveTree = WinQueryButtonCheckstate(hwnd, CFGD_LEAVETREE); 1718 1722 PrfWriteProfileData(fmprof, appname, "LeaveTree", &fLeaveTree, 1719 1723 sizeof(BOOL)); 1720 1724 fNoFoldMenu = WinQueryButtonCheckstate(hwnd, CFGD_NOFOLDMENU); 1721 1725 PrfWriteProfileData(fmprof, appname, "NoFoldMenu", &fNoFoldMenu, 1722 1726 sizeof(BOOL)); 1723 1727 fSelectedAlways = WinQueryButtonCheckstate(hwnd, CFGD_SELECTEDALWAYS); 1724 1728 PrfWriteProfileData(fmprof, appname, "SelectedAlways", &fSelectedAlways, 1725 1729 sizeof(BOOL)); 1726 1730 fNoSearch = WinQueryButtonCheckstate(hwnd, CFGD_NOSEARCH); 1727 1731 PrfWriteProfileData(fmprof, appname, "NoSearch", &fNoSearch, 1728 1732 sizeof(BOOL)); 1729 1733 fLookInDir = WinQueryButtonCheckstate(hwnd, CFGD_LOOKINDIR); 1730 1734 PrfWriteProfileData(fmprof, FM3Str, "LookInDir", (PVOID) & fLookInDir, 1731 1735 sizeof(BOOL)); 1732 1736 fUnHilite = WinQueryButtonCheckstate(hwnd, CFGD_UNHILITE); 1733 1737 PrfWriteProfileData(fmprof, appname, "UnHilite", 1734 1738 &fUnHilite, sizeof(BOOL)); 1735 1739 { 1736 1740 BOOL fOldSyncUpdates = WinQueryButtonCheckstate(hwnd, CFGD_SYNCUPDATES); 1737 1741 1738 1742 if (fOldSyncUpdates != fSyncUpdates) { 1739 1740 1741 1742 1743 1744 // 1745 1746 1747 1743 fSyncUpdates = fOldSyncUpdates; 1744 if (hwndMain && !strcmp(realappname, FM3Str)) { 1745 // Save state and restore to refresh windows with new settings 1746 if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) { 1747 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2)); 1748 // PostMsg(hwndMain, UM_RESTORE, MPVOID, MPVOID); 1749 PostMsg(MainObjectHwnd, UM_RESTORE, GetPString(IDS_FM2TEMPTEXT), MPVOID); 1750 } 1751 } 1748 1752 } 1749 1753 } 1750 1754 PrfWriteProfileData(fmprof, appname, "SyncUpdates", 1751 1755 &fSyncUpdates, sizeof(BOOL)); 1752 1756 if (!(ulCnrType & (CCS_EXTENDSEL | CCS_MULTIPLESEL))) 1753 1757 saymsg(MB_ENTER | MB_ICONEXCLAMATION, 1754 1755 1756 1757 break; 1758 HWND_DESKTOP, 1759 GetPString(IDS_WARNINGTEXT), 1760 GetPString(IDS_SELECTTYPEERRORTEXT)); 1761 break; // WM_CLOSE 1758 1762 } 1759 1763 return WinDefDlgProc(hwnd, msg, mp1, mp2); … … 1834 1838 switch (SHORT1FROMMP(mp1)) { 1835 1839 case CFGM_RECENTDIRS: 1836 1837 1838 1839 1840 1841 1842 1840 sprintf(s, 1841 GetPString(IDS_RECENTHELPWHICHTEXT), 1842 (!oh && th) ? 1843 GetPString(IDS_RECENTONLYTEXT) : 1844 (oh && th) ? 1845 GetPString(IDS_ALLONLYTEXT) : GetPString(IDS_NONE)); 1846 break; 1843 1847 } 1844 1848 if (*s) 1845 1849 WinSetDlgItemText(hwnd, SHORT1FROMMP(mp1), s); 1846 1850 } 1847 1851 return 0; … … 1854 1858 case CFGM_STARTMIN: 1855 1859 if (WinQueryButtonCheckstate(hwnd, CFGM_STARTMIN)) { 1856 1857 1860 WinCheckButton(hwnd, CFGM_STARTMAX, FALSE); 1861 WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMAX), FALSE); 1858 1862 } 1859 1863 else 1860 1864 WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMAX), TRUE); 1861 1865 break; 1862 1866 case CFGM_STARTMAX: 1863 1867 if (WinQueryButtonCheckstate(hwnd, CFGM_STARTMAX)) { 1864 1865 1868 WinCheckButton(hwnd, CFGM_STARTMIN, FALSE); 1869 WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMIN), FALSE); 1866 1870 } 1867 1871 else 1868 1872 WinEnableWindow(WinWindowFromID(hwnd, CFGM_STARTMIN), TRUE); 1869 1873 break; 1870 1874 } … … 1886 1890 case IDM_HELP: 1887 1891 if (hwndHelp) 1888 1889 1892 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 1893 MPFROM2SHORT(HELP_CFGM, 0), MPFROMSHORT(HM_RESOURCEID)); 1890 1894 break; 1891 1895 } … … 1895 1899 if (hwndMain && !strcmp(realappname, FM3Str)) { 1896 1900 if (fFreeTree != WinQueryButtonCheckstate(hwnd, CFGM_FREETREE)) 1897 1901 PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_FREETREE, 0), MPVOID); 1898 1902 if (fAutoTile != WinQueryButtonCheckstate(hwnd, CFGM_AUTOTILE)) 1899 1903 PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_AUTOTILE, 0), MPVOID); 1900 1904 if (fSplitStatus != WinQueryButtonCheckstate(hwnd, CFGM_SPLITSTATUS)) { 1901 1902 1903 1904 1905 fSplitStatus = (fSplitStatus) ? FALSE : TRUE; 1906 PostMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_BLINK, 0), MPVOID); 1907 PrfWriteProfileData(fmprof, FM3Str, "SplitStatus", &fSplitStatus, 1908 sizeof(BOOL)); 1905 1909 } 1906 1910 } 1907 1911 fUserListSwitches = WinQueryButtonCheckstate(hwnd, CFGM_USERLISTSWITCHES); 1908 1912 PrfWriteProfileData(fmprof, FM3Str, "UserListSwitches", 1909 1913 (PVOID) & fUserListSwitches, sizeof(BOOL)); 1910 1914 fExternalINIs = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALINIS); 1911 1915 PrfWriteProfileData(fmprof, FM3Str, "ExternalINIs", 1912 1916 (PVOID) & fExternalINIs, sizeof(BOOL)); 1913 1917 fExternalArcboxes = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALARCBOXES); 1914 1918 PrfWriteProfileData(fmprof, FM3Str, "ExternalArcboxes", 1915 1919 (PVOID) & fExternalArcboxes, sizeof(BOOL)); 1916 1920 fExternalCollector = 1917 1921 WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALCOLLECTOR); 1918 1922 PrfWriteProfileData(fmprof, FM3Str, "ExternalCollector", 1919 1923 (PVOID) & fExternalCollector, sizeof(BOOL)); 1920 1924 fExternalViewer = WinQueryButtonCheckstate(hwnd, CFGM_EXTERNALVIEWER); 1921 1925 PrfWriteProfileData(fmprof, FM3Str, "ExternalViewer", 1922 1926 (PVOID) & fExternalViewer, sizeof(BOOL)); 1923 1927 { 1924 1928 long test; … … 1929 1933 } 1930 1934 PrfWriteProfileData(fmprof, 1931 1932 1935 appname, 1936 "AutoAddDirs", (PVOID) & fAutoAddDirs, sizeof(BOOL)); 1933 1937 PrfWriteProfileData(fmprof, 1934 1935 1936 1938 appname, 1939 "AutoAddAllDirs", 1940 (PVOID) & fAutoAddAllDirs, sizeof(BOOL)); 1937 1941 fwsAnimate = WinQueryButtonCheckstate(hwnd, CFGM_WSANIMATE); 1938 1942 if (fwsAnimate) 1939 1943 fwsAnimate = WS_ANIMATE; 1940 1944 PrfWriteProfileData(fmprof, 1941 1942 1945 appname, 1946 "WS_ANIMATE", (PVOID) & fwsAnimate, sizeof(ULONG)); 1943 1947 fSaveState = WinQueryButtonCheckstate(hwnd, CFGM_SAVESTATE); 1944 1948 PrfWriteProfileData(fmprof, 1945 1946 1949 FM3Str, 1950 "SaveState", (PVOID) & fSaveState, sizeof(BOOL)); 1947 1951 fStartMinimized = WinQueryButtonCheckstate(hwnd, CFGM_STARTMIN); 1948 1952 PrfWriteProfileData(fmprof, 1949 1950 1951 1953 appname, 1954 "StartMinimized", 1955 (PVOID) & fStartMinimized, sizeof(BOOL)); 1952 1956 fStartMaximized = WinQueryButtonCheckstate(hwnd, CFGM_STARTMAX); 1953 1957 PrfWriteProfileData(fmprof, 1954 1955 1956 1958 appname, 1959 "StartMaximized", 1960 (PVOID) & fStartMaximized, sizeof(BOOL)); 1957 1961 fDataMin = WinQueryButtonCheckstate(hwnd, CFGM_DATAMIN); 1958 1962 PrfWriteProfileData(fmprof, 1959 1963 FM3Str, "DataMin", (PVOID) & fDataMin, sizeof(BOOL)); 1960 1964 fTileBackwards = WinQueryButtonCheckstate(hwnd, CFGM_TILEBACKWARDS); 1961 1965 PrfWriteProfileData(fmprof, 1962 1963 1964 1966 FM3Str, 1967 "TileBackwards", 1968 (PVOID) & fTileBackwards, sizeof(BOOL)); 1965 1969 fNoTreeGap = WinQueryButtonCheckstate(hwnd, CFGM_NOTREEGAP); 1966 1970 PrfWriteProfileData(fmprof, 1967 1968 1971 FM3Str, 1972 "NoTreeGap", (PVOID) & fNoTreeGap, sizeof(BOOL)); 1969 1973 fBlueLED = WinQueryButtonCheckstate(hwnd, CFGM_BLUELED); 1970 1974 PrfWriteProfileData(fmprof, 1971 1975 appname, "BlueLED", (PVOID) & fBlueLED, sizeof(BOOL)); 1972 1976 { 1973 1977 BOOL dummy; … … 1975 1979 dummy = WinQueryButtonCheckstate(hwnd, CFGM_SHOWTARGET); 1976 1980 if (dummy != fShowTarget) { 1977 1978 1979 1980 1981 1982 1983 1984 1985 1981 fShowTarget = dummy; 1982 PrfWriteProfileData(fmprof, 1983 appname, 1984 "ShowTarget", 1985 (PVOID) & fShowTarget, sizeof(BOOL)); 1986 if (hwndMain) 1987 PostMsg(WinQueryWindow(hwndMain, QW_PARENT), 1988 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 1989 SetTargetDir(hwnd, TRUE); 1986 1990 } 1987 1991 dummy = WinQueryButtonCheckstate(hwnd, CFGM_SEPARATEPARMS); 1988 1992 if (dummy != fSeparateParms) { 1989 1990 1991 1992 1993 1994 1995 1993 fSeparateParms = dummy; 1994 PrfWriteProfileData(fmprof, 1995 FM3Str, 1996 "SeparateParms", 1997 (PVOID) & fSeparateParms, sizeof(BOOL)); 1998 WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), 1999 UM_UNDO, MPVOID, MPVOID); 1996 2000 } 1997 2001 } … … 2008 2012 case WM_INITDLG: 2009 2013 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETTEXTLIMIT, 2010 2014 MPFROMSHORT(8), MPVOID); 2011 2015 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_OVERRIDESETLIMITS, 2012 2016 MPFROMLONG(1000), MPFROMLONG(50)); 2013 2017 WinSendDlgItemMsg(hwnd, 2014 2015 2018 CFG5_FILTER, 2019 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 2016 2020 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 2017 2021 break; … … 2052 2056 2053 2057 if (!PrfQueryProfileData(fmprof, 2054 2055 2056 2058 appname, 2059 "DirflWindowAttr", &flWindowAttr, &ulSize)) 2060 flWindowAttr = (CV_NAME | CV_MINI | CA_DETAILSVIEWTITLES | CV_FLOW); 2057 2061 if (flWindowAttr & CV_ICON) 2058 2062 WinCheckButton(hwnd, CFG5_ICON, TRUE); 2059 2063 if (flWindowAttr & CV_NAME) 2060 2064 WinCheckButton(hwnd, CFG5_NAME, TRUE); 2061 2065 if (flWindowAttr & CV_TEXT) 2062 2066 WinCheckButton(hwnd, CFG5_TEXT, TRUE); 2063 2067 if (flWindowAttr & CV_DETAIL) 2064 2068 WinCheckButton(hwnd, CFG5_DETAIL, TRUE); 2065 2069 if (flWindowAttr & CV_MINI) 2066 2070 WinCheckButton(hwnd, CFG5_MINIICONS, TRUE); 2067 2071 if (flWindowAttr & CA_DETAILSVIEWTITLES) 2068 2072 WinCheckButton(hwnd, CFG5_SHOWTITLES, TRUE); 2069 2073 WinCheckButton(hwnd, CFG5_SHOWLNAMES, dsDirCnrDefault.detailslongname); 2070 2074 WinCheckButton(hwnd, CFG5_SHOWSUBJECT, dsDirCnrDefault.detailssubject); … … 2081 2085 memset(&mask, 0, sizeof(mask)); 2082 2086 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 2083 2087 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 2084 2088 ulSize = sizeof(MASK); 2085 2089 if (PrfQueryProfileData(fmprof, appname, "DirFilter", &mask, &ulSize)) 2086 2090 SetMask(NULL, &mask); 2087 2091 if (!mask.attrFile) 2088 2089 2092 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 2093 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 2090 2094 strcpy(mask.prompt, GetPString(IDS_DEFDIRFILTERTITLETEXT)); 2091 2095 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 2093 2097 WinCheckButton(hwnd, CFG5_SUBJECTLENGTHMAX, dsDirCnrDefault.fSubjectLengthMax); 2094 2098 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETCURRENTVALUE, 2095 2099 MPFROMLONG(dsDirCnrDefault.SubjectDisplayWidth), MPVOID); 2096 2100 } 2097 2101 return 0; … … 2099 2103 case UM_SETUP5: 2100 2104 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc, 2101 2105 FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) { 2102 2106 SetMask(NULL, &mask); 2103 2107 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 2110 2114 switch (SHORT2FROMMP(mp1)) { 2111 2115 case EN_SETFOCUS: 2112 2113 2114 2116 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 2117 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); 2118 break; 2115 2119 } 2116 2120 break; … … 2133 2137 case IDM_HELP: 2134 2138 if (hwndHelp) 2135 2136 2139 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2140 MPFROM2SHORT(HELP_CFG5, 0), MPFROMSHORT(HM_RESOURCEID)); 2137 2141 break; 2138 2142 } … … 2144 2148 2145 2149 if (WinQueryButtonCheckstate(hwnd, CFG5_ICON)) 2146 2150 flWindowAttr |= CV_ICON; 2147 2151 if (WinQueryButtonCheckstate(hwnd, CFG5_NAME)) 2148 2152 flWindowAttr |= CV_NAME; 2149 2153 if (WinQueryButtonCheckstate(hwnd, CFG5_TEXT)) 2150 2154 flWindowAttr |= CV_TEXT; 2151 2155 if (WinQueryButtonCheckstate(hwnd, CFG5_DETAIL)) 2152 2156 flWindowAttr |= CV_DETAIL; 2153 2157 if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS)) 2154 2158 flWindowAttr |= CV_MINI; 2155 2159 if (WinQueryButtonCheckstate(hwnd, CFG5_SHOWTITLES)) 2156 2160 flWindowAttr |= CA_DETAILSVIEWTITLES; 2157 2161 flWindowAttr |= CV_FLOW; 2158 2162 PrfWriteProfileData(fmprof, 2159 2160 2163 appname, 2164 "DirflWindowAttr", &flWindowAttr, sizeof(ULONG)); 2161 2165 } 2162 2166 dsDirCnrDefault.detailslongname = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLNAMES); 2163 2167 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname", 2164 2168 &dsDirCnrDefault.detailslongname, sizeof(BOOL)); 2165 2169 dsDirCnrDefault.detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT); 2166 2170 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject", 2167 2171 &dsDirCnrDefault.detailssubject, sizeof(BOOL)); 2168 2172 dsDirCnrDefault.detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT); 2169 2173 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA", 2170 2174 &dsDirCnrDefault.detailsea, sizeof(BOOL)); 2171 2175 dsDirCnrDefault.detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE); 2172 2176 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize", 2173 2177 &dsDirCnrDefault.detailssize, sizeof(BOOL)); 2174 2178 dsDirCnrDefault.detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON); 2175 2179 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon", 2176 2180 &dsDirCnrDefault.detailsicon, sizeof(BOOL)); 2177 2181 dsDirCnrDefault.detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE); 2178 2182 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate", 2179 2183 &dsDirCnrDefault.detailslwdate, sizeof(BOOL)); 2180 2184 dsDirCnrDefault.detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME); 2181 2185 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime", 2182 2186 &dsDirCnrDefault.detailslwtime, sizeof(BOOL)); 2183 2187 dsDirCnrDefault.detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE); 2184 2188 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate", 2185 2189 &dsDirCnrDefault.detailsladate, sizeof(BOOL)); 2186 2190 dsDirCnrDefault.detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME); 2187 2191 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime", 2188 2192 &dsDirCnrDefault.detailslatime, sizeof(BOOL)); 2189 2193 dsDirCnrDefault.detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE); 2190 2194 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate", 2191 2195 &dsDirCnrDefault.detailscrdate, sizeof(BOOL)); 2192 2196 dsDirCnrDefault.detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME); 2193 2197 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime", 2194 2198 &dsDirCnrDefault.detailscrtime, sizeof(BOOL)); 2195 2199 dsDirCnrDefault.detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR); 2196 2200 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr", 2197 2201 &dsDirCnrDefault.detailsattr, sizeof(BOOL)); 2198 2202 dsDirCnrDefault.fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE); 2199 2203 PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectInLeftPane", 2200 2204 &dsDirCnrDefault.fSubjectInLeftPane, sizeof(BOOL)); 2201 2205 dsDirCnrDefault.fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX); 2202 2206 PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectLengthMax", 2203 2207 &dsDirCnrDefault.fSubjectLengthMax, sizeof(BOOL)); 2204 2208 *mask.prompt = 0; 2205 2209 PrfWriteProfileData(fmprof, appname, "DirFilter", &mask, sizeof(MASK)); 2206 2210 { 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2211 if (!WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX)) { 2212 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_QUERYVALUE, 2213 MPFROMP(&dsDirCnrDefault.SubjectDisplayWidth), MPFROM2SHORT(0, SPBQ_DONOTUPDATE)); 2214 if (dsDirCnrDefault.SubjectDisplayWidth < 50) 2215 dsDirCnrDefault.SubjectDisplayWidth = 0; 2216 else if (dsDirCnrDefault.SubjectDisplayWidth > 1000) 2217 dsDirCnrDefault.SubjectDisplayWidth = 1000; 2218 } 2219 else 2220 dsDirCnrDefault.SubjectDisplayWidth = 0; 2221 PrfWriteProfileData(fmprof, 2222 appname, "DirCnr.SubjectDisplayWidth", 2223 &dsDirCnrDefault.SubjectDisplayWidth, sizeof(ULONG)); 2220 2224 } 2221 2225 break; … … 2299 2303 case CFG6_SORTDIRSLAST: 2300 2304 { 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2305 BOOL temp; 2306 2307 temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1)); 2308 if (temp) { 2309 switch (SHORT1FROMMP(mp1)) { 2310 case CFG6_SORTDIRSFIRST: 2311 WinCheckButton(hwnd, CFG6_SORTDIRSLAST, FALSE); 2312 break; 2313 case CFG6_SORTDIRSLAST: 2314 WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, FALSE); 2315 break; 2316 } 2317 } 2314 2318 } 2315 2319 break; … … 2332 2336 case IDM_HELP: 2333 2337 if (hwndHelp) 2334 2335 2338 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2339 MPFROM2SHORT(HELP_CFG6, 0), MPFROMSHORT(HM_RESOURCEID)); 2336 2340 break; 2337 2341 } … … 2375 2379 case WM_INITDLG: 2376 2380 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETTEXTLIMIT, 2377 2381 MPFROMSHORT(8), MPVOID); 2378 2382 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_OVERRIDESETLIMITS, 2379 2383 MPFROMLONG(1000), MPFROMLONG(50)); 2380 2384 WinSendDlgItemMsg(hwnd, CFG5_FILTER, EM_SETTEXTLIMIT, 2381 2385 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 2382 2386 PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); 2383 2387 break; … … 2419 2423 2420 2424 if (!PrfQueryProfileData(fmprof, 2421 2422 2423 2425 appname, 2426 "CollectorflWindowAttr", &flWindowAttr, &ulSize)) 2427 flWindowAttr = (CV_NAME | CA_DETAILSVIEWTITLES | CV_MINI | CV_FLOW); 2424 2428 if (flWindowAttr & CV_ICON) 2425 2429 WinCheckButton(hwnd, CFG5_ICON, TRUE); 2426 2430 if (flWindowAttr & CV_NAME) 2427 2431 WinCheckButton(hwnd, CFG5_NAME, TRUE); 2428 2432 if (flWindowAttr & CV_TEXT) 2429 2433 WinCheckButton(hwnd, CFG5_TEXT, TRUE); 2430 2434 if (flWindowAttr & CV_DETAIL) 2431 2435 WinCheckButton(hwnd, CFG5_DETAIL, TRUE); 2432 2436 if (flWindowAttr & CV_MINI) 2433 2437 WinCheckButton(hwnd, CFG5_MINIICONS, TRUE); 2434 2438 if (flWindowAttr & CA_DETAILSVIEWTITLES) 2435 2439 WinCheckButton(hwnd, CFG5_SHOWTITLES, TRUE); 2436 2440 memset(&mask, 0, sizeof(mask)); 2437 2441 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 2438 2442 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 2439 2443 ulSize = sizeof(MASK); 2440 2444 if (PrfQueryProfileData(fmprof, 2441 2442 2445 appname, "CollectorFilter", &mask, &ulSize)) { 2446 SetMask(NULL, &mask); 2443 2447 } 2444 2448 if (!mask.attrFile) 2445 2446 2449 mask.attrFile = FILE_DIRECTORY | FILE_ARCHIVED | FILE_HIDDEN | 2450 FILE_SYSTEM | FILE_NORMAL | FILE_READONLY; 2447 2451 strcpy(mask.prompt, GetPString(IDS_DEFCOLFILTERTITLETEXT)); 2448 2452 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 2468 2472 WinCheckButton(hwnd, CFG5_SUBJECTLENGTHMAX, ds.fSubjectLengthMax); 2469 2473 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETCURRENTVALUE, 2470 2474 MPFROMLONG(ds.SubjectDisplayWidth), MPVOID); 2471 2475 2472 2476 } … … 2475 2479 case UM_SETUP5: 2476 2480 if (WinDlgBox(HWND_DESKTOP, hwndNotebook, PickMaskDlgProc, 2477 2481 FM3ModHandle, MSK_FRAME, MPFROMP(&mask))) { 2478 2482 SetMask(NULL, &mask); 2479 2483 WinSetDlgItemText(hwnd, CFG5_FILTER, mask.szMask); … … 2486 2490 switch (SHORT2FROMMP(mp1)) { 2487 2491 case EN_SETFOCUS: 2488 2489 2490 2492 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 2493 PostMsg(hwnd, UM_SETUP5, MPVOID, MPVOID); 2494 break; 2491 2495 } 2492 2496 break; … … 2509 2513 case IDM_HELP: 2510 2514 if (hwndHelp) 2511 2512 2515 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2516 MPFROM2SHORT(HELP_CFG7, 0), MPFROMSHORT(HM_RESOURCEID)); 2513 2517 break; 2514 2518 } … … 2517 2521 case WM_CLOSE: 2518 2522 fExternalCollector = WinQueryButtonCheckstate(hwnd, 2519 2523 CFG5_EXTERNALCOLLECTOR); 2520 2524 PrfWriteProfileData(fmprof, FM3Str, "ExternalCollector", 2521 2525 &fExternalCollector, sizeof(BOOL)); 2522 2526 { 2523 2527 ULONG flWindowAttr = 0; 2524 2528 2525 2529 if (WinQueryButtonCheckstate(hwnd, CFG5_ICON)) 2526 2530 flWindowAttr |= CV_ICON; 2527 2531 if (WinQueryButtonCheckstate(hwnd, CFG5_NAME)) 2528 2532 flWindowAttr |= CV_NAME; 2529 2533 if (WinQueryButtonCheckstate(hwnd, CFG5_TEXT)) 2530 2534 flWindowAttr |= CV_TEXT; 2531 2535 if (WinQueryButtonCheckstate(hwnd, CFG5_DETAIL)) 2532 2536 flWindowAttr |= CV_DETAIL; 2533 2537 if (WinQueryButtonCheckstate(hwnd, CFG5_MINIICONS)) 2534 2538 flWindowAttr |= CV_MINI; 2535 2539 if (WinQueryButtonCheckstate(hwnd, CFG5_SHOWTITLES)) 2536 2540 flWindowAttr |= CA_DETAILSVIEWTITLES; 2537 2541 flWindowAttr |= CV_FLOW; 2538 2542 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 2539 2543 &flWindowAttr, sizeof(ULONG)); 2540 2544 } 2541 2545 { … … 2545 2549 ds.detailslongname = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLNAMES); 2546 2550 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLongname", 2547 2551 &ds.detailslongname, sizeof(BOOL)); 2548 2552 ds.detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT); 2549 2553 PrfWriteProfileData(fmprof, appname, "Collector.DetailsSubject", 2550 2554 &ds.detailssubject, sizeof(BOOL)); 2551 2555 ds.detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWEAS); 2552 2556 PrfWriteProfileData(fmprof, appname, "Collector.DetailsEA", 2553 2557 &ds.detailsea, sizeof(BOOL)); 2554 2558 ds.detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE); 2555 2559 PrfWriteProfileData(fmprof, appname, "Collector.DetailsSize", 2556 2560 &ds.detailssize, sizeof(BOOL)); 2557 2561 ds.detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON); 2558 2562 PrfWriteProfileData(fmprof, appname, "Collector.DetailsIcon", 2559 2563 &ds.detailsicon, sizeof(BOOL)); 2560 2564 ds.detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE); 2561 2565 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLWDate", 2562 2566 &ds.detailslwdate, sizeof(BOOL)); 2563 2567 ds.detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME); 2564 2568 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLWTime", 2565 2569 &ds.detailslwtime, sizeof(BOOL)); 2566 2570 ds.detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE); 2567 2571 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLADate", 2568 2572 &ds.detailsladate, sizeof(BOOL)); 2569 2573 ds.detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME); 2570 2574 PrfWriteProfileData(fmprof, appname, "Collector.DetailsLATime", 2571 2575 &ds.detailslatime, sizeof(BOOL)); 2572 2576 ds.detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE); 2573 2577 PrfWriteProfileData(fmprof, appname, "Collector.DetailsCRDate", 2574 2578 &ds.detailscrdate, sizeof(BOOL)); 2575 2579 ds.detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME); 2576 2580 PrfWriteProfileData(fmprof, appname, "Collector.DetailsCRTime", 2577 2581 &ds.detailscrtime, sizeof(BOOL)); 2578 2582 ds.detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR); 2579 2583 PrfWriteProfileData(fmprof, appname, "Collector.DetailsAttr", 2580 2584 &ds.detailsattr, sizeof(BOOL)); 2581 2585 ds.fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE); 2582 2586 PrfWriteProfileData(fmprof, appname, "Collector.SubjectInLeftPane", 2583 2587 &ds.fSubjectInLeftPane, sizeof(BOOL)); 2584 2588 ds.fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX); 2585 2589 PrfWriteProfileData(fmprof, appname, "Collector.SubjectLengthMax", 2586 2590 &ds.fSubjectLengthMax, sizeof(BOOL)); 2587 2591 *mask.prompt = 0; 2588 2592 PrfWriteProfileData(fmprof, 2589 2593 appname, "CollectorFilter", &mask, sizeof(MASK)); 2590 2594 { 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2595 if (!WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX)) { 2596 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_QUERYVALUE, 2597 MPFROMP(&ds.SubjectDisplayWidth), MPFROM2SHORT(0, SPBQ_DONOTUPDATE)); 2598 if (ds.SubjectDisplayWidth < 50) 2599 ds.SubjectDisplayWidth = 0; 2600 else if (ds.SubjectDisplayWidth > 1000) 2601 ds.SubjectDisplayWidth = 1000; 2602 } 2603 else 2604 ds.SubjectDisplayWidth = 0; 2605 PrfWriteProfileData(fmprof, 2606 appname, "Collector.SubjectDisplayWidth", 2607 &ds.SubjectDisplayWidth, sizeof(ULONG)); 2604 2608 } 2605 2609 } … … 2684 2688 case CFG6_SORTDIRSLAST: 2685 2689 { 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2690 BOOL temp; 2691 2692 temp = WinQueryButtonCheckstate(hwnd, SHORT1FROMMP(mp1)); 2693 if (temp) { 2694 switch (SHORT1FROMMP(mp1)) { 2695 case CFG6_SORTDIRSFIRST: 2696 WinCheckButton(hwnd, CFG6_SORTDIRSLAST, FALSE); 2697 break; 2698 case CFG6_SORTDIRSLAST: 2699 WinCheckButton(hwnd, CFG6_SORTDIRSFIRST, FALSE); 2700 break; 2701 } 2702 } 2699 2703 } 2700 2704 break; … … 2717 2721 case IDM_HELP: 2718 2722 if (hwndHelp) 2719 2720 2723 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2724 MPFROM2SHORT(HELP_CFG8, 0), MPFROMSHORT(HM_RESOURCEID)); 2721 2725 break; 2722 2726 } … … 2748 2752 CollectorsortFlags |= SORT_REVERSE; 2749 2753 PrfWriteProfileData(fmprof, 2750 2751 2754 appname, 2755 "CollectorSort", &CollectorsortFlags, sizeof(INT)); 2752 2756 break; 2753 2757 } … … 2790 2794 case IDM_HELP: 2791 2795 if (hwndHelp) 2792 2793 2796 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 2797 MPFROM2SHORT(HELP_CFG9, 0), MPFROMSHORT(HM_RESOURCEID)); 2794 2798 return 0; 2795 2799 case CFG9_MAXIMUMUI: 2796 2800 if (hwndMain) { 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2801 if (MenuInvisible) 2802 WinSendMsg(hwndMain, WM_COMMAND, 2803 MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 2804 if (!fAutoView) 2805 WinSendMsg(hwndMain, WM_COMMAND, 2806 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 2807 if (!fDrivebar) 2808 WinSendMsg(hwndMain, WM_COMMAND, 2809 MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID); 2810 if (!fToolbar) 2811 WinSendMsg(hwndMain, WM_COMMAND, 2812 MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 2813 if (!fMoreButtons) 2814 WinSendMsg(hwndMain, WM_COMMAND, 2815 MPFROM2SHORT(IDM_MOREBUTTONS, 0), MPVOID); 2816 if (!fUserComboBox) 2817 WinSendMsg(hwndMain, WM_COMMAND, 2818 MPFROM2SHORT(IDM_USERLIST, 0), MPVOID); 2815 2819 } 2816 2820 return 0; 2817 2821 case CFG9_MINIMUMUI: 2818 2822 if (hwndMain) { 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2823 if (!MenuInvisible) 2824 WinSendMsg(hwndMain, WM_COMMAND, 2825 MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 2826 if (fAutoView) 2827 WinSendMsg(hwndMain, WM_COMMAND, 2828 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 2829 if (fToolbar) 2830 WinSendMsg(hwndMain, WM_COMMAND, 2831 MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 2832 if (fMoreButtons) 2833 WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_MOREBUTTONS, 0), 2834 MPVOID); 2835 if (fUserComboBox) 2836 WinSendMsg(hwndMain, WM_COMMAND, 2837 MPFROM2SHORT(IDM_USERLIST, 0), MPVOID); 2838 saymsg(MB_ENTER | MB_ICONASTERISK, 2839 hwnd, 2840 GetPString(IDS_DONTFORGETTEXT), 2841 GetPString(IDS_UNHIDEMENUWARNTEXT)); 2838 2842 } 2839 2843 return 0; … … 2849 2853 fDragndropDlg = TRUE; 2850 2854 { 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2855 ULONG flWindowAttr; 2856 2857 flWindowAttr = CV_DETAIL | CV_FLOW | CA_DETAILSVIEWTITLES; 2858 PrfWriteProfileData(fmprof, 2859 appname, 2860 "DirflWindowAttr", &flWindowAttr, sizeof(ULONG)); 2861 PrfWriteProfileData(fmprof, 2862 appname, 2863 "CollectorflWindowAttr", 2864 &flWindowAttr, sizeof(ULONG)); 2865 PrfWriteProfileData(fmprof, 2866 appname, "Collector.Fontnamesize", NULL, 0); 2863 2867 } 2864 2868 dsDirCnrDefault.detailslongname = TRUE; … … 2876 2880 if (hwndTree) { 2877 2881 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2882 CNRINFO cnri; 2883 ULONG flWindowAttr = CV_TREE | CV_ICON | CV_FLOW | CA_TREELINE; 2884 2885 memset(&cnri, 0, sizeof(cnri)); 2886 cnri.cb = sizeof(cnri); 2887 WinSendMsg(WinWindowFromID 2888 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 2889 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 2890 cnri.flWindowAttr = flWindowAttr; 2891 WinSendMsg(WinWindowFromID 2892 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 2893 CM_SETCNRINFO, MPFROMP(&cnri), 2894 MPFROMLONG(CMA_FLWINDOWATTR)); 2891 2895 } 2892 2896 break; … … 2903 2907 fDragndropDlg = TRUE; 2904 2908 { 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2909 ULONG flWindowAttr; 2910 2911 flWindowAttr = CV_DETAIL | CV_FLOW | CV_MINI; 2912 PrfWriteProfileData(fmprof, 2913 appname, 2914 "DirflWindowAttr", &flWindowAttr, sizeof(ULONG)); 2915 PrfWriteProfileData(fmprof, 2916 appname, 2917 "CollectorflWindowAttr", 2918 &flWindowAttr, sizeof(ULONG)); 2919 PrfWriteProfileData(fmprof, 2920 appname, 2921 "Collector.Fontnamesize", 2922 GetPString(IDS_8HELVTEXT), 2923 strlen(GetPString(IDS_8HELVTEXT)) + 1); 2920 2924 } 2921 2925 dsDirCnrDefault.detailslongname = TRUE; … … 2933 2937 if (hwndTree) { 2934 2938 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2939 CNRINFO cnri; 2940 ULONG flWindowAttr = CV_TREE | CV_MINI | CV_TEXT | 2941 CV_FLOW | CA_TREELINE; 2942 2943 memset(&cnri, 0, sizeof(cnri)); 2944 cnri.cb = sizeof(cnri); 2945 WinSendMsg(WinWindowFromID 2946 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 2947 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 2948 cnri.flWindowAttr = flWindowAttr; 2949 WinSendMsg(WinWindowFromID 2950 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 2951 CM_SETCNRINFO, MPFROMP(&cnri), 2952 MPFROMLONG(CMA_FLWINDOWATTR)); 2949 2953 } 2950 2954 break; 2951 2955 case CFG9_MAXFILENAMES: 2952 2956 if (hwndMain && fAutoView) 2953 2954 2957 WinSendMsg(hwndMain, WM_COMMAND, 2958 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 2955 2959 fForceUpper = FALSE; 2956 2960 fForceLower = TRUE; … … 2964 2968 fNoIconsDirs = TRUE; 2965 2969 { 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2970 ULONG flWindowAttr; 2971 2972 flWindowAttr = CV_TEXT | CV_FLOW; 2973 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 2974 &flWindowAttr, sizeof(ULONG)); 2975 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 2976 &flWindowAttr, sizeof(ULONG)); 2977 PrfWriteProfileData(fmprof, appname, "Collector.Fontnamesize", 2978 GetPString(IDS_8HELVTEXT), 2979 strlen(GetPString(IDS_8HELVTEXT)) + 1); 2976 2980 } 2977 2981 if (hwndTree) { 2978 2982 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2983 CNRINFO cnri; 2984 ULONG flWindowAttr = CV_TREE | CV_TEXT | CV_FLOW | CA_TREELINE; 2985 2986 memset(&cnri, 0, sizeof(cnri)); 2987 cnri.cb = sizeof(cnri); 2988 WinSendMsg(WinWindowFromID 2989 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 2990 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 2991 cnri.flWindowAttr = flWindowAttr; 2992 WinSendMsg(WinWindowFromID 2993 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 2994 CM_SETCNRINFO, MPFROMP(&cnri), 2995 MPFROMLONG(CMA_FLWINDOWATTR)); 2992 2996 } 2993 2997 break; … … 3059 3063 fNoTreeGap = TRUE; 3060 3064 { 3061 3062 3063 3064 3065 3066 3067 3065 ULONG flWindowAttr; 3066 3067 flWindowAttr = (CV_NAME | CV_MINI | CV_FLOW | CA_DETAILSVIEWTITLES); 3068 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3069 &flWindowAttr, sizeof(ULONG)); 3070 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3071 &flWindowAttr, sizeof(ULONG)); 3068 3072 } 3069 3073 dsDirCnrDefault.detailslongname = FALSE; … … 3083 3087 if (hwndMain) { 3084 3088 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3089 SWP swp; 3090 3091 if (WinQueryWindowPos(hwndMain, &swp)) { 3092 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 3093 swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE); 3094 } 3095 if (MenuInvisible) 3096 WinSendMsg(hwndMain, WM_COMMAND, 3097 MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 3098 if (fAutoView) 3099 WinSendMsg(hwndMain, WM_COMMAND, 3100 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 3101 if (fToolbar) 3102 WinSendMsg(hwndMain, WM_COMMAND, 3103 MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 3104 if (!fDrivebar) 3105 WinSendMsg(hwndMain, WM_COMMAND, 3106 MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID); 3107 if (!fMoreButtons) 3108 WinSendMsg(hwndMain, WM_COMMAND, MPFROM2SHORT(IDM_MOREBUTTONS, 0), 3109 MPVOID); 3110 if (!fUserComboBox) 3111 WinSendMsg(hwndMain, WM_COMMAND, 3112 MPFROM2SHORT(IDM_USERLIST, 0), MPVOID); 3109 3113 } 3110 3114 if (hwndTree) { 3111 3115 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3116 CNRINFO cnri; 3117 ULONG flWindowAttr = (CV_TREE | CV_TEXT | CV_MINI | 3118 CV_FLOW | CA_TREELINE); 3119 3120 memset(&cnri, 0, sizeof(cnri)); 3121 cnri.cb = sizeof(cnri); 3122 WinSendMsg(WinWindowFromID 3123 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3124 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3125 cnri.flWindowAttr = flWindowAttr; 3126 WinSendMsg(WinWindowFromID 3127 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3128 CM_SETCNRINFO, MPFROMP(&cnri), 3129 MPFROMLONG(CMA_FLWINDOWATTR)); 3126 3130 } 3127 3131 break; … … 3176 3180 fNoTreeGap = FALSE; 3177 3181 { 3178 3179 3180 3181 3182 3183 3184 3182 ULONG flWindowAttr; 3183 3184 flWindowAttr = (CV_NAME | CV_MINI | CV_FLOW | CA_DETAILSVIEWTITLES); 3185 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3186 &flWindowAttr, sizeof(ULONG)); 3187 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3188 &flWindowAttr, sizeof(ULONG)); 3185 3189 } 3186 3190 dsDirCnrDefault.detailslongname = FALSE; … … 3200 3204 if (hwndMain) { 3201 3205 3202 3203 3204 3205 3206 3207 3208 3209 3210 3206 SWP swp; 3207 3208 if (WinQueryWindowPos(hwndMain, &swp)) { 3209 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 3210 swp.cx / 5, 3211 swp.cy - 3212 (WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2), 3213 SWP_MOVE | SWP_SIZE); 3214 } 3211 3215 } 3212 3216 if (hwndTree) { 3213 3217 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3218 CNRINFO cnri; 3219 ULONG flWindowAttr = (CV_TREE | CV_TEXT | 3220 CV_FLOW | CA_TREELINE | CV_MINI); 3221 3222 memset(&cnri, 0, sizeof(cnri)); 3223 cnri.cb = sizeof(cnri); 3224 WinSendMsg(WinWindowFromID 3225 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3226 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3227 cnri.flWindowAttr = flWindowAttr; 3228 WinSendMsg(WinWindowFromID 3229 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3230 CM_SETCNRINFO, MPFROMP(&cnri), 3231 MPFROMLONG(CMA_FLWINDOWATTR)); 3228 3232 } 3229 3233 break; … … 3240 3244 fDCOpens = FALSE; 3241 3245 { 3242 3243 3244 3245 3246 3247 3248 3246 ULONG flWindowAttr; 3247 3248 flWindowAttr = CV_NAME | CV_FLOW | CA_DETAILSVIEWTITLES; 3249 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3250 &flWindowAttr, sizeof(ULONG)); 3251 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3252 &flWindowAttr, sizeof(ULONG)); 3249 3253 } 3250 3254 fLinkSetsIcon = FALSE; … … 3257 3261 fUserListSwitches = TRUE; 3258 3262 WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), UM_UNDO, MPVOID, 3259 3263 MPVOID); 3260 3264 if (hwndTree) { 3261 3265 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3266 CNRINFO cnri; 3267 ULONG flWindowAttr = CV_TREE | CV_MINI | CV_ICON | 3268 CV_FLOW | CA_TREELINE; 3269 3270 memset(&cnri, 0, sizeof(cnri)); 3271 cnri.cb = sizeof(cnri); 3272 WinSendMsg(WinWindowFromID 3273 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3274 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3275 cnri.flWindowAttr = flWindowAttr; 3276 WinSendMsg(WinWindowFromID 3277 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3278 CM_SETCNRINFO, MPFROMP(&cnri), 3279 MPFROMLONG(CMA_FLWINDOWATTR)); 3276 3280 } 3277 3281 if (hwndMain) { 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3282 if (fAutoView) 3283 WinSendMsg(hwndMain, WM_COMMAND, 3284 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 3285 if (!fDrivebar) 3286 WinSendMsg(hwndMain, WM_COMMAND, 3287 MPFROM2SHORT(IDM_DRIVEBAR, 0), MPVOID); 3288 { 3289 SWP swp; 3290 3291 if (WinQueryWindowPos(hwndMain, &swp)) { 3292 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 3293 swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE); 3294 } 3295 } 3296 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2L)); 3297 PostMsg(MainObjectHwnd, UM_SETDIR, MPFROMLONG(1L), MPVOID); 3294 3298 } 3295 3299 return 0; … … 3305 3309 fTopDir = FALSE; 3306 3310 if (hwndMain) { 3307 3308 3309 3311 if (!fTextTools) 3312 WinSendMsg(hwndMain, WM_COMMAND, 3313 MPFROM2SHORT(IDM_TEXTTOOLS, 0), MPVOID); 3310 3314 } 3311 3315 { 3312 3313 3314 3315 3316 3317 3318 3316 ULONG flWindowAttr; 3317 3318 flWindowAttr = CV_TEXT | CV_FLOW | CA_DETAILSVIEWTITLES; 3319 PrfWriteProfileData(fmprof, appname, "DirflWindowAttr", 3320 &flWindowAttr, sizeof(ULONG)); 3321 PrfWriteProfileData(fmprof, appname, "CollectorflWindowAttr", 3322 &flWindowAttr, sizeof(ULONG)); 3319 3323 } 3320 3324 if (hwndTree) { 3321 3325 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3326 CNRINFO cnri; 3327 ULONG flWindowAttr = CV_TREE | CV_TEXT | CV_FLOW | CA_TREELINE; 3328 3329 memset(&cnri, 0, sizeof(cnri)); 3330 cnri.cb = sizeof(cnri); 3331 WinSendMsg(WinWindowFromID 3332 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3333 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3334 cnri.flWindowAttr = flWindowAttr; 3335 WinSendMsg(WinWindowFromID 3336 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 3337 CM_SETCNRINFO, MPFROMP(&cnri), 3338 MPFROMLONG(CMA_FLWINDOWATTR)); 3335 3339 } 3336 3340 /* intentional fallthru */ 3337 3341 case CFG9_1X: 3338 3342 if (SHORT1FROMMP(mp1) == CFG9_1X) { 3339 3340 3341 3342 3343 3344 3345 3346 3343 fTileBackwards = FALSE; 3344 ulCnrType = CCS_MULTIPLESEL | CCS_EXTENDSEL; 3345 fSwitchTree = FALSE; 3346 fSwitchTreeOnFocus = FALSE; 3347 fSwitchTreeExpand = FALSE; 3348 fCollapseFirst = FALSE; 3349 fFollowTree = FALSE; 3350 fNoSearch = TRUE; 3347 3351 } 3348 3352 fAutoTile = TRUE; … … 3358 3362 fUserListSwitches = TRUE; 3359 3363 WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), UM_UNDO, MPVOID, 3360 3364 MPVOID); 3361 3365 if (hwndTree) { 3362 3366 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3367 CNRINFO cnri; 3368 ULONG flWindowAttr = CV_TREE | CV_ICON | CV_FLOW | CA_TREELINE; 3369 3370 memset(&cnri, 0, sizeof(cnri)); 3371 cnri.cb = sizeof(cnri); 3372 WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, FID_CLIENT), 3373 TREE_CNR), 3374 CM_QUERYCNRINFO, MPFROMP(&cnri), MPFROMLONG(sizeof(cnri))); 3375 cnri.flWindowAttr = flWindowAttr; 3376 WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, FID_CLIENT), 3377 TREE_CNR), 3378 CM_SETCNRINFO, 3379 MPFROMP(&cnri), MPFROMLONG(CMA_FLWINDOWATTR)); 3376 3380 } 3377 3381 if (hwndMain) { 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3382 if (fAutoView) 3383 WinSendMsg(hwndMain, WM_COMMAND, 3384 MPFROM2SHORT(IDM_AUTOVIEW, 0), MPVOID); 3385 if (fUserComboBox) 3386 WinSendMsg(hwndMain, WM_COMMAND, 3387 MPFROM2SHORT(IDM_USERLIST, 0), MPVOID); 3388 { 3389 SWP swp; 3390 3391 if (WinQueryWindowPos(hwndMain, &swp)) { 3392 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 3393 swp.cx / 5, swp.cy, SWP_MOVE | SWP_SIZE); 3394 } 3395 } 3396 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2L)); 3397 PostMsg(MainObjectHwnd, UM_SETDIR, MPVOID, MPVOID); 3394 3398 } 3395 3399 return 0; … … 3407 3411 // Save new details settings and refresh windows 3408 3412 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname", 3409 3413 &dsDirCnrDefault.detailslongname, sizeof(BOOL)); 3410 3414 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject", 3411 3415 &dsDirCnrDefault.detailssubject, sizeof(BOOL)); 3412 3416 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA", 3413 3417 &dsDirCnrDefault.detailsea, sizeof(BOOL)); 3414 3418 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize", 3415 3419 &dsDirCnrDefault.detailssize, sizeof(BOOL)); 3416 3420 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon", 3417 3421 &dsDirCnrDefault.detailsicon, sizeof(BOOL)); 3418 3422 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate", 3419 3423 &dsDirCnrDefault.detailslwdate, sizeof(BOOL)); 3420 3424 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime", 3421 3425 &dsDirCnrDefault.detailslwtime, sizeof(BOOL)); 3422 3426 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate", 3423 3427 &dsDirCnrDefault.detailsladate, sizeof(BOOL)); 3424 3428 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime", 3425 3429 &dsDirCnrDefault.detailslatime, sizeof(BOOL)); 3426 3430 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate", 3427 3431 &dsDirCnrDefault.detailscrdate, sizeof(BOOL)); 3428 3432 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime", 3429 3433 &dsDirCnrDefault.detailscrtime, sizeof(BOOL)); 3430 3434 PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr", 3431 3435 &dsDirCnrDefault.detailsattr, sizeof(BOOL)); 3432 3436 if (hwndMain) { 3433 3437 // Save state and restore to refresh windows with new settings 3434 3438 if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) { 3435 3436 3437 3438 3439 // Tell window procedure to close container windows 3440 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2)); 3441 // Restore saved state 3442 PostMsg(MainObjectHwnd, UM_RESTORE, GetPString(IDS_FM2TEMPTEXT), MPVOID); 3439 3443 } 3440 3444 } 3441 3445 WinSendMsg((HWND) WinQueryWindowULong(hwnd, QWL_USER), 3442 3446 UM_UNDO, MPVOID, MPVOID); 3443 3447 return 0; 3444 3448 … … 3475 3479 { IDM_BUBBLESSETTINGS, CFGB_FRAME, IDS_NOTEBUBBLE1TEXT, CfgBDlgProc, 0, 0, 0 }, 3476 3480 { IDM_QUICKSETTINGS, CFG9_FRAME, IDS_NOTEQUICK1TEXT, Cfg9DlgProc, 0, 0, 0 }, 3477 { 0, 0, 0, NULL, 0, 0, 0 } 3481 { 0, 0, 0, NULL, 0, 0, 0 } // usFrameId 0 is end marker 3478 3482 }; 3479 3483 … … 3513 3517 hwndTemp = WinQueryWindow(hwnd, QW_OWNER); 3514 3518 if (hwndTemp != HWND_DESKTOP) { 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3519 HWND hwndMenu; 3520 // Owner is frame if not applet 3521 hwndMenu = WinWindowFromID(hwndTemp, FID_MENU); 3522 if (hwndMenu == NULLHANDLE) 3523 Runtime_Error(pszSrcFile, __LINE__, "FID_MENU"); 3524 else { 3525 MENUITEM mi; 3526 BOOL ok; 3527 memset(&mi, 0, sizeof(mi)); 3528 ok = (BOOL)WinSendMsg(hwndMenu, 3529 MM_QUERYITEM, 3530 MPFROM2SHORT(IDM_NOTEBOOKSUBMENU, TRUE), 3531 MPFROMP(&mi)); 3532 if (!ok) 3533 Runtime_Error(pszSrcFile, __LINE__, "IDM_NOTEBOOKSUBMENU"); 3534 else { 3535 mp2 = WinSendMsg(mi.hwndSubMenu, MM_QUERYDEFAULTITEMID, MPVOID, MPVOID); 3536 if (!mp2) 3537 Runtime_Error(pszSrcFile, __LINE__, "MM_QUERYDEFAULTITEMID"); 3538 } 3539 } 3536 3540 } 3537 3541 } … … 3539 3543 PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID); 3540 3544 WinSendDlgItemMsg(hwnd, 3541 3542 3543 3545 CFG_NOTEBOOK, 3546 BKM_SETDIMENSIONS, 3547 MPFROM2SHORT(82, 24), MPFROMLONG(BKA_MAJORTAB)); 3544 3548 WinSendDlgItemMsg(hwnd, 3545 3546 3547 3549 CFG_NOTEBOOK, 3550 BKM_SETDIMENSIONS, 3551 MPFROM2SHORT(20, 20), MPFROMLONG(BKA_PAGEBUTTON)); 3548 3552 WinSendDlgItemMsg(hwnd, 3549 3550 3551 3553 CFG_NOTEBOOK, 3554 BKM_SETDIMENSIONS, 3555 MPFROM2SHORT(0, 0), MPFROMLONG(BKA_MINORTAB)); 3552 3556 3553 3557 // Build and insert notebook pages 3554 3558 for (x = 0; np[x].usFrameId; x++) { 3555 3559 hwndTemp = WinLoadDlg(HWND_DESKTOP, 3556 3557 3560 HWND_DESKTOP, 3561 np[x].pfnPageProc, FM3ModHandle, np[x].usFrameId, MPVOID); 3558 3562 if (!hwndTemp) { 3559 3560 3563 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, 3564 "Can not load settings page %u", x); 3561 3565 } 3562 3566 else { 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 uPageIndex = x;// Remember selected page3567 WinSetWindowULong(hwndTemp, QWL_USER, (ULONG)hwnd); 3568 np[x].hwnd = hwndTemp; 3569 np[x].ulPageId = (ULONG)WinSendDlgItemMsg(hwnd, 3570 CFG_NOTEBOOK, 3571 BKM_INSERTPAGE, 3572 MPFROMLONG(BKA_FIRST), 3573 MPFROM2SHORT(BKA_AUTOPAGESIZE | 3574 BKA_STATUSTEXTON | 3575 BKA_MAJOR, attrib)); 3576 attrib = BKA_LAST; 3577 WinSendDlgItemMsg(hwnd, 3578 CFG_NOTEBOOK, 3579 BKM_SETPAGEWINDOWHWND, 3580 MPFROMLONG(np[x].ulPageId), MPFROMLONG(np[x].hwnd)); 3581 WinSendDlgItemMsg(hwnd, 3582 CFG_NOTEBOOK, 3583 BKM_SETTABTEXT, 3584 MPFROMLONG(np[x].ulPageId), 3585 MPFROMP(GetPString(np[x].ulTitle))); 3586 WinSendDlgItemMsg(hwnd, 3587 CFG_NOTEBOOK, 3588 BKM_SETSTATUSLINETEXT, 3589 MPFROMLONG(np[x].ulPageId), 3590 MPFROMP(GetPString(np[x].ulTitle + 1))); 3591 3592 if (LONGFROMMP(mp2) == np[x].usMenuId) 3593 uPageIndex = x; // Remember selected page 3590 3594 } 3591 3595 } // for pages … … 3596 3600 // 15 Feb 08 SHL fixme to do just once? 3597 3601 if (mp2 == MPFROMLONG(IDM_QUICKSETTINGS) && 3598 3599 3600 3602 x-- > 0 && 3603 np[x].hwnd && 3604 np[x].usFrameId == CFG9_FRAME) 3601 3605 { 3602 3606 // 10 Jan 08 SHL fixme to document what UM_SETDIR 1 means 3603 3607 //PostMsg(MainObjectHwnd, UM_SETDIR, MPFROMLONG(1), MPVOID); 3604 3608 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3605 3609 BKM_TURNTOPAGE, MPFROMLONG(np[x].ulPageId), MPVOID); 3606 3610 PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(np[x].hwnd), MPVOID); 3607 3611 PostMsg(np[x].hwnd, WM_COMMAND, MPFROM2SHORT(IDM_HELP, 0), MPVOID); … … 3609 3613 else if (uPageIndex >= x) { 3610 3614 Runtime_Error(pszSrcFile, __LINE__, "uPageIndex corrupted (%u)", 3611 3615 uPageIndex); 3612 3616 uPageIndex = 0; 3613 3617 } 3614 3618 PostMsg(WinWindowFromID(hwnd, CFG_NOTEBOOK), 3615 3619 BKM_TURNTOPAGE, MPFROMLONG(np[uPageIndex].ulPageId), MPVOID); 3616 3620 // 15 Feb 08 SHL fixme to put focus on first field of page 3617 3621 … … 3664 3668 SaveLastPageIndex(hwnd); 3665 3669 ulPageId = (ULONG) WinSendDlgItemMsg(hwnd, 3666 3667 3668 3669 3670 CFG_NOTEBOOK, 3671 BKM_QUERYPAGEID, 3672 MPFROMLONG(0), 3673 MPFROM2SHORT(BKA_TOP, 0)); 3670 3674 hwndTemp = (HWND) WinSendDlgItemMsg(hwnd, 3671 3672 3673 3675 CFG_NOTEBOOK, 3676 BKM_QUERYPAGEWINDOWHWND, 3677 MPFROMLONG(ulPageId), MPVOID); 3674 3678 if (hwndTemp) 3675 3679 WinSendMsg(hwndTemp, UM_UNDO, MPVOID, MPVOID); 3676 3680 3677 3681 WinDismissDlg(hwnd, 0); 3678 3682 break; 3679 3683 3680 case IDM_HELP: 3684 case IDM_HELP: /* relay message to appropriate page's window */ 3681 3685 ulPageId = (ULONG) WinSendDlgItemMsg(hwnd, 3682 3683 3684 3685 3686 CFG_NOTEBOOK, 3687 BKM_QUERYPAGEID, 3688 MPFROMLONG(0), 3689 MPFROM2SHORT(BKA_TOP, 0)); 3686 3690 hwndTemp = (HWND) WinSendDlgItemMsg(hwnd, 3687 3688 3689 3691 CFG_NOTEBOOK, 3692 BKM_QUERYPAGEWINDOWHWND, 3693 MPFROMLONG(ulPageId), MPVOID); 3690 3694 if (hwndTemp) 3691 3695 PostMsg(hwndTemp, WM_COMMAND, MPFROM2SHORT(IDM_HELP, 0), MPVOID); 3692 3696 break; 3693 3697 } … … 3697 3701 for (x = 0; np[x].usFrameId; x++) { 3698 3702 if (np[x].hwnd) 3699 3703 WinSendMsg(np[x].hwnd, UM_UNDO, MPVOID, MPVOID); 3700 3704 } 3701 3705 break; … … 3704 3708 if (np[0].usFrameId) { 3705 3709 for (x = 1; np[x].usFrameId; x++) { 3706 3707 3708 3709 3710 3710 if (np[x].hwnd) { 3711 WinSendMsg(np[x].hwnd, WM_CLOSE, MPVOID, MPVOID); 3712 np[x].hwnd = (HWND) 0; 3713 np[x].ulPageId = 0; 3714 } 3711 3715 } 3712 3716 WinSendMsg(np[0].hwnd, WM_CLOSE, MPVOID, MPVOID); … … 3735 3739 PrfQueryProfileData(fmprof, appname, pszIK_LastSettingsPage, &uPageIndex, &ulSize); 3736 3740 for (x = 0; x < uPageIndex && np[x].usFrameId; x++) 3737 ; 3741 ; // Search 3738 3742 if (np[x].usMenuId) 3739 3743 SetConditionalCascade(hwndMenu, IDM_NOTEBOOKSUBMENU, np[uPageIndex].usMenuId); … … 3741 3745 if (fIsLite) { 3742 3746 WinSendMsg(hwndMenu, 3743 3744 3747 MM_DELETEITEM, 3748 MPFROM2SHORT(IDM_QUICKSETTINGS, FALSE), MPVOID); 3745 3749 // If fm/2 lite drop quick setting page 3746 3750 for (x = 0; np[x].usFrameId && np[x].usFrameId != CFG9_FRAME; x++) … … 3761 3765 if (hwndOwner != HWND_DESKTOP) { 3762 3766 ulPageId = (ULONG)WinSendDlgItemMsg(hwnd, 3763 3764 3765 3766 3767 CFG_NOTEBOOK, 3768 BKM_QUERYPAGEID, 3769 MPFROMLONG(0), 3770 MPFROM2SHORT(BKA_TOP, 0)); 3767 3771 if (!ulPageId) 3768 3772 Runtime_Error(pszSrcFile, __LINE__, "BKM_QUERYPAGEID"); 3769 3773 else { 3770 3774 for (x = 0; np[x].usMenuId && np[x].ulPageId != ulPageId; x++) 3771 3775 ; // Scan 3772 3776 if (!np[x].usMenuId) 3773 3777 Runtime_Error(pszSrcFile, __LINE__, "bad menu id %lu", ulPageId); 3774 3778 else { 3775 3776 3777 3778 3779 PrfWriteProfileData(fmprof, FM3Str, pszIK_LastSettingsPage, 3780 (PVOID)&x, sizeof(x)); 3781 hwndMenu = WinWindowFromID(hwndOwner, FID_MENU); 3782 SetConditionalCascade(hwndMenu, IDM_NOTEBOOKSUBMENU, np[x].usMenuId); 3779 3783 } 3780 3784 }
Note:
See TracChangeset
for help on using the changeset viewer.