Changeset 930
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dircnrs.c
r923 r930 33 33 22 Nov 07 GKY Use CopyPresParams to fix presparam inconsistencies in menus 34 34 10 Jan 08 SHL Sync with CfgDlgProc mods 35 xx Jan 08 JBS Ticket 150: fix/improve save and restore of dir cnr state at FM/2 close/reopen 35 36 36 37 ***********************************************************************/ … … 1423 1424 1424 1425 CNRINFO cnri; 1425 // JBS static int i = 0;1426 // FILE * f = fopen("e:\\dev\\netlabs\\fm2\\trunk\\jbsdebug.log", "a");1427 // fprintf(f, "UM_SETUP Dir: %s; Count: %d Details: %d %d %d %d\n", dcd->directory, ++i, (int)dcd->detailscrdate, (int)dcd->detailscrtime, (int)dcd->detailsladate, (int)dcd->detailsladate);1428 // fclose(f);1429 1426 1430 1427 RestorePresParams(hwnd, "DirCnr"); 1431 // JBS LoadDetailsSwitches("DirCnr", dcd);1432 1428 memset(&cnri, 0, sizeof(CNRINFO)); 1433 1429 cnri.cb = sizeof(CNRINFO); … … 1486 1482 CMA_CXTREEINDENT | CMA_PSORTRECORD)); 1487 1483 SetCnrCols(hwnd, FALSE); 1488 // JBS AdjustCnrColsForPref(hwnd, NULL, dcd, FALSE);1489 1484 if (_beginthread(MakeObjWin, NULL, 245760, (PVOID) dcd) == -1) { 1490 1485 Runtime_Error(pszSrcFile, __LINE__, … … 2040 2035 2041 2036 case IDM_RESORT: 2042 // 2043 // 2044 // 2045 // 2037 // WinSendMsg(hwnd, 2038 // CM_SORTRECORD, 2039 // MPFROMP(SortDirCnr), 2040 // MPFROMLONG((fSyncUpdates) ? sortFlags : dcd->sortFlags)); 2046 2041 WinSendMsg(hwnd, 2047 2042 CM_SORTRECORD, … … 2162 2157 dcd->hwndLastMenu, 2163 2158 SHORT1FROMMP(mp1), 2164 // JBS dcd->directory, "DirCnr", dcd, FALSE);2165 2159 dcd->directory, NULL, dcd, FALSE); 2166 2160 break; … … 2594 2588 if (pci->attrFile & FILE_DIRECTORY) { 2595 2589 menuHwnd = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP); 2596 // 2590 // WinEnableMenuItem(DirMenu,IDM_TREE,TRUE); 2597 2591 } 2598 2592 else … … 3429 3423 dcd->hwndRestore = hwndRestore; 3430 3424 dcd->dontclose = ((flags & 1) != 0); 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3425 dcd->detailslongname = detailslongname; 3426 dcd->detailssubject = detailssubject; 3427 dcd->detailsea = detailsea; 3428 dcd->detailssize = detailssize; 3429 dcd->detailsicon = detailsicon; 3430 dcd->detailsattr = detailsattr; 3431 dcd->detailscrdate = detailscrdate; 3432 dcd->detailscrtime = detailscrtime; 3433 dcd->detailslwdate = detailslwdate; 3434 dcd->detailslwtime = detailslwtime; 3435 dcd->detailsladate = detailsladate; 3436 dcd->detailslatime = detailslatime; 3443 3437 strcpy(dcd->directory, directory); 3444 3438 add_udir(FALSE, directory); -
trunk/dll/mainwnd.c
r928 r930 46 46 16 Jan 08 SHL Add sync updates toggle 47 47 16 Jan 08 GKY Fix changing background color on toolbar 48 xx Jan 08 JBS Ticket 150: fix/improve save and restore of dir cnr state at FM/2 close/reopen 48 49 49 50 ***********************************************************************/ … … 52 53 #include <string.h> 53 54 #include <ctype.h> 54 #include <process.h> 55 #include <process.h> // _beginthread 55 56 56 57 #define INCL_DOS 57 58 #define INCL_WIN 58 #define INCL_SHLERRORS 59 #define INCL_SHLERRORS // PMERR_NOT_IN_IDX 59 60 #define INCL_WINHELP 60 61 #define INCL_GPI … … 66 67 #include "comp.h" 67 68 #include "datamin.h" 68 #include "arccnrs.h" 69 #include "errutil.h" 70 #include "strutil.h" 69 #include "arccnrs.h" // BldQuotedFileName 70 #include "errutil.h" // Dos_Error... 71 #include "strutil.h" // GetPString 71 72 #include "fm3dll.h" 72 73 … … 75 76 // #define FM2_STATE_AT_CLOSE GetPString(IDS_FM2TEMPTEXT) 76 77 #define FM2_STATE_AT_CLOSE "LastClose" 77 //#define JBSDBG size = 1; //78 #define JBSDBG79 78 80 79 static PSZ pszSrcFile = __FILE__; … … 86 85 87 86 static MRESULT EXPENTRY MainObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, 88 87 MPARAM mp2) 89 88 { 90 89 switch (msg) { … … 112 111 *dv = 0; 113 112 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwndB, QW_PARENT), 114 113 id + 50), sizeof(dv), dv); 115 114 d = toupper(*dv); 116 115 if (isalpha(d) && d > 'B' && 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 116 !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID | 117 DRIVE_SLOW)) && 118 (!hwndBubble || 119 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) && 120 !WinQueryCapture(HWND_DESKTOP)) { 121 122 FSALLOCATE fsa; 123 CHAR s[90], szQty[38]; 124 ULONG ulPctFree; 125 ULONGLONG ullFreeQty; 126 127 if (!DosQueryFSInfo((d - 'A') + 1, 128 FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) { 129 ullFreeQty = (ULONGLONG) fsa.cUnitAvail * 130 (fsa.cSectorUnit * fsa.cbSector); 131 ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ? 132 (fsa.cUnitAvail * 100) / fsa.cUnit : 0; 133 CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' '); 134 sprintf(s, "%s (%lu%%) free", szQty, ulPctFree); 135 } 136 if ((!hwndBubble || 137 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) && 138 !WinQueryCapture(HWND_DESKTOP)) 139 WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID); 141 140 } 142 141 } … … 149 148 150 149 if (DosQuerySysInfo(QSV_BOOT_DRIVE, 151 152 153 150 QSV_BOOT_DRIVE, 151 (PVOID) & bd, (ULONG) sizeof(ULONG))) 152 bd = 3L; 154 153 *s = (CHAR) bd + '@'; 155 154 WinSendMsg(hwndMain, UM_SETDIR, MPFROMP(s), MPFROMLONG(1)); 156 155 if (!mp1) { 157 158 156 s[3] = 0; 157 WinSendMsg(hwndMain, UM_SETDIR, MPFROMP(s), MPVOID); 159 158 } 160 159 PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMLONG(1), MPFROMLONG(1)); … … 166 165 switch ((ULONG) mp2) { 167 166 case 1: 168 169 167 TileChildren(hwndMain, TRUE); 168 break; 170 169 case 2: 171 172 170 CloseDirCnrChildren(hwndMain); 171 break; 173 172 } 174 173 } … … 180 179 fNoTileUpdate = FALSE; 181 180 if (mp1) 182 181 free((char *)mp1); 183 182 if (fAutoTile) 184 183 TileChildren(hwndMain, TRUE); 185 184 } 186 185 return 0; … … 215 214 DosError(FERR_DISABLEHARDERR); 216 215 WinRegisterClass(hab2, 217 218 216 (PSZ) WC_OBJECTWINDOW, 217 MainObjectWndProc, 0, sizeof(PVOID)); 219 218 MainObjectHwnd = WinCreateWindow(HWND_OBJECT, 220 221 222 223 224 225 226 227 219 WC_OBJECTWINDOW, 220 (PSZ) NULL, 221 0, 222 0L, 223 0L, 224 0L, 225 0L, 226 0L, HWND_TOP, OBJ_FRAME, NULL, NULL); 228 227 if (!MainObjectHwnd) 229 230 228 Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__, 229 IDS_WINCREATEWINDOW); 231 230 else { 232 233 234 235 231 WinSetWindowPtr(MainObjectHwnd, QWL_USER, args); 232 while (WinGetMsg(hab2, &qmsg2, (HWND) 0, 0, 0)) 233 WinDispatchMsg(hab2, &qmsg2); 234 WinDestroyWindow(MainObjectHwnd); 236 235 } 237 236 WinDestroyMsgQueue(hmq2); … … 242 241 243 242 static MRESULT EXPENTRY IdealButtonProc(HWND hwnd, ULONG msg, MPARAM mp1, 244 243 MPARAM mp2) 245 244 { 246 245 switch (msg) { … … 262 261 while ((hwndC = WinGetNextWindow(henum)) != NULLHANDLE) { 263 262 if (hwndC != exclude) { 264 265 266 263 id = WinQueryWindowUShort(hwndC, QWS_ID); 264 if (id) 265 break; 267 266 } 268 267 } … … 284 283 henum = WinBeginEnumWindows(hwndMain); 285 284 while ((hwndC = WinGetNextWindow(henum)) != NULLHANDLE) { 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 285 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu",hwndTree,exclude,hwndC); 286 if (hwndC != exclude && hwndC != hwndTree) { 287 id = WinQueryWindowUShort(hwndC, QWS_ID); 288 if (id) { 289 hwndClient = WinWindowFromID(hwndC, FID_CLIENT); 290 if (hwndClient) { 291 hwndDir = WinWindowFromID(hwndClient, DIR_CNR); 292 if (hwndDir) { 293 if (fLookInDir) { 294 pci = (PCNRITEM) WinSendMsg(hwndDir, 295 CM_QUERYRECORDEMPHASIS, 296 MPFROMLONG(CMA_FIRST), 297 MPFROMSHORT(CRA_CURSORED)); 298 if (pci && (INT) pci != -1) 299 break; 300 } 301 if (WinSendMsg(hwndClient, 302 UM_CONTAINERDIR, MPFROMP(ret), MPVOID)) { 303 MakeValidDir(ret); 304 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu\r\"%s\"",hwndTree,exclude,hwndC,ret); 305 WinEndEnumWindows(henum); 306 return hwndC; 307 } 308 } 309 } 310 } 311 } 313 312 } 314 313 WinEndEnumWindows(henum); 315 314 if (!pci || (INT) pci == -1) { 316 317 318 319 320 321 322 315 hwndC = hwndTree; 316 pci = (PCNRITEM) WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, 317 FID_CLIENT), 318 TREE_CNR), 319 CM_QUERYRECORDEMPHASIS, 320 MPFROMLONG(CMA_FIRST), 321 MPFROMSHORT(CRA_CURSORED)); 323 322 } 324 323 if (pci && (INT) pci != -1) { 325 326 324 strcpy(ret, pci->pszFileName); 325 MakeValidDir(ret); 327 326 } 328 327 else 329 328 save_dir2(ret); 330 329 } 331 330 } … … 345 344 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 346 345 if (hwndDir) 347 346 ret++; 348 347 } 349 348 } … … 363 362 hwndC = WinWindowFromID(hwndF, FID_CLIENT); 364 363 if (hwndC) { 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 364 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 365 if (hwndDir) { 366 *retstr = 0; 367 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(retstr), MPVOID); 368 if (*retstr && !stricmp(retstr, directory)) { 369 if (restore) 370 WinSetWindowPos(hwndF, 371 HWND_TOP, 372 0, 373 0, 374 0, 375 0, 376 SWP_RESTORE | SWP_SHOW | 377 SWP_ACTIVATE | SWP_ZORDER); 378 break; 379 } 380 } 382 381 } 383 382 } … … 446 445 while (tool) { 447 446 if (!(tool->flags & T_INVISIBLE)) { 448 449 450 451 452 453 454 455 456 457 458 447 swp[x].x = butx; 448 if (fTextTools || (tool->flags & T_TEXT)) { 449 butx += 55L; 450 swp[x].cx = 54L; 451 swp[x].cy = 24L; 452 swp[x].y = 3L; 453 } 454 else 455 butx += 33L; 456 if (tool->flags & T_SEPARATOR) 457 butx += 12; 459 458 } 460 459 else 461 460 swp[x].fl = noattrib; 462 461 swp[x].hwnd = WinWindowFromID(hwnd, tool->id); 463 462 x++; … … 468 467 swp[x].x = butx; 469 468 if (!(tool->flags & T_INVISIBLE)) { 470 471 472 473 474 475 476 477 478 479 469 if (fTextTools || (tool->flags & T_TEXT)) { 470 butx += 55L; 471 swp[x].cx = 54L; 472 swp[x].cy = 24L; 473 swp[x].y = 3L; 474 } 475 else 476 butx += 33L; 477 if (tool->flags & T_SEPARATOR) 478 butx += 12; 480 479 } 481 480 else 482 481 swp[x].fl = noattrib; 483 482 swp[x].hwnd = WinWindowFromID(hwnd, tool->id); 484 483 x++; … … 488 487 if (!fTextTools && fToolTitles) { 489 488 for (x = 2L; x < numtools + 2L; x++) { 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 489 if (fTextTools || !fToolTitles) 490 swp[x].fl = noattrib; 491 else { 492 tool = find_tool(WinQueryWindowUShort(swp[x].hwnd, QWS_ID)); 493 if (tool && (tool->flags & T_TEXT)) 494 swp[x].fl = noattrib; 495 else { 496 swp[x].hwndInsertBehind = HWND_TOP; 497 swp[x].y = 1L; 498 swp[x].cy = 10L; 499 } 500 } 501 swp[x].hwnd = WinWindowFromID(hwnd, 502 WinQueryWindowUShort(swp[x].hwnd, 503 QWS_ID) + 25000); 505 504 } 506 505 WinSetMultWindowPos(WinQueryAnchorBlock(hwnd), &swp[2], numtools); … … 512 511 513 512 static MRESULT EXPENTRY DropDownListProc(HWND hwnd, ULONG msg, MPARAM mp1, 514 513 MPARAM mp2) 515 514 { 516 515 PFNWP oldproc = (PFNWP) INSTDATA(hwnd); … … 550 549 id = WinQueryWindowUShort(hwndParent, QWS_ID); 551 550 if (SHORT1FROMMP(mp2)) { 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 551 // If getting focus 1st time - save original accelerator 552 if (haccelSaved == NULLHANDLE) { 553 haccelSaved = WinQueryAccelTable(hab, hwndFrame); 554 if (haccelSaved == NULLHANDLE) 555 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinQueryAccelTable"); 556 // else 557 // DbgMsg(pszSrcFile, __LINE__, "WinQueryAccelTable SAVED %x", haccelSaved); 558 } 559 if (haccelSaved != NULLHANDLE) { 560 switch (id) { 561 case MAIN_DRIVELIST: 562 if (haccelDriveList == NULLHANDLE) { 563 haccelDriveList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_DRIVELIST); 564 if (haccelDriveList == NULLHANDLE) 565 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 566 } 567 if (haccelDriveList != NULLHANDLE) { 568 if (!WinSetAccelTable(hab, haccelDriveList, hwndFrame)) 569 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 570 // else 571 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_DRIVELIST %x %x", hwndFrame, haccelDriveList); 572 } 573 break; 574 case MAIN_SETUPLIST: 575 if (haccelSetupList == NULLHANDLE) { 576 haccelSetupList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_SETUPLIST); 577 if (haccelSetupList == NULLHANDLE) 578 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 579 } 580 if (haccelSetupList != NULLHANDLE) { 581 if (!WinSetAccelTable(hab, haccelSetupList, hwndFrame)) 582 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 583 // else 584 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_SETUPLIST %x %x", hwndFrame, haccelSetupList); 585 } 586 break; 587 case MAIN_CMDLIST: 588 if (haccelCmdList == NULLHANDLE) { 589 haccelCmdList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_CMDLIST); 590 if (haccelCmdList == NULLHANDLE) 591 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 592 } 593 if (haccelCmdList != NULLHANDLE) { 594 if (!WinSetAccelTable(hab, haccelCmdList, hwndFrame)) 595 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 596 // else 597 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_CMDLIST %x %x", hwndFrame, haccelCmdList); 598 } 599 break; 600 case MAIN_USERLIST: 601 if (haccelUserList == NULLHANDLE) { 602 haccelUserList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_USERLIST); 603 if (haccelUserList == NULLHANDLE) 604 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 605 } 606 if (haccelUserList != NULLHANDLE) { 607 if (!WinSetAccelTable(hab, haccelUserList, hwndFrame)) 608 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 609 // else 610 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_USERLIST %x %x", hwndFrame, haccelUserList); 611 } 612 break; 613 case MAIN_BUTTONLIST: 614 if (haccelButtonList == NULLHANDLE) { 615 haccelButtonList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_BUTTONLIST); 616 if (haccelButtonList == NULLHANDLE) 617 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 618 } 619 if (haccelButtonList != NULLHANDLE) { 620 if (!WinSetAccelTable(hab, haccelButtonList, hwndFrame)) 621 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 622 // else 623 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_BUTTONLIST %x %x", hwndFrame, haccelButtonList); 624 } 625 break; 626 } // switch 627 } 629 628 } 630 629 else { 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 630 // Losing focus 631 switch (id) { 632 case MAIN_DRIVELIST: 633 case MAIN_SETUPLIST: 634 case MAIN_CMDLIST: 635 case MAIN_USERLIST: 636 case MAIN_BUTTONLIST: 637 if (haccelSaved != NULLHANDLE) { 638 if (!WinSetAccelTable(hab, haccelSaved, hwndFrame)) 639 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 640 // else 641 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable SAVED %x %x", hwndFrame, haccelSaved); 642 } 643 break; 644 } // switch 646 645 } 647 646 } … … 653 652 654 653 if (hwndMenu) 655 654 WinDestroyWindow(hwndMenu); 656 655 hwndMenu = (HWND) 0; 657 656 id = WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID); 658 657 switch (id) { 659 658 case MAIN_CMDLIST: 660 661 662 663 664 665 659 WinPostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 660 QW_PARENT), 661 QW_PARENT), 662 FID_CLIENT), 663 WM_COMMAND, MPFROM2SHORT(IDM_EDITCOMMANDS, 0), MPVOID); 664 break; 666 665 case MAIN_USERLIST: 667 666 case MAIN_SETUPLIST: 668 669 670 671 672 673 674 675 667 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id); 668 if (hwndMenu) 669 PopupMenu(hwnd, 670 WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 671 QW_PARENT), 672 QW_PARENT), 673 FID_CLIENT), hwndMenu); 674 break; 676 675 default: 677 678 676 ret = FALSE; 677 break; 679 678 } // switch 680 679 return ret; … … 685 684 switch (SHORT1FROMMP(mp1)) { 686 685 case CBID_EDIT: 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 686 id = WinQueryWindowUShort(hwnd, QWS_ID); 687 switch (SHORT2FROMMP(mp1)) { 688 case EN_SETFOCUS: 689 switch (id) { 690 case MAIN_CMDLIST: 691 WinSetWindowText(hwndStatus2, GetPString(IDS_CMDLISTHELP)); 692 break; 693 case MAIN_SETUPLIST: 694 WinSetWindowText(hwndStatus2, GetPString(IDS_SETUPLISTHELP)); 695 break; 696 case MAIN_USERLIST: 697 WinSetWindowText(hwndStatus2, GetPString(IDS_USERLISTHELP)); 698 break; 699 case MAIN_DRIVELIST: 700 WinSetWindowText(hwndStatus2, GetPString(IDS_DRIVELISTHELP)); 701 break; 702 case MAIN_BUTTONLIST: 703 WinSetWindowText(hwndStatus2, GetPString(IDS_BUTTONLISTHELP)); 704 break; 705 default: 706 break; 707 } 708 break; 709 710 default: 711 break; 712 } 714 713 } 715 714 break; … … 724 723 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"%u %s %u",id,(id == CBID_EDIT) ? "TRUE" : "FALSE",WinQueryWindowUShort(WinQueryWindow(hwnd,QW_PARENT),QWS_ID) == MAIN_USERLIST); 725 724 if (id == CBID_EDIT && 726 727 725 WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID) == 726 MAIN_USERLIST) { 728 727 729 728 CHAR path[CCHMAXPATH]; … … 734 733 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Dragging: %s",path); 735 734 if (*path && !IsRoot(path)) 736 735 DragOne(hwnd, (HWND) 0, path, FALSE); 737 736 return 0; 738 737 } … … 743 742 if (id == MAIN_USERLIST) { 744 743 if (!emphasized) { 745 746 744 emphasized = TRUE; 745 DrawTargetEmphasis(hwnd, emphasized); 747 746 } 748 747 if (AcceptOneDrop(hwnd, mp1, mp2)) 749 748 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 750 749 return MRFROM2SHORT(DOR_NEVERDROP, 0); 751 750 } … … 756 755 if (id == MAIN_USERLIST) { 757 756 if (emphasized) { 758 759 757 emphasized = FALSE; 758 DrawTargetEmphasis(hwnd, emphasized); 760 759 } 761 760 } … … 777 776 778 777 if (emphasized) { 779 780 778 emphasized = FALSE; 779 DrawTargetEmphasis(hwnd, emphasized); 781 780 } 782 781 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 783 784 785 786 787 788 789 790 782 MakeValidDir(szFrom); 783 WinSetWindowText(hwnd, szFrom); 784 PostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 785 QW_PARENT), 786 QW_PARENT), 787 FID_CLIENT), 788 UM_COMMAND, MPFROM2SHORT(IDM_ADDTOUSERLIST, 0), MPVOID); 789 return 0; 791 790 } 792 791 } … … 809 808 (other && fOtherHelp) || (!other && !drive && fToolbarHelp))) { 810 809 if ((!hwndBubble || 811 812 810 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 811 !WinQueryCapture(HWND_DESKTOP)) 813 812 MakeBubble(hwnd, above, help); 814 813 } … … 831 830 /* don't bring up help if window isn't active */ 832 831 if (!WinIsChild(hwnd, hwndActive)) 833 832 return; 834 833 } 835 834 hwndActive = WinQueryFocus(HWND_DESKTOP); … … 837 836 /* don't bring up help if a menu is active */ 838 837 if (!strcmp(ucClassname, "#4")) 839 838 return; 840 839 } 841 840 } 842 841 843 842 hwndBubble = WinCreateWindow(HWND_DESKTOP, 844 845 846 847 848 849 850 851 852 843 WC_BUBBLE, 844 help, 845 WS_CLIPSIBLINGS | SS_TEXT | 846 DT_CENTER | DT_VCENTER, 847 0, 848 0, 849 0, 850 0, 851 HWND_DESKTOP, HWND_TOP, MAIN_HELP, NULL, NULL); 853 852 if (!hwndBubble) 854 853 Win_Error2(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, 855 854 IDS_WINCREATEWINDOW); 856 855 else { 857 856 HPS hps; … … 873 872 pp = strchr(p, '\r'); 874 873 if (pp) { 875 876 877 874 wp = pp; 875 *pp = 0; 876 pp++; 878 877 } 879 878 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl); 880 879 tptl.x = max(aptl[TXTBOX_TOPRIGHT].x, tptl.x); 881 880 if (tptl.y) 882 881 tptl.y += extra; 883 882 else 884 883 extra = aptl[TXTBOX_TOPLEFT].y / 4; 885 884 tptl.y += aptl[TXTBOX_TOPLEFT].y; 886 885 if (wp) 887 886 *wp = '\r'; 888 887 p = pp; 889 888 } … … 895 894 sy = ptl.y + swp.cy + 4; 896 895 if (sy + tptl.y + 12 > lyScreen) { 897 898 896 above = FALSE; 897 sy = ptl.y - (tptl.y + 14); 899 898 } 900 899 } … … 912 911 sy = ptl.y + swp.cy + 4; 913 912 if (sy + tptl.y + 12 > lyScreen) 914 913 sy = 0; 915 914 } 916 915 WinSetWindowPos(hwndBubble, HWND_TOP, sx, sy, 917 918 919 920 916 tptl.x + 14, 917 tptl.y + 12, 918 SWP_DEACTIVATE | SWP_SHOW | SWP_ZORDER | 919 SWP_MOVE | SWP_SIZE); 921 920 } 922 921 } … … 944 943 WinQueryPointerPos(HWND_DESKTOP, &ptl); 945 944 if (WinWindowFromPoint(HWND_DESKTOP, &ptl, TRUE) != 946 947 945 WinQueryWindowULong(hwnd, QWL_USER) || !WinIsWindowVisible(hwnd)) 946 WinDestroyWindow(hwnd); 948 947 } 949 948 return 0; … … 959 958 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 960 959 if (hps) { 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 960 WinQueryWindowPos(hwnd, &swp); 961 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, 0); 962 GpiSetColor(hps, ((255 << 16) | (255 << 8) | 198)); 963 GpiSetBackMix(hps, BM_LEAVEALONE); 964 GpiSetMix(hps, FM_OVERPAINT); 965 ptl.x = ptl.y = 0; 966 GpiMove(hps, &ptl); 967 ptl.x = swp.cx - 1; 968 ptl.y = swp.cy - 1; 969 GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0); 970 tlen = WinQueryWindowTextLength(hwnd); 971 if (tlen) { 972 s = xmalloc(tlen + 2, pszSrcFile, __LINE__); 973 if (s) { 974 WinQueryWindowText(hwnd, tlen + 1, s); 975 if (*s) { 976 p = s; 977 y = swp.cy - 3; 978 extra = WinQueryWindowULong(hwnd, QWL_USER + 4); 979 GpiSetColor(hps, 0); 980 GpiSetMix(hps, FM_OVERPAINT); 981 while (p && *p) { 982 wp = NULL; 983 pp = strchr(p, '\r'); 984 if (pp) { 985 wp = pp; 986 *pp = 0; 987 pp++; 988 } 989 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl); 990 ptl.x = 7; 991 y -= aptl[TXTBOX_TOPLEFT].y; 992 if (p != s) 993 y -= extra; 994 ptl.y = y; 995 GpiCharStringAt(hps, &ptl, strlen(p), p); 996 if (wp) 997 *wp = '\r'; 998 p = pp; 999 } 1000 } 1001 free(s); 1002 } 1003 } 1004 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE)) && swp.cx > 6 && swp.cy > 6) { 1005 GpiSetColor(hps, CLR_WHITE); 1006 ptl.x = 1; 1007 ptl.y = 1; 1008 GpiMove(hps, &ptl); 1009 ptl.y = swp.cy - 2; 1010 GpiLine(hps, &ptl); 1011 ptl.x = swp.cx - 2; 1012 GpiLine(hps, &ptl); 1013 ptl.x = 2; 1014 ptl.y = 2; 1015 GpiMove(hps, &ptl); 1016 ptl.y = swp.cy - 3; 1017 GpiLine(hps, &ptl); 1018 ptl.x = swp.cx - 3; 1019 GpiLine(hps, &ptl); 1020 GpiSetColor(hps, CLR_BROWN); 1021 ptl.x = 1; 1022 ptl.y = 1; 1023 GpiMove(hps, &ptl); 1024 ptl.x = swp.cx - 2; 1025 GpiLine(hps, &ptl); 1026 ptl.y = swp.cy - 2; 1027 GpiLine(hps, &ptl); 1028 ptl.x = 2; 1029 ptl.y = 2; 1030 GpiMove(hps, &ptl); 1031 ptl.x = swp.cx - 3; 1032 GpiLine(hps, &ptl); 1033 ptl.y = swp.cy - 3; 1034 GpiLine(hps, &ptl); 1035 } 1036 WinEndPaint(hps); 1038 1037 } 1039 1038 } … … 1062 1061 switch (WinQueryWindowUShort(hwnd, QWS_ID)) { 1063 1062 case MAIN_LED: 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1063 hps = WinGetPS(hwnd); 1064 hbmold = (HBITMAP) WinSendMsg(hwnd, SM_QUERYHANDLE, MPVOID, MPVOID); 1065 if (!fBlueLED) { 1066 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON_BMP, 12, 12); 1067 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF_BMP, 12, 12); 1068 } 1069 else { 1070 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON2_BMP, 12, 12); 1071 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF2_BMP, 12, 12); 1072 } 1073 if (hbmLEDoff && hbmLEDon) 1074 WinSendMsg(hwnd, SM_SETHANDLE, MPFROMLONG(hbmLEDoff), MPVOID); 1075 else { 1076 if (hbmLEDoff) 1077 GpiDeleteBitmap(hbmLEDoff); 1078 if (hbmLEDon) 1079 GpiDeleteBitmap(hbmLEDon); 1080 } 1081 if (hbmold && 1082 hbmLEDon && 1083 hbmLEDoff && hbmold != hbmLEDon && hbmold != hbmLEDoff) 1084 GpiDeleteBitmap(hbmold); 1085 if (hps) 1086 WinReleasePS(hps); 1087 break; 1089 1088 default: 1090 1091 1092 1093 1089 SetPresParams(hwnd, 1090 &RGBGREY, 1091 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT)); 1092 break; 1094 1093 } 1095 1094 return mr; … … 1115 1114 case WM_BUTTON1CLICK: 1116 1115 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1117 1116 WM_COMMAND, MPFROM2SHORT(IDM_SHOWNOTEWND, 0), MPVOID); 1118 1117 break; 1119 1118 1120 1119 case WM_BUTTON2CLICK: 1121 1120 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1122 1121 WM_COMMAND, MPFROM2SHORT(IDM_HIDENOTEWND, 0), MPVOID); 1123 1122 break; 1124 1123 … … 1126 1125 case WM_BUTTON3CLICK: 1127 1126 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1128 1127 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID); 1129 1128 break; 1130 1129 } … … 1149 1148 if (fToolbarHelp) { 1150 1149 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1150 && !WinQueryCapture(HWND_DESKTOP)) { 1151 id = WinQueryWindowUShort(hwnd, QWS_ID); 1152 tool = find_tool(id); 1153 if (tool && tool->help && *tool->help) { 1154 1155 char s[128]; 1156 1157 strcpy(s, tool->help); 1158 if (tool->flags & T_DROPABLE) 1159 strcat(s, GetPString(IDS_DROPONMETEXT)); 1160 MakeBubble(hwnd, FALSE, s); 1161 } 1163 1162 } 1164 1163 } … … 1169 1168 case IDM_HELP: 1170 1169 if (hwndHelp) 1171 1172 1173 1170 WinSendMsg(hwndHelp, 1171 HM_DISPLAY_HELP, 1172 MPFROM2SHORT(HELP_TOOLBAR, 0), MPFROMSHORT(HM_RESOURCEID)); 1174 1173 break; 1175 1174 1176 case IDM_HIDEANYTOOL: 1177 case IDM_HIDETOOL: 1175 case IDM_HIDEANYTOOL: /* hide any tool */ 1176 case IDM_HIDETOOL: /* hide tool */ 1178 1177 if (SHORT1FROMMP(mp1) == IDM_HIDETOOL) 1179 1178 id = WinQueryWindowUShort(hwnd, QWS_ID); 1180 1179 else 1181 1182 1183 1180 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, 1181 PickToolProc, FM3ModHandle, 1182 PICKBTN_FRAME, GetPString(IDS_HIDETEXT)); 1184 1183 if (id) { 1185 1186 1187 1188 1189 1184 tool = find_tool(id); 1185 if (tool) { 1186 tool->flags |= T_INVISIBLE; 1187 fToolsChanged = TRUE; 1188 } 1190 1189 } 1191 1190 break; 1192 1191 1193 case IDM_SHOWTOOLS: 1192 case IDM_SHOWTOOLS: /* show all tools */ 1194 1193 tool = toolhead; 1195 1194 while (tool) { 1196 1197 1198 1195 tool->flags &= (~T_INVISIBLE); 1196 tool = tool->next; 1197 fToolsChanged = TRUE; 1199 1198 } 1200 1199 break; 1201 1200 1202 case IDM_DELETEANYTOOL: 1203 case IDM_DELETETOOL: 1201 case IDM_DELETEANYTOOL: /* delete any button */ 1202 case IDM_DELETETOOL: /* delete button */ 1204 1203 if (SHORT1FROMMP(mp1) == IDM_DELETETOOL) 1205 1204 id = WinQueryWindowUShort(hwnd, QWS_ID); 1206 1205 else 1207 1208 1209 1206 id = 1207 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle, 1208 PICKBTN_FRAME, GetPString(IDS_DELETETEXT)); 1210 1209 if (id) 1211 1212 1210 PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_SETUP, 1211 MPFROM2SHORT(id, 0), MPVOID); 1213 1212 return 0; 1214 1213 1215 case IDM_EDITANYTOOL: 1216 case IDM_EDITTOOL: 1214 case IDM_EDITANYTOOL: /* edit any button */ 1215 case IDM_EDITTOOL: /* edit button */ 1217 1216 if (SHORT1FROMMP(mp1) == IDM_EDITTOOL) 1218 1217 id = WinQueryWindowUShort(hwnd, QWS_ID); 1219 1218 else 1220 1221 1222 1219 id = 1220 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle, 1221 PICKBTN_FRAME, GetPString(IDS_EDITTEXT)); 1223 1222 if (id) { 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1223 tool = find_tool(id); 1224 if (tool) { 1225 if (WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle, 1226 ADDBTN_FRAME, (PVOID) tool)) 1227 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 1228 QW_PARENT), 1229 QW_PARENT), FID_CLIENT), 1230 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0), 1231 MPFROM2SHORT(id, 0)); 1232 } 1234 1233 } 1235 1234 break; 1236 1235 1237 case IDM_ADDTOOL: 1236 case IDM_ADDTOOL: /* add tool */ 1238 1237 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle, 1239 1238 ADDBTN_FRAME, MPVOID); 1240 1239 if (id && id != (USHORT) - 1) 1241 1242 1243 1244 1245 1240 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 1241 QW_PARENT), 1242 QW_PARENT), FID_CLIENT), 1243 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0), 1244 MPFROM2SHORT(id, 0)); 1246 1245 break; 1247 1246 1248 case IDM_REORDERTOOLS: 1247 case IDM_REORDERTOOLS: /* reorder tools */ 1249 1248 WinDlgBox(HWND_DESKTOP, 1250 1249 hwnd, ReOrderToolsProc, FM3ModHandle, RE_FRAME, MPVOID); 1251 1250 break; 1252 1251 … … 1254 1253 case IDM_LOADTOOLS: 1255 1254 if (WinDlgBox(HWND_DESKTOP, 1256 1257 1258 1259 1260 1261 1262 1255 hwnd, 1256 ToolIODlgProc, 1257 FM3ModHandle, 1258 SVBTN_FRAME, 1259 (PVOID) (SHORT1FROMMP(mp1) == IDM_SAVETOOLS) ? 1260 "TRUE" : NULL)) 1261 BuildTools(hwndToolback, TRUE); 1263 1262 break; 1264 1263 } … … 1285 1284 case DM_DRAGOVER: 1286 1285 { 1287 PDRAGINFO pDInfo; 1288 1289 pDInfo = (PDRAGINFO) mp1; 1290 DrgAccessDraginfo(pDInfo); 1286 PDRAGINFO pDInfo; /* Pointer to DRAGINFO */ 1287 1288 pDInfo = (PDRAGINFO) mp1; /* Get DRAGINFO pointer */ 1289 DrgAccessDraginfo(pDInfo); /* Access DRAGINFO */ 1291 1290 id = WinQueryWindowUShort(hwnd, QWS_ID); 1292 1291 tool = find_tool(id); 1293 1292 if (!tool) { 1294 1295 return (MRFROM2SHORT(DOR_NEVERDROP, 0));/* Drop not valid */1293 DrgFreeDraginfo(pDInfo); 1294 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */ 1296 1295 } 1297 1296 if (!(tool->flags & T_DROPABLE)) { 1298 1299 return (MRFROM2SHORT(DOR_NEVERDROP, 0));/* Drop not valid */1297 DrgFreeDraginfo(pDInfo); 1298 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */ 1300 1299 } 1301 1300 { 1302 PDRAGITEM pDItem;/* Pointer to DRAGITEM */1303 1304 pDItem = DrgQueryDragitemPtr(pDInfo,/* Access DRAGITEM */1305 0);/* Index to DRAGITEM */1306 if (DrgVerifyRMF(pDItem,/* Check valid rendering */1307 DRM_OS2FILE,/* mechanisms and data */1308 NULL)) {/* formats */1309 1310 1311 1312 1313 1314 return (MRFROM2SHORT(DOR_DROP,/* Return okay to drop */1315 DO_MOVE));/* Move operation valid */1316 1317 1318 } 1319 } 1320 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); 1301 PDRAGITEM pDItem; /* Pointer to DRAGITEM */ 1302 1303 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */ 1304 0); /* Index to DRAGITEM */ 1305 if (DrgVerifyRMF(pDItem, /* Check valid rendering */ 1306 DRM_OS2FILE, /* mechanisms and data */ 1307 NULL)) { /* formats */ 1308 if (!(tool->flags & T_EMPHASIZED)) { 1309 tool->flags |= T_EMPHASIZED; 1310 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1311 DrgFreeDraginfo(pDInfo); 1312 } 1313 return (MRFROM2SHORT(DOR_DROP, /* Return okay to drop */ 1314 DO_MOVE)); /* Move operation valid */ 1315 } 1316 DrgFreeDraginfo(pDInfo); 1317 } 1318 } 1319 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */ 1321 1320 1322 1321 case DM_DROPHELP: … … 1332 1331 if (tool && (tool->flags & T_DROPABLE)) { 1333 1332 if (tool->flags & T_EMPHASIZED) { 1334 1335 1333 tool->flags &= (~T_EMPHASIZED); 1334 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1336 1335 } 1337 1336 } … … 1346 1345 1347 1346 if (tool->flags & T_EMPHASIZED) { 1348 1349 1347 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1348 tool->flags &= (~T_EMPHASIZED); 1350 1349 } 1351 1350 memset(&cdi, 0, sizeof(cdi)); … … 1354 1353 CheckPmDrgLimit(cdi.pDragInfo); 1355 1354 if (li) { 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1355 li->type = id; 1356 if (!li->list || !li->list[0]) 1357 FreeListInfo(li); 1358 else { 1359 HWND hwndActive; 1360 1361 hwndActive = TopWindow(hwndMain, (HWND) 0); 1362 if (hwndActive) { 1363 if (!WinSendMsg(hwndActive, UM_COMMAND, MPFROMP(li), MPVOID)) 1364 FreeListInfo(li); 1365 } 1366 else 1367 FreeListInfo(li); 1368 } 1370 1369 } 1371 1370 } … … 1404 1403 if (!fTextTools) { 1405 1404 if (!(tool->flags & T_MYICON)) { 1406 1407 1408 1409 1410 1411 1412 1413 1414 1405 hwndTool = WinCreateWindow(hwndT, 1406 WC_TOOLBUTTONS, 1407 s, 1408 BS_NOPOINTERFOCUS | 1409 BS_BITMAP | BS_PUSHBUTTON, 1410 ctrlxpos, 1411 14, 1412 32, 1413 32, hwndT, HWND_TOP, tool->id, NULL, NULL); 1415 1414 } 1416 1415 if (!hwndTool) { 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1416 HBITMAP hbm = LoadBitmapFromFileNum(tool->id); 1417 1418 if (hbm) { 1419 BTNCDATA btc; 1420 1421 memset(&btc, 0, sizeof(btc)); 1422 btc.cb = sizeof(btc); 1423 btc.hImage = hbm; 1424 hwndTool = WinCreateWindow(hwndT, 1425 WC_TOOLBUTTONS, 1426 NullStr, 1427 BS_NOPOINTERFOCUS | 1428 BS_BITMAP | BS_PUSHBUTTON, 1429 ctrlxpos, 1430 14, 1431 32, 1432 32, 1433 hwndT, HWND_TOP, tool->id, &btc, NULL); 1434 if (!hwndTool) 1435 GpiDeleteBitmap(hbm); 1436 } 1438 1437 } 1439 1438 if (hwndTool) 1440 1439 tool->flags &= (~T_TEXT); 1441 1440 } 1442 1441 if (!hwndTool) { 1443 1442 hwndTool = WinCreateWindow(hwndT, 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1443 WC_TOOLBUTTONS, 1444 (!tool->text && tool->id >= IDM_COMMANDSTART 1445 && tool->id < 1446 IDM_QUICKTOOLSTART) ? command_title(tool-> 1447 id - 1448 IDM_COMMANDSTART) 1449 : tool->text, 1450 BS_NOPOINTERFOCUS | BS_PUSHBUTTON, ctrlxpos, 1451 2, 54, 24, hwndT, HWND_TOP, tool->id, NULL, 1452 NULL); 1454 1453 if (!hwndTool) 1455 1456 1454 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1455 IDS_WINCREATEWINDOW); 1457 1456 tool->flags |= T_TEXT; 1458 1457 } 1459 1458 if (fToolTitles && !fTextTools) { 1460 1459 hwndTool = WinCreateWindow(hwndT, 1461 1462 1463 1464 1465 1466 1467 1468 1469 1460 WC_STATIC, 1461 tool->text, 1462 SS_TEXT | DT_LEFT | DT_VCENTER, 1463 ctrlxpos, 1464 1, 1465 32, 1466 10, 1467 hwndT, 1468 HWND_TOP, tool->id + 25000, NULL, NULL); 1470 1469 if (!hwndTool) 1471 1472 1470 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1471 IDS_WINCREATEWINDOW); 1473 1472 else { 1474 1475 1476 1473 SetPresParams(hwndTool, 1474 &RGBGREY, 1475 &RGBBLACK, &RGBGREY, GetPString(IDS_2SYSTEMVIOTEXT)); 1477 1476 } 1478 1477 } 1479 1478 ctrlxpos += ((tool->flags & T_TEXT) ? 55L : 33L); 1480 1479 SetPresParams(WinWindowFromID(hwndT, tool->id), 1481 1480 NULL, NULL, NULL, GetPString(IDS_8HELVTEXT)); 1482 1481 tool = tool->next; 1483 } 1482 } // while tool 1484 1483 1485 1484 hwndTool = WinCreateWindow(hwndT, 1486 1487 1488 1489 1490 1491 1492 1493 1485 WC_BUTTON, 1486 "#6010", 1487 BS_NOPOINTERFOCUS | 1488 BS_BITMAP | BS_PUSHBUTTON, 1489 1, 1490 19, 1491 14, 1492 13, hwndT, HWND_TOP, IDM_TOOLLEFT, NULL, NULL); 1494 1493 if (!hwndTool) 1495 1494 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1496 1495 IDS_WINCREATEWINDOW); 1497 1496 hwndTool = 1498 1497 WinCreateWindow(hwndT, WC_BUTTON, "#6011", 1499 1500 1498 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON, 1, 4, 14, 1499 13, hwndT, HWND_TOP, IDM_TOOLRIGHT, NULL, NULL); 1501 1500 if (!hwndTool) 1502 1501 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1503 1502 IDS_WINCREATEWINDOW); 1504 1503 if (resize) 1505 1504 ResizeTools(hwndT); … … 1507 1506 1508 1507 static MRESULT EXPENTRY CommandLineProc(HWND hwnd, ULONG msg, MPARAM mp1, 1509 1508 MPARAM mp2) 1510 1509 { 1511 1510 PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER); … … 1524 1523 1525 1524 if (WinQueryWindowUShort((HWND) mp1, QWS_ID) == COMMAND_BUTTON) 1526 1525 break; 1527 1526 if (!WinQueryWindowProcess((HWND) mp1, &pid, &tid) || pid == mypid) 1528 1527 WinDestroyWindow(hwnd); 1529 1528 } 1530 1529 break; … … 1537 1536 lbup = TRUE; 1538 1537 if (WinDlgBox(HWND_DESKTOP, 1539 1540 1541 1542 1543 1538 hwnd, 1539 CmdLine2DlgProc, 1540 FM3ModHandle, EXEC2_FRAME, MPFROMP(cl))) { 1541 lstrip(cl); 1542 WinSetWindowText(hwnd, cl); 1544 1543 } 1545 1544 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); … … 1560 1559 case COMMAND_BUTTON: 1561 1560 if (!lbup) 1562 1561 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1563 1562 break; 1564 1563 } … … 1579 1578 bstrip(cl + len); 1580 1579 if (strlen(cl) > len) { 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1580 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 1581 UM_SETUP, MPFROMP(cl + len), MPVOID); 1582 WinQueryWindowText(hwndStatus, CCHMAXPATH, directory); 1583 bstrip(directory); 1584 if (*directory && (IsRoot(directory) || !IsFile(directory))) { 1585 if (!FM2Command(directory, cl + len)) { 1586 hwndCnr = TopWindow(hwndMain, (HWND) 0); 1587 if (hwndCnr) { 1588 hwndCnr = WinWindowFromID(hwndCnr, FID_CLIENT); 1589 if (hwndCnr) { 1590 hwndCnr = WinWindowFromID(hwndCnr, DIR_CNR); 1591 if (hwndCnr) 1592 list = BuildList(hwndCnr); 1593 } 1594 } 1595 WinSetActiveWindow(HWND_DESKTOP, hwndCnr); 1596 if (add_cmdline(cl + len, FALSE) && fSaveMiniCmds) 1597 save_cmdlines(FALSE); 1598 ExecOnList(hwndCnr, 1599 cl, 1600 WINDOWED | ((fKeepCmdLine) ? 1601 SEPARATEKEEP : SEPARATE), 1602 directory, list, NULL, pszSrcFile, __LINE__); 1603 if (list) 1604 free(list); 1605 WinDestroyWindow(hwnd); 1606 break; 1607 } 1608 } 1610 1609 } 1611 1610 WinSendMsg(hwnd, EM_SETSEL, MPFROM2SHORT(0, 1024), MPVOID); … … 1616 1615 if (!lbup && !(SHORT1FROMMP(mp1) & KC_KEYUP)) { 1617 1616 if (SHORT1FROMMP(mp1) & KC_VIRTUALKEY) { 1618 1619 1620 1621 1622 1623 1617 if ((SHORT1FROMMP(mp2) & 255) == '\r') 1618 PostMsg(hwnd, UM_OPENWINDOWFORME, MPVOID, MPVOID); 1619 else if ((SHORT1FROMMP(mp2) & 0xff) == 0x1b) 1620 WinDestroyWindow(hwnd); 1621 else if (SHORT2FROMMP(mp2) == VK_UP || SHORT2FROMMP(mp2) == VK_DOWN) 1622 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1624 1623 } 1625 1624 } 1626 1625 else if ((SHORT1FROMMP(mp1) & KC_VIRTUALKEY) && 1627 1628 1629 1626 ((SHORT2FROMMP(mp2) == VK_UP || 1627 SHORT2FROMMP(mp2) == VK_DOWN) || 1628 (SHORT1FROMMP(mp2) == '\x1b') || (SHORT1FROMMP(mp2) == '\r'))) 1630 1629 return 0; 1631 1630 break; … … 1653 1652 rgb.bRed = (BYTE)128; 1654 1653 SetPresParams(hwnd, 1655 1654 &RGBGREY, &rgb, &RGBGREY, GetPString(IDS_8HELVTEXT)); 1656 1655 SetTargetDir(hwnd, TRUE); 1657 1656 } … … 1683 1682 case WM_CONTROLPOINTER: 1684 1683 if (!fNoFinger && 1685 1686 1684 (SHORT1FROMMP(mp1) >= IDM_DRIVEA && 1685 SHORT1FROMMP(mp1) < IDM_DRIVEA + 26)) 1687 1686 return MRFROMLONG(hptrFinger); 1688 1687 break; … … 1694 1693 *dv = 0; 1695 1694 WinQueryWindowText(WinWindowFromID(hwnd, SHORT1FROMMP(mp1) + 50), 1696 1695 2, dv); 1697 1696 if (isalpha(*dv)) { 1698 1697 1699 1700 1701 1702 1703 1704 1705 1706 1707 1698 HWND hwndActive; 1699 1700 dv[1] = ':'; 1701 dv[2] = '\\'; 1702 dv[3] = 0; 1703 hwndActive = TopWindow(hwnd, (HWND) 0); 1704 if (hwndActive) 1705 WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT), 1706 UM_DRIVECMD, MPFROMP(dv), MPVOID); 1708 1707 } 1709 1708 } … … 1733 1732 case WM_MOUSEMOVE: 1734 1733 if (fDrivebarHelp && 1735 1736 1737 1734 (!hwndBubble || 1735 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 1736 !WinQueryCapture(HWND_DESKTOP)) { 1738 1737 id = WinQueryWindowUShort(hwnd, QWS_ID); 1739 1738 if (helpid != id) { 1740 1741 1739 helpid = id; 1740 PostMsg(MainObjectHwnd, UM_SETUP6, MPFROMLONG((ULONG) hwnd), MPVOID); 1742 1741 } 1743 1742 else 1744 1743 helpid = 0; 1745 1744 } 1746 1745 break; … … 1749 1748 if (helpid == WinQueryWindowUShort(hwnd, QWS_ID)) { 1750 1749 if ((char *)mp1 && 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1750 (!hwndBubble || 1751 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 1752 !WinQueryCapture(HWND_DESKTOP)) { 1753 1754 RECTL rcl; 1755 POINTL ptl; 1756 1757 WinQueryPointerPos(HWND_DESKTOP, &ptl); 1758 WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1); 1759 WinQueryWindowRect(hwnd, &rcl); 1760 if (WinPtInRect(WinQueryAnchorBlock(hwnd), &rcl, &ptl)) 1761 BubbleHelp(hwnd, FALSE, TRUE, FALSE, (char *)mp1); 1763 1762 } 1764 1763 } … … 1779 1778 *szDrv = 0; 1780 1779 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1781 1780 id + 50), sizeof(szDrv), szDrv); 1782 1781 if (isalpha(*szDrv)) { 1783 1782 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, MAIN_DRIVES); 1784 1783 if (hwndMenu) { 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1784 BOOL rdy; 1785 CHAR chDrv = *szDrv; 1786 UINT iDrv; 1787 1788 strcpy(szDrv + 2, "\\"); 1789 MakeValidDir(szDrv); 1790 // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c 1791 rdy = toupper(*szDrv) == toupper(chDrv); 1792 iDrv = toupper(*szDrv) - 'A'; 1793 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOTE) 1794 WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE); 1795 1796 if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE) { 1797 WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE); 1798 WinEnableMenuItem(hwndMenu, IDM_FORMAT, FALSE); 1799 WinEnableMenuItem(hwndMenu, IDM_OPTIMIZE, FALSE); 1800 WinEnableMenuItem(hwndMenu, IDM_UNDELETE, FALSE); 1801 } 1802 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOVABLE) { 1803 WinEnableMenuItem(hwndMenu, IDM_EJECT, FALSE); 1804 WinEnableMenuItem(hwndMenu, IDM_LOCK, FALSE); 1805 WinEnableMenuItem(hwndMenu, IDM_UNLOCK, FALSE); 1806 } 1807 if (!rdy) { 1808 WinEnableMenuItem(hwndMenu, IDM_INFO, FALSE); 1809 WinEnableMenuItem(hwndMenu, IDM_ARCHIVE, FALSE); 1810 WinEnableMenuItem(hwndMenu, IDM_SIZES, FALSE); 1811 WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE); 1812 WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE); 1813 } 1814 /* fixme to be gone? 1815 if (!rdy || ~driveflags[iDrv] & DRIVE_CDROM) { 1816 WinEnableMenuItem(hwndMenu, IDM_CLOSETRAY, FALSE); 1817 } 1818 */ 1819 PopupMenu(hwnd, hwnd, hwndMenu); 1821 1820 } 1822 1821 } … … 1833 1832 *szDrv = 0; 1834 1833 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1835 1834 id + 50), sizeof(szDrv), szDrv); 1836 1835 if (isalpha(*szDrv)) { 1837 1836 strcat(szDrv, "\\"); 1838 1837 if (!FindDirCnrByName(szDrv, TRUE)) 1839 1838 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szDrv); 1840 1839 } 1841 1840 break; … … 1849 1848 *szDrv = 0; 1850 1849 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1851 1850 id + 50), sizeof(szDrv), szDrv); 1852 1851 if (isalpha(*szDrv)) { 1853 1852 strcat(szDrv, "\\"); … … 1860 1859 *szDrv = 0; 1861 1860 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1862 1861 id + 50), sizeof(szDrv), szDrv); 1863 1862 if (isalpha(*szDrv) && 1864 1863 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1865 1864 if (!emphasized) { 1866 1867 1865 emphasized = TRUE; 1866 DrawTargetEmphasis(hwnd, emphasized); 1868 1867 } 1869 1868 if (AcceptOneDrop(hwnd, mp1, mp2)) 1870 1869 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 1871 1870 return MRFROM2SHORT(DOR_NEVERDROP, 0); 1872 1871 } … … 1877 1876 *szDrv = 0; 1878 1877 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1879 1878 id + 50), sizeof(szDrv), szDrv); 1880 1879 if (isalpha(*szDrv) && 1881 1880 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1882 1881 if (emphasized) { 1883 1884 1882 emphasized = FALSE; 1883 DrawTargetEmphasis(hwnd, emphasized); 1885 1884 } 1886 1885 } … … 1891 1890 *szDrv = 0; 1892 1891 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1893 1892 id + 50), sizeof(szDrv), szDrv); 1894 1893 if (isalpha(*szDrv) && 1895 1894 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1896 1895 DropHelp(mp1, mp2, hwnd, GetPString(IDS_DRIVEDROPHELP)); 1897 1896 return 0; … … 1903 1902 *szDrv = 0; 1904 1903 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1905 1904 id + 50), sizeof(szDrv), szDrv); 1906 1905 if (isalpha(*szDrv) && 1907 1906 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1908 1907 1909 1908 CNRDRAGINFO cnd; … … 1912 1911 1913 1912 if (emphasized) { 1914 1915 1913 emphasized = FALSE; 1914 DrawTargetEmphasis(hwnd, emphasized); 1916 1915 } 1917 1916 memset(&cnd, 0, sizeof(cnd)); … … 1919 1918 cnd.pRecord = NULL; 1920 1919 li = DoFileDrop(hwnd, 1921 1922 1920 NULL, 1921 TRUE, MPFROM2SHORT(TREE_CNR, CN_DROP), MPFROMP(&cnd)); 1923 1922 CheckPmDrgLimit(cnd.pDragInfo); 1924 1923 if (li) { 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 1924 strcpy(li->targetpath, szDrv); 1925 strcat(li->targetpath, "\\"); 1926 if (li->list && li->list[0] && IsRoot(li->list[0])) 1927 li->type = DO_LINK; 1928 else if (fDragndropDlg && (!*li->arcname || !li->info)) { 1929 1930 CHECKLIST cl; 1931 1932 memset(&cl, 0, sizeof(cl)); 1933 cl.size = sizeof(cl); 1934 cl.flags = li->type; 1935 cl.list = li->list; 1936 cl.cmd = li->type; 1937 cl.prompt = li->targetpath; 1938 li->type = WinDlgBox(HWND_DESKTOP, 1939 hwndMain, 1940 DropListProc, 1941 FM3ModHandle, DND_FRAME, MPFROMP(&cl)); 1942 if (li->type == DID_ERROR) 1943 Win_Error(DND_FRAME, HWND_DESKTOP, pszSrcFile, __LINE__, 1944 "Drag & Drop Dialog"); 1945 if (!li->type) { 1946 FreeListInfo(li); 1947 return 0; 1948 } 1949 li->list = cl.list; 1950 if (!li->list || !li->list[0]) { 1951 FreeListInfo(li); 1952 return 0; 1953 } 1954 } 1955 else { 1956 if (!WinDlgBox(HWND_DESKTOP, 1957 hwndMain, 1958 WalkDlgProc, 1959 FM3ModHandle, 1960 WALK_FRAME, 1961 MPFROMP(li->targetpath)) || !*li->targetpath) { 1962 FreeListInfo(li); 1963 return 0; 1964 } 1965 } 1966 switch (li->type) { 1967 case DND_LAUNCH: 1968 strcat(li->targetpath, " %a"); 1969 ExecOnList(hwndMain, 1970 li->targetpath, PROMPT | WINDOWED, NULL, li->list, NULL, 1971 pszSrcFile, __LINE__); 1972 FreeList(li->list); 1973 li->list = NULL; 1974 break; 1975 case DO_LINK: 1976 if (fLinkSetsIcon) { 1977 li->type = IDM_SETICON; 1978 action = UM_MASSACTION; 1979 } 1980 else 1981 li->type = IDM_COMPARE; 1982 break; 1983 case DND_EXTRACT: 1984 if (*li->targetpath && !IsFile(li->targetpath)) 1985 li->type = IDM_EXTRACT; 1986 break; 1987 case DND_MOVE: 1988 li->type = IDM_MOVE; 1989 if (*li->targetpath && IsFile(li->targetpath) == 1) { 1990 action = UM_MASSACTION; 1991 li->type = IDM_ARCHIVEM; 1992 } 1993 break; 1994 case DND_WILDMOVE: 1995 li->type = IDM_WILDMOVE; 1996 if (*li->targetpath && IsFile(li->targetpath) == 1) { 1997 action = UM_MASSACTION; 1998 li->type = IDM_ARCHIVEM; 1999 } 2000 break; 2001 case DND_OBJECT: 2002 li->type = IDM_OBJECT; 2003 action = UM_MASSACTION; 2004 break; 2005 case DND_SHADOW: 2006 li->type = IDM_SHADOW; 2007 action = UM_MASSACTION; 2008 break; 2009 case DND_COMPARE: 2010 li->type = IDM_COMPARE; 2011 break; 2012 case DND_SETICON: 2013 action = UM_MASSACTION; 2014 li->type = IDM_SETICON; 2015 break; 2016 case DND_COPY: 2017 li->type = IDM_COPY; 2018 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2019 action = UM_MASSACTION; 2020 li->type = IDM_ARCHIVE; 2021 } 2022 break; 2023 case DND_WILDCOPY: 2024 li->type = IDM_WILDCOPY; 2025 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2026 action = UM_MASSACTION; 2027 li->type = IDM_ARCHIVE; 2028 } 2029 break; 2030 default: 2031 if (*li->arcname && li->info) { 2032 action = UM_MASSACTION; 2033 li->type = (li->type == DO_MOVE) ? IDM_FAKEEXTRACTM : 2034 IDM_FAKEEXTRACT; 2035 } 2036 else if (*li->targetpath && IsFile(li->targetpath) == 1) { 2037 action = UM_MASSACTION; 2038 li->type = (li->type == DO_MOVE) ? IDM_ARCHIVEM : IDM_ARCHIVE; 2039 } 2040 else 2041 li->type = (li->type == DO_MOVE) ? IDM_MOVE : IDM_COPY; 2042 break; 2043 } 2044 if (!li->list || !li->list[0]) 2045 FreeListInfo(li); 2046 else 2047 WinSendMsg(hwndTree, UM_ACTION, MPFROMP(li), MPFROMLONG(action)); 2049 2048 } 2050 2049 return 0; … … 2080 2079 for (x = 0; x < 26; x++) { 2081 2080 if ((ulDriveMap & (1L << x)) && !(driveflags[x] & DRIVE_IGNORE)) { 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 } 2137 } 2138 } 2081 if (x > 1) { 2082 if (driveflags[x] & DRIVE_CDROM) 2083 iconid = CDROM_ICON; 2084 else 2085 iconid = (driveflags[x] & DRIVE_REMOVABLE) ? 2086 REMOVABLE_ICON : 2087 (driveflags[x] & DRIVE_VIRTUAL) ? 2088 VIRTUAL_ICON : 2089 (driveflags[x] & DRIVE_REMOTE) ? 2090 REMOTE_ICON : 2091 (driveflags[x] & DRIVE_RAMDISK) ? 2092 RAMDISK_ICON : 2093 (driveflags[x] & DRIVE_ZIPSTREAM) ? 2094 ZIPSTREAM_ICON :DRIVE_ICON; 2095 } 2096 else 2097 iconid = FLOPPY_ICON; 2098 sprintf(s, "#%lu", iconid); 2099 hwndB = WinCreateWindow(hwndT, 2100 WC_DRIVEBUTTONS, 2101 s, 2102 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON, 2103 0, 2104 0, 2105 28, 2106 18, 2107 hwndT, HWND_TOP, y + IDM_DRIVEA, NULL, NULL); 2108 if (!hwndB) 2109 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 2110 IDS_WINCREATEWINDOW); 2111 else { 2112 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); 2113 sprintf(s, "%c:", (CHAR) x + 'A'); 2114 hwndB = WinCreateWindow(hwndT, 2115 WC_STATIC, 2116 s, 2117 SS_TEXT | DT_LEFT | DT_VCENTER, 2118 0, 2119 0, 2120 10, 2121 18, 2122 hwndT, 2123 HWND_TOP, y + IDM_DRIVEATEXT, NULL, NULL); 2124 if (!hwndB) 2125 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 2126 IDS_WINCREATEWINDOW); 2127 else { 2128 SetPresParams(hwndB, 2129 &RGBGREY, 2130 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT)); 2131 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); 2132 } 2133 y++; 2134 } 2135 } 2136 } // for 2137 } // if drivebar 2139 2138 PostMsg(WinQueryWindow(hwndT, QW_PARENT), 2140 2139 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 2141 2140 } 2142 2141 … … 2154 2153 WinQueryWindowRect(hwndT, &rcl); 2155 2154 xwidth = rcl.xRight - ((WinQuerySysValue(HWND_DESKTOP, 2156 2155 SV_CYSIZEBORDER) * 2) + 2); 2157 2156 } 2158 2157 henum = WinBeginEnumWindows(hwndT); … … 2163 2162 ctrlxsize = 28; 2164 2163 WinSetWindowPos(hwndB, 2165 2166 2164 HWND_TOP, 2165 ctrlxpos, ctrlypos, ctrlxsize, 18, SWP_MOVE | SWP_SHOW); 2167 2166 ctrlxpos += (ctrlxsize + 2); 2168 2167 if (ctrlxsize == 10) { 2169 2168 if (ctrlxpos + (42 + ((fShowTarget && DriveLines == 0) ? 2170 2171 2172 2173 2169 256 : 0)) > xwidth) { 2170 ctrlxpos = 2; 2171 ctrlypos += 18; 2172 DriveLines++; 2174 2173 } 2175 2174 } … … 2190 2189 2191 2190 SetPresParams(hwnd, 2192 2193 2191 &RGBGREY, 2192 &RGBBLACK, &RGBGREY, GetPString(IDS_8HELVBOLDTEXT)); 2194 2193 return mr; 2195 2194 } … … 2201 2200 2202 2201 cbRetLen = WinQueryPresParam(hwnd, 2203 2204 2205 2206 2202 (ULONG) mp1, 2203 0, 2204 &AttrFound, 2205 (ULONG) sizeof(AttrValue), &AttrValue, 0); 2207 2206 if (cbRetLen) { 2208 2209 2210 2211 2212 // JBS2 2207 //switch (AttrFound) { 2208 //case PP_FONTNAMESIZE: 2209 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 2210 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 2211 // JBS2 break; 2213 2212 2214 2213 } … … 2228 2227 WinQueryWindowPos(hwndTree, &swp); 2229 2228 if (!(swp.fl & SWP_MAXIMIZE)) 2230 2229 fl |= SWP_RESTORE; 2231 2230 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 0, 0, fl); 2232 2231 } … … 2261 2260 2262 2261 if (fOtherHelp) { 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2262 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 2263 && !WinQueryCapture(HWND_DESKTOP)) { 2264 switch (id) { 2265 case IDM_ATTRS: 2266 if (WinQueryWindowTextLength(hwnd)) 2267 s = GetPString(IDS_ATTRSBUTTONHELP); 2268 break; 2269 case IDM_INFO: 2270 if (WinQueryWindowTextLength(hwnd)) 2271 s = GetPString(IDS_INFOBUTTONHELP); 2272 break; 2273 case IDM_RENAME: 2274 if (WinQueryWindowTextLength(hwnd)) 2275 s = GetPString(IDS_NAMEBUTTONHELP); 2276 break; 2277 case MAIN_STATUS2: 2278 if (!hwndE) 2279 s = GetPString(IDS_STATUS2HELP); 2280 break; 2281 default: 2282 break; 2283 } 2284 if (s) 2285 MakeBubble(hwnd, FALSE, s); 2286 else if (hwndBubble) 2287 WinDestroyWindow(hwndBubble); 2288 } 2290 2289 } 2291 2290 switch (id) { … … 2294 2293 case IDM_RENAME: 2295 2294 case MAIN_STATUS2: 2296 2295 return CommonTextProc(hwnd, msg, mp1, mp2); 2297 2296 default: 2298 2297 break; 2299 2298 } 2300 2299 } … … 2319 2318 case IDM_RENAME: 2320 2319 case MAIN_STATUS2: 2321 2320 return CommonTextButton(hwnd, msg, mp1, mp2); 2322 2321 default: 2323 2324 2322 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 2323 break; 2325 2324 } 2326 2325 } … … 2334 2333 id = WinQueryWindowUShort(hwnd, QWS_ID); 2335 2334 if (id == MAIN_STATUS2 && hwndE) 2336 2335 WinSendMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2337 2336 else 2338 2337 return CommonTextButton(hwnd, msg, mp1, mp2); 2339 2338 } 2340 2339 break; … … 2346 2345 id = WinQueryWindowUShort(hwnd, QWS_ID); 2347 2346 if (id == MAIN_STATUS) { 2348 2349 2350 2351 2352 2353 2347 if (SHORT2FROMMP(mp2) & KC_CTRL) 2348 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2349 FID_CLIENT), 2350 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID); 2351 else if (hwndTree) 2352 PostMsg(hwndTree, UM_TIMER, MPVOID, MPVOID); 2354 2353 } 2355 2354 } … … 2364 2363 if (id == MAIN_STATUS2 && !hwndE) { 2365 2364 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2365 SWP swp; 2366 CHAR directory[CCHMAXPATH]; 2367 PFNWP oldproce; 2368 2369 *directory = 0; 2370 TopWindowName(hwndMain, (HWND) 0, directory); 2371 WinQueryWindowPos(hwnd, &swp); 2372 hwndB = WinCreateWindow(hwnd, 2373 WC_BUTTON, 2374 "+", 2375 WS_VISIBLE | BS_PUSHBUTTON | 2376 BS_NOPOINTERFOCUS, 2377 swp.cx - swp.cy, 2378 0, 2379 swp.cy, 2380 swp.cy, 2381 hwnd, HWND_TOP, COMMAND_BUTTON, NULL, NULL); 2382 if (!hwndB) 2383 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 2384 hwndE = WinCreateWindow(hwnd, 2385 WC_ENTRYFIELD, 2386 NULL, 2387 WS_VISIBLE | ES_AUTOSCROLL, 2388 0, 2389 0, 2390 swp.cx - swp.cy, 2391 swp.cy, 2392 hwnd, HWND_TOP, COMMAND_LINE, NULL, NULL); 2393 if (!hwndE) 2394 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 2395 if (!hwndE || !hwndB) { 2396 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2397 return 0; 2398 } 2399 WinSendMsg(hwndE, EM_SETTEXTLIMIT, MPFROM2SHORT(1024, 0), MPVOID); 2400 WinSetWindowText(hwndStatus, directory); 2401 if (*lastcmd) 2402 WinSetWindowText(hwndE, lastcmd); 2403 else 2404 WinSetWindowText(hwndE, GetPString(IDS_HELPCMDTEXT)); 2405 oldproce = WinSubclassWindow(hwndE, (PFNWP) CommandLineProc); 2406 if (oldproce) 2407 WinSetWindowPtr(hwndE, QWL_USER, (PVOID) oldproce); 2408 PostMsg(hwndE, UM_FOCUSME, MPVOID, MPVOID); 2409 PostMsg(hwndE, EM_SETSEL, MPFROM2SHORT(0, 1024), MPVOID); 2410 return 0; 2412 2411 } 2413 2412 if (msg == UM_CLICKED3 || (SHORT2FROMMP(mp2) & KC_CTRL)) { 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2413 switch (id) { 2414 case IDM_ATTRS: 2415 id = IDM_SORTSIZE; 2416 break; 2417 case IDM_INFO: 2418 id = IDM_SORTLWDATE; 2419 break; 2420 case IDM_RENAME: 2421 id = IDM_SORTFILENAME; 2422 break; 2423 } 2425 2424 } 2426 2425 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 2427 2426 WM_COMMAND, MPFROM2SHORT(id, 0), MPVOID); 2428 2427 } 2429 2428 return 0; … … 2439 2438 case IDM_RENAME: 2440 2439 case MAIN_STATUS2: 2441 2442 2440 PaintRecessedWindow(hwnd, (HPS) 0, TRUE, FALSE); 2441 break; 2443 2442 default: 2444 2445 2443 PaintRecessedWindow(hwnd, (HPS) 0, FALSE, TRUE); 2444 break; 2446 2445 } 2447 2446 if (id == IDM_RENAME) { 2448 2447 2449 2450 2451 2452 2453 2454 2455 2456 2448 HPS hps; 2449 2450 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 2451 if (hps) { 2452 PaintSTextWindow(hwnd, hps); 2453 WinEndPaint(hps); 2454 } 2455 return 0; 2457 2456 } 2458 2457 } … … 2487 2486 case UM_COMMAND: 2488 2487 return WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2489 2488 FID_CLIENT), msg, mp1, mp2); 2490 2489 2491 2490 case WM_PAINT: … … 2523 2522 tool = find_tool(id); 2524 2523 if (tool) { 2525 2526 2527 2528 2529 2524 del_tool(tool); 2525 WinShowWindow(WinWindowFromID(hwnd, id), FALSE); 2526 if (fToolTitles) 2527 WinShowWindow(WinWindowFromID(hwnd, id + 25000), FALSE); 2528 ResizeTools(hwnd); 2530 2529 } 2531 2530 } … … 2537 2536 2538 2537 id = (USHORT) WinDlgBox(HWND_DESKTOP, 2539 2540 2541 2538 hwnd, 2539 AddToolProc, 2540 FM3ModHandle, ADDBTN_FRAME, MPVOID); 2542 2541 if (id && id != (USHORT) - 1) 2543 2544 2545 2546 2542 WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2543 FID_CLIENT), 2544 WM_COMMAND, 2545 MPFROM2SHORT(IDM_CREATETOOL, 0), MPFROM2SHORT(id, 0)); 2547 2546 } 2548 2547 break; … … 2550 2549 case WM_CONTEXTMENU: 2551 2550 if (WinDlgBox(HWND_DESKTOP, 2552 2551 hwnd, ToolIODlgProc, FM3ModHandle, SVBTN_FRAME, MPVOID)) 2553 2552 BuildTools(hwnd, TRUE); 2554 2553 return MRFROMSHORT(TRUE); … … 2573 2572 if (pswp) { 2574 2573 if (WinQueryWindowPos(hwndTree, &swp) && 2575 2574 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE))) { 2576 2575 pswp->x = swp.cx; 2577 2576 pswp->cx -= swp.cx; … … 2580 2579 if (prectl) { 2581 2580 if (WinQueryWindowPos(hwndTree, &swp) && 2582 2583 2581 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE)) && 2582 WinQueryWindowRect(hwndTree, &rectl)) { 2584 2583 prectl->xLeft = rectl.xRight; 2585 2584 prectl->xRight -= rectl.xRight; … … 2633 2632 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 2634 2633 if (swp.x < swpT.cx) { 2635 2636 2637 2638 2639 2640 2634 swp.x = swpT.cx; 2635 if (swp.x + swp.cx > swpC.cx) 2636 swp.cx = swpC.cx - swp.x; 2637 if (swp.cx > 24) 2638 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 2639 SWP_SIZE | SWP_MOVE | SWP_SHOW); 2641 2640 } 2642 2641 } … … 2658 2657 WinSetWindowUShort(hwndChild, QWS_YMINIMIZE, (USHORT) - 1); 2659 2658 WinSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0, 2660 2659 SWP_MOVE | SWP_SHOW | SWP_FOCUSDEACTIVATE); 2661 2660 } 2662 2661 } … … 2680 2679 if (hwndNext) { 2681 2680 if (!WinQueryWindowUShort(hwndNext, QWS_ID)) 2682 2681 continue; 2683 2682 if (next) 2684 2683 break; 2685 2684 if (hwndNext == hwndActive) { 2686 2687 2688 2689 2690 2691 2685 if (!previous && hwndPrev) { 2686 hwndNext = hwndPrev; 2687 break; 2688 } 2689 else if (previous) 2690 next = TRUE; 2692 2691 } 2693 2692 hwndPrev = hwndNext; … … 2695 2694 else { 2696 2695 if ((!next && previous) || once) 2697 2696 break; 2698 2697 else if (!previous) { 2699 2700 2698 hwndNext = hwndPrev; 2699 break; 2701 2700 } 2702 2701 else 2703 2702 once = next = TRUE; 2704 2703 } 2705 2704 } … … 2708 2707 if (hwndNext && hwndNext != hwndActive) { 2709 2708 WinSetWindowPos(hwndNext, HWND_TOP, 0, 0, 0, 0, 2710 2709 SWP_ZORDER | SWP_ACTIVATE); 2711 2710 WinSetWindowPos(hwndActive, ((previous) ? HWND_BOTTOM : hwndNext), 0, 0, 2712 2711 0, 0, SWP_ZORDER); 2713 2712 } 2714 2713 } … … 2725 2724 if (hwndChild != hwndTree) { 2726 2725 WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2727 2726 WM_SAVEAPPLICATION, MPVOID, MPVOID); 2728 2727 if (WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2729 2730 2731 2728 WM_CLOSE, MPVOID, MPVOID)) { 2729 ret = TRUE; 2730 break; 2732 2731 } 2733 2732 } … … 2752 2751 hwndTemp = WinWindowFromID(hwndChild, FID_CLIENT); 2753 2752 if (hwndTemp) { 2754 2755 2756 2757 2758 2759 2753 hwndDir = WinWindowFromID(hwndTemp, DIR_CNR); 2754 if (hwndDir) { 2755 WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2756 WM_CLOSE, MPVOID, MPVOID); 2757 ret = TRUE; 2758 } 2760 2759 } 2761 2760 } … … 2773 2772 */ 2774 2773 2775 #define STATE_NAME_MAX_BYTES 2774 #define STATE_NAME_MAX_BYTES 256 2776 2775 2777 2776 INT SaveDirCnrState(HWND hwndClient, PSZ pszStateName) … … 2802 2801 hwndC = WinWindowFromID(hwndChild, FID_CLIENT); 2803 2802 if (hwndC) { 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2803 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 2804 if (hwndDir) { 2805 WinQueryWindowPos(hwndChild, &swp); 2806 *szDir = 0; 2807 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(szDir), MPVOID); 2808 if (*szDir) { 2809 if (driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) 2810 continue; 2811 sprintf(szKey, "%sDirCnrPos.%lu", szPrefix, numsaves); 2812 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & swp, 2813 sizeof(SWP)); 2814 dcd = 2815 WinQueryWindowPtr(WinWindowFromID(hwndC, DIR_CNR), QWL_USER); 2816 if (dcd) { 2817 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, numsaves); 2818 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->sortFlags, 2819 sizeof(INT)); 2820 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, numsaves); 2821 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->mask, 2822 sizeof(MASK)); 2823 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, numsaves); 2824 flWindowAttr = dcd->flWindowAttr; 2825 if (!fLeaveTree && (flWindowAttr & CV_TREE)) { 2826 flWindowAttr &= (~(CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT)); 2827 if (dcd->lastattr) { 2828 if (dcd->lastattr & CV_TEXT) 2829 flWindowAttr |= CV_TEXT; 2830 else if (dcd->lastattr & CV_DETAIL) 2831 flWindowAttr |= CV_DETAIL; 2832 else if (dcd->lastattr & CV_ICON) 2833 flWindowAttr |= CV_ICON; 2834 else 2835 flWindowAttr |= CV_NAME; 2836 } 2837 else 2838 flWindowAttr |= CV_NAME; 2839 } 2840 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & flWindowAttr, 2841 sizeof(ULONG)); 2843 2842 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, numsaves); 2844 2843 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslongname, … … 2879 2878 sprintf(szKey, "%sDirCnr.%lu", szPrefix, numsaves); 2880 2879 SavePresParams(hwndDir, szKey); 2881 2882 2883 2884 2885 2886 2880 } 2881 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, numsaves++); 2882 PrfWriteProfileString(fmprof, FM3Str, szKey, szDir); 2883 nSaved++; 2884 } 2885 } 2887 2886 } 2888 2887 } … … 2926 2925 if (hwnd) { 2927 2926 if (WinQueryWindowPos(hwnd, &swp)) { 2928 2929 2930 2931 2932 2933 2934 2935 2927 if (pswp->x > swp.cx) 2928 pswp->x = (swp.cx > 24) ? swp.cx - 24 : swp.cx; 2929 if (pswp->y > swp.cy) 2930 pswp->y = (swp.cy > 24) ? swp.cy - 24 : swp.cy; 2931 if (pswp->x + pswp->cx > swp.cx) 2932 pswp->cx = swp.cx - pswp->x; 2933 if (pswp->y + pswp->cy > swp.cy) 2934 pswp->cy = swp.cy - pswp->y; 2936 2935 } 2937 2936 } … … 2971 2970 sprintf(szKey, "%sMySizeLastTime", szPrefix); 2972 2971 if (!PrfQueryProfileData(fmprof, 2973 2974 2975 2976 2972 FM3Str, 2973 szKey, 2974 (PVOID) & swpO, 2975 &size) || 2977 2976 size != sizeof(SWP) || !swp.cx || !swp.cy) 2978 2977 { … … 3001 3000 swp.fl &= (~SWP_ACTIVATE); 3002 3001 WinSetWindowPos(hwndTree, 3003 3004 3005 3006 3007 3008 3002 HWND_TOP, 3003 swp.x, 3004 swp.y, 3005 swp.cx, 3006 swp.cy, 3007 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER); 3009 3008 } 3010 3009 else { 3011 3010 WinSetWindowPos(hwndTree, 3012 3011 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW); 3013 3012 WinSetWindowUShort(hwndTree, QWS_XRESTORE, (USHORT) swp.x); 3014 3013 WinSetWindowUShort(hwndTree, QWS_CXRESTORE, (USHORT) swp.cx); … … 3020 3019 sprintf(szKey, "%sNumDirsLastTime", szPrefix); 3021 3020 if (PrfQueryProfileData(fmprof, 3022 3021 FM3Str, szKey, (PVOID) & numsaves, &size) && numsaves) { 3023 3022 if (!pszStateName || !strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT))) 3024 3023 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); … … 3027 3026 size = sizeof(SWP); 3028 3027 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) & swp, &size)) { 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3028 if (!pszStateName || !strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT))) 3029 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3030 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, x); 3031 size = sizeof(szDir); 3032 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) szDir, &size)) { 3033 if (!pszStateName || !strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT))) 3034 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3035 if (driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) { 3036 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3037 continue; 3038 } 3040 3039 localdcd.detailslongname = detailslongname; // Set default 3041 3040 size = sizeof(BOOL); … … 3048 3047 { 3049 3048 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3050 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3049 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3051 3050 } 3052 3051 localdcd.detailssubject = detailssubject; // Set default … … 3060 3059 { 3061 3060 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3062 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3061 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3063 3062 } 3064 3063 localdcd.detailsea = detailsea; // Set default … … 3072 3071 { 3073 3072 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3074 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3073 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3075 3074 } 3076 3075 localdcd.detailssize = detailssize; // Set default … … 3084 3083 { 3085 3084 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3086 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3085 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3087 3086 } 3088 3087 localdcd.detailsicon = detailsicon; // Set default … … 3096 3095 { 3097 3096 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3098 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3097 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3099 3098 } 3100 3099 localdcd.detailsattr = detailsattr; // Set default … … 3108 3107 { 3109 3108 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3110 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3109 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3111 3110 } 3112 3111 localdcd.detailscrdate = detailscrdate; // Set default … … 3120 3119 { 3121 3120 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3122 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3121 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3123 3122 } 3124 3123 localdcd.detailscrtime = detailscrtime; // Set default … … 3132 3131 { 3133 3132 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3134 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3133 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3135 3134 } 3136 3135 localdcd.detailslwdate = detailslwdate; // Set default … … 3144 3143 { 3145 3144 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3146 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3145 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3147 3146 } 3148 3147 localdcd.detailslwtime = detailslwtime; // Set default … … 3156 3155 { 3157 3156 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3158 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3157 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3159 3158 } 3160 3159 localdcd.detailsladate = detailsladate; // Set default … … 3168 3167 { 3169 3168 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3170 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3169 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3171 3170 } 3172 3171 localdcd.detailslatime = detailslatime; // Set default … … 3180 3179 { 3181 3180 if (!pszStateName || !strcmp(pszStateName, FM2_STATE_AT_CLOSE)) 3182 JBSDBGPrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3181 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3183 3182 } 3184 3183 sprintf(szKey, "%sDirCnr.%lu", szPrefix, x); 3185 3184 RestorePresParams(hwndClient, szKey); 3186 3185 SavePresParams(hwndClient, "DirCnr"); 3187 3188 3189 3190 3191 3192 3186 hwndDir = (HWND) WinSendMsg(hwndClient, 3187 UM_SETDIR, 3188 MPFROMP(szDir), MPFROMLONG(1)); 3189 if (hwndDir) { 3190 hwndC = WinWindowFromID(hwndDir, FID_CLIENT); 3191 if (hwndC) { 3193 3192 HWND hwndCnr = WinWindowFromID(hwndC, DIR_CNR); 3194 3193 dcd = WinQueryWindowPtr(hwndCnr, QWL_USER); 3195 3194 if (dcd) { 3196 3195 dcd->detailslongname = localdcd.detailslongname; 3197 3196 dcd->detailssubject = localdcd.detailssubject ; … … 3206 3205 dcd->detailslwdate = localdcd.detailslwdate ; 3207 3206 dcd->detailslwtime = localdcd.detailslwtime ; 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3207 size = sizeof(INT); 3208 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, x); 3209 if (PrfQueryProfileData(fmprof, 3210 FM3Str, 3211 szKey, 3212 (PVOID) & dcd->sortFlags, 3213 &size) && size == sizeof(INT)) { 3214 if (!dcd->sortFlags) 3215 dcd->sortFlags = SORT_PATHNAME; 3216 } 3217 if (!pszStateName || !strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT))) 3218 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3219 size = sizeof(MASK); 3220 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, x); 3221 if (PrfQueryProfileData(fmprof, 3222 FM3Str, 3223 szKey, 3224 (PVOID) & dcd->mask, &size) && size) { 3225 if (*dcd->mask.szMask) 3226 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3227 UM_FILTER, MPFROMP(dcd->mask.szMask), MPVOID); 3228 } 3229 *(dcd->mask.prompt) = 0; 3230 if (!pszStateName || !strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT))) 3231 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3232 size = sizeof(ULONG); 3233 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, x); 3234 if (!noview) { 3235 if (PrfQueryProfileData(fmprof, 3236 FM3Str, 3237 szKey, 3238 (PVOID) & dcd->flWindowAttr, 3239 &size) && size == sizeof(ULONG)) { 3240 3241 CNRINFO cnri; 3242 3243 memset(&cnri, 0, sizeof(CNRINFO)); 3244 cnri.cb = sizeof(CNRINFO); 3245 if (WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3246 CM_QUERYCNRINFO, 3247 MPFROMP(&cnri), 3248 MPFROMLONG(sizeof(CNRINFO)))) { 3249 cnri.flWindowAttr = dcd->flWindowAttr; 3250 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3251 CM_SETCNRINFO, 3252 MPFROMP(&cnri), 3253 MPFROMLONG(CMA_FLWINDOWATTR)); 3254 } 3255 } 3256 } 3257 if (!pszStateName || !strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT))) 3258 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3260 3259 if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL)) 3261 3260 WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL); 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3261 } 3262 } 3263 fRestored = TRUE; 3264 swp.hwnd = hwndDir; 3265 TransformSwp(&swp, xtrans, ytrans); 3266 if (!fAutoTile && !(swp.fl & (SWP_HIDE | SWP_MINIMIZE))) 3267 WinSetWindowPos(hwndDir, 3268 HWND_TOP, 3269 swp.x, 3270 swp.y, 3271 swp.cx, 3272 swp.cy, 3273 swp.fl | SWP_MOVE | 3274 SWP_SIZE | SWP_SHOW | SWP_ZORDER | 3275 SWP_ACTIVATE); 3276 else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) { 3277 WinSetWindowPos(hwndDir, 3278 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW); 3279 WinSetWindowUShort(hwndDir, QWS_XRESTORE, (USHORT) swp.x); 3280 WinSetWindowUShort(hwndDir, QWS_CXRESTORE, (USHORT) swp.cx); 3281 WinSetWindowUShort(hwndDir, QWS_YRESTORE, (USHORT) swp.y); 3282 WinSetWindowUShort(hwndDir, QWS_CYRESTORE, (USHORT) swp.cy); 3283 } 3284 else 3285 WinSetWindowPos(hwndDir, 3286 HWND_TOP, 3287 0, 0, 0, 0, SWP_ZORDER | SWP_ACTIVATE); 3288 } 3289 } 3291 3290 } 3292 3291 } // for … … 3313 3312 if (ulNumMinChildren) { 3314 3313 if (WinQueryWindowPos(hwndChild, &swp) && (swp.fl & SWP_MINIMIZE)) 3315 3314 (*ulNumMinChildren)++; 3316 3315 } 3317 3316 } … … 3321 3320 3322 3321 VOID GetNextWindowPos(HWND hwndClient, PSWP pswp, ULONG * ulCntR, 3323 3322 ULONG * ulNumMinChildrenR) 3324 3323 { 3325 3324 register ULONG ulCnt; … … 3385 3384 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 3386 3385 if (swp.y + swp.cy < Rectl.yTop - Rectl.yBottom) 3387 3386 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3388 3387 if (swp.x != 0) 3389 3388 swp.x = 0; 3390 3389 if (swp.y < 0) 3391 3390 swp.y = 0; 3392 3391 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3393 3392 swp.cx = Rectl.xRight - Rectl.xLeft; 3394 3393 WinSetWindowPos(hwndTree, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3395 3394 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3396 3395 } 3397 3396 } … … 3405 3404 GetNextWindowPos(hwndClient, &swp, &ulCnt, &ulNumMinChildren); 3406 3405 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3407 3408 3406 SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_RESTORE | 3407 SWP_ZORDER | SWP_ACTIVATE); 3409 3408 ulCnt++; 3410 3409 } … … 3459 3458 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 3460 3459 if (swp.y < 0) 3461 3460 swp.y = 0; 3462 3461 if (swp.y + swp.cy < Rectl.yTop - Rectl.yBottom) 3463 3462 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3464 3463 if (swp.x != 0) 3465 3464 swp.x = 0; 3466 3465 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3467 3466 swp.cx = Rectl.xRight - Rectl.xLeft; 3468 3467 WinSetWindowPos(hwndTree, 3469 3470 3471 3472 3473 3468 HWND_TOP, 3469 swp.x, 3470 swp.y, 3471 swp.cx, 3472 swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3474 3473 WinQueryWindowPos(hwndTree, &swp); 3475 3474 } … … 3496 3495 3497 3496 for (ulCurRow = 0; ulCurRow < ulNumRows; ulCurRow++) { 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3497 if ((ulNumRows - ulCurRow) <= ulExtraCols) 3498 ulNumCols++; 3499 for (ulCurCol = 0; ulCurCol < ulNumCols; ulCurCol++) { 3500 ulWidth = Rectl.xRight / ulNumCols; 3501 3502 while (hwndChild) { 3503 id = WinQueryWindowUShort(hwndChild, QWS_ID); 3504 if (id && (id != TREE_FRAME || fFreeTree)) { 3505 WinQueryWindowPos(hwndChild, &swp); 3506 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE))) 3507 break; 3508 } 3509 hwndChild = WinGetNextWindow(henum); 3510 } 3511 3512 if (hwndChild) { 3513 if (!absolute && (swp.fl & SWP_MAXIMIZE)) { 3514 WinGetMaxPosition(hwndChild, &swp); 3515 WinSetWindowPos(hwndChild, 3516 HWND_TOP, 3517 swp.x, 3518 swp.y, 3519 swp.cx, swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 3520 WinSetWindowUShort(hwndChild, 3521 QWS_XRESTORE, 3522 (USHORT) (ulWidth * ulCurCol) + Rectl.xLeft); 3523 WinSetWindowUShort(hwndChild, 3524 QWS_YRESTORE, 3525 (USHORT) (Rectl.yTop - 3526 (ulHeight * (ulCurRow + 1)))); 3527 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, (USHORT) ulWidth); 3528 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, (USHORT) ulHeight); 3529 } 3530 else 3531 WinSetWindowPos(hwndChild, 3532 HWND_TOP, 3533 (ulWidth * ulCurCol) + Rectl.xLeft, 3534 Rectl.yTop - (ulHeight * (ulCurRow + 1)), 3535 ulWidth, 3536 ulHeight, 3537 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3538 hwndChild = WinGetNextWindow(henum); 3539 } 3540 } 3541 if ((ulNumRows - ulCurRow) <= ulExtraCols) { 3542 ulNumCols--; 3543 ulExtraCols--; 3544 } 3546 3545 } 3547 3546 } … … 3553 3552 3554 3553 static VOID ResizeChildren(HWND hwndClient, SHORT oldcx, SHORT oldcy, 3555 3554 SHORT newcx, SHORT newcy) 3556 3555 { 3557 3556 /* … … 3571 3570 while ((hwndChild = WinGetNextWindow(henum)) != NULLHANDLE) { 3572 3571 if (!WinQueryWindowUShort(hwndChild, QWS_ID)) 3573 3572 continue; 3574 3573 if (WinQueryWindowPos(hwndChild, &swp)) { 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3574 if (swp.fl & (SWP_MINIMIZE | SWP_HIDE)) { 3575 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE); 3576 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE); 3577 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE); 3578 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE); 3579 } 3580 else if (swp.fl & SWP_MAXIMIZE) { 3581 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE); 3582 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE); 3583 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE); 3584 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE); 3585 } 3586 cx = (swp.cx) ? (LONG) (((double)oldcx * 100.0) / (double)swp.cx) : 0; 3587 cy = (swp.cy) ? (LONG) (((double)oldcy * 100.0) / (double)swp.cy) : 0; 3588 x = (swp.x) ? (LONG) (((double)oldcx * 100.0) / (double)swp.x) : 0; 3589 y = (swp.y) ? (LONG) (((double)oldcy * 100.0) / (double)swp.y) : 0; 3590 if (x < 0) 3591 x = 0; 3592 if (y < 0) 3593 y = 0; 3594 ux = (x) ? (LONG) (((double)newcx * 100.0) / (double)x) : 0; 3595 uy = (y) ? (LONG) (((double)newcy * 100.0) / (double)y) : 0; 3596 ucx = (cx) ? (LONG) (((double)newcx * 100.0) / (double)cx) : 0; 3597 ucy = (cy) ? (LONG) (((double)newcy * 100.0) / (double)cy) : 0; 3598 if (ux + ucx > newcx) 3599 ucx = newcx - ux; 3600 if (uy + ucy > newcy) 3601 ucy = newcy - uy; 3602 3603 if (!(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE))) 3604 WinSetWindowPos(hwndChild, HWND_TOP, ux, uy, ucx, ucy, 3605 SWP_MOVE | SWP_SIZE | SWP_SHOW); 3606 else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) { 3607 WinSetWindowUShort(hwndChild, QWS_XMINIMIZE, (USHORT) - 1); 3608 WinSetWindowUShort(hwndChild, QWS_YMINIMIZE, (USHORT) - 1); 3609 WinSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0, 3610 SWP_SIZE | SWP_MOVE | SWP_FOCUSDEACTIVATE); 3611 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux); 3612 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy); 3613 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx); 3614 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy); 3615 } 3616 else { 3617 WinGetMaxPosition(hwndChild, &swp); 3618 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3619 SWP_MOVE | SWP_SIZE | SWP_SHOW); 3620 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux); 3621 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy); 3622 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx); 3623 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy); 3624 } 3626 3625 } 3627 3626 } … … 3638 3637 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 3639 3638 if (swp.y + swp.cy < Rectl.yTop - Rectl.yBottom) 3640 3639 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3641 3640 if (swp.x != 0) 3642 3641 swp.x = 0; 3643 3642 if (swp.y < 0) 3644 3643 swp.y = 0; 3645 3644 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3646 3645 swp.cx = Rectl.xRight - Rectl.xLeft; 3647 3646 WinSetWindowPos(hwndTree, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3648 3647 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3649 3648 } 3650 3649 } … … 3674 3673 3675 3674 static MRESULT EXPENTRY ChildFrameButtonProc(HWND hwnd, 3676 3677 3675 ULONG msg, 3676 MPARAM mp1, MPARAM mp2) 3678 3677 { 3679 3678 USHORT id; … … 3689 3688 if (fOtherHelp) { 3690 3689 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3690 && !WinQueryCapture(HWND_DESKTOP)) { 3691 id = WinQueryWindowUShort(hwnd, QWS_ID); 3692 switch (id) { 3693 case IDM_OPENWALK: 3694 MakeBubble(hwnd, FALSE, GetPString(IDS_WALKBUTTONHELP)); 3695 break; 3696 case IDM_USERLIST: 3697 MakeBubble(hwnd, FALSE, GetPString(IDS_QUICKBUTTONHELP)); 3698 break; 3699 } 3701 3700 } 3702 3701 } … … 3712 3711 switch (id) { 3713 3712 case IDM_OPENWALK: 3714 3715 3716 3717 3718 3719 3720 3713 switch (msg) { 3714 case WM_BUTTON2CLICK: 3715 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) == 3716 (KC_ALT | KC_SHIFT | KC_CTRL)) 3717 cmd = IDM_GREP; 3718 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL)) 3719 CascadeChildren(hwndMain); 3721 3720 3722 3721 #ifdef NEVER 3723 3724 3722 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT)) 3723 cmd = IDM_SYSINFO; 3725 3724 #endif 3726 3725 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3726 else if (shiftstate & KC_SHIFT) 3727 cmd = IDM_WINDOWDLG; 3728 else if (shiftstate & KC_CTRL) 3729 cmd = IDM_SEEALL; 3730 else if (shiftstate & KC_ALT) 3731 TileChildren(hwndMain, TRUE); 3732 else 3733 cmd = IDM_WALKDIR; 3734 break; 3735 case WM_BUTTON3CLICK: 3736 TileChildren(hwndMain, TRUE); 3737 break; 3738 } 3739 break; 3741 3740 case IDM_USERLIST: 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 } 3741 switch (msg) { 3742 case WM_BUTTON2CLICK: 3743 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) == 3744 (KC_ALT | KC_SHIFT | KC_CTRL)) 3745 cmd = IDM_COLORPALETTE; 3746 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL)) 3747 cmd = IDM_HIDEMENU; 3748 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT)) 3749 cmd = IDM_NOTEBOOK; 3750 else if (shiftstate & KC_SHIFT) 3751 cmd = IDM_TOOLTITLES; 3752 else if (shiftstate & KC_CTRL) 3753 cmd = IDM_TEXTTOOLS; 3754 else if (shiftstate & KC_ALT) 3755 cmd = IDM_FONTPALETTE; 3756 else 3757 cmd = IDM_TOOLBAR; 3758 break; 3759 case WM_BUTTON3CLICK: 3760 cmd = IDM_DRIVEBAR; 3761 break; 3762 } 3763 break; 3764 } // switch id 3766 3765 3767 3766 if (cmd) { 3768 3769 3767 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_CLIENT), 3768 WM_COMMAND, MPFROM2SHORT(cmd, 0), MPVOID); 3770 3769 } 3771 3770 } … … 3776 3775 if (id == IDM_OPENWALK) { 3777 3776 if (!emphasized) { 3778 3779 3777 emphasized = TRUE; 3778 DrawTargetEmphasis(hwnd, emphasized); 3780 3779 } 3781 3780 if (AcceptOneDrop(hwnd, mp1, mp2)) 3782 3781 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 3783 3782 } 3784 3783 return MRFROM2SHORT(DOR_NEVERDROP, 0); … … 3800 3799 3801 3800 if (emphasized) { 3802 3803 3801 emphasized = FALSE; 3802 DrawTargetEmphasis(hwnd, emphasized); 3804 3803 } 3805 3804 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 3806 3807 3808 3805 if (MakeValidDir(szFrom) && !FindDirCnrByName(szFrom, TRUE)) { 3806 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szFrom); 3807 } 3809 3808 } 3810 3809 } … … 3819 3818 3820 3819 static MRESULT EXPENTRY MainFrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, 3821 3820 MPARAM mp2) 3822 3821 { 3823 3822 PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER); … … 3831 3830 pswp = (SWP *) mp1; 3832 3831 if (fDataMin && !fAmClosing) { 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3832 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE)) { 3833 3834 SWP swp; 3835 3836 WinQueryWindowPos(hwnd, &swp); 3837 PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(swp.fl), MPVOID); 3838 HideNote(); 3839 } 3840 else if (pswp->fl & (SWP_SHOW | SWP_RESTORE)) { 3841 if (DataHwnd) 3842 PostMsg(DataHwnd, WM_CLOSE, MPVOID, MPVOID); 3843 } 3845 3844 } 3846 3845 if (!fAmClosing) { 3847 3848 3846 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE)) 3847 HideNote(); 3849 3848 } 3850 3849 } … … 3869 3868 case WM_CONTROL: 3870 3869 return WinSendMsg(WinWindowFromID(hwnd, FID_CLIENT), UM_CONTROL, mp1, 3871 3870 mp2); 3872 3871 3873 3872 case WM_COMMAND: … … 3889 3888 3890 3889 if (mr && mp2) { 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3890 prectl = (PRECTL) mp1; 3891 if (prectl->yBottom != prectl->yTop) { 3892 { 3893 HPS hps; 3894 POINTL aptl[TXTBOX_COUNT]; 3895 3896 hps = WinGetPS(hwndStatus); 3897 if (hps) { 3898 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 3899 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6; 3900 WinReleasePS(hps); 3901 } 3902 } 3903 prectl->yBottom += (sheight + 4); 3904 prectl->yTop -= (sheight + 4); 3905 if (fMoreButtons) { 3906 3907 HPS hps; 3908 POINTL aptl[TXTBOX_COUNT]; 3909 3910 hps = WinGetPS(hwndName); 3911 if (hps) { 3912 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 3913 bheight = aptl[TXTBOX_TOPLEFT].y + 6; 3914 WinReleasePS(hps); 3915 } 3916 prectl->yBottom += (bheight + 4); 3917 prectl->yTop -= (bheight + 4); 3918 } 3919 if (fToolbar) { 3920 if (!fTextTools) 3921 prectl->yTop -= ((fToolTitles) ? 50 : 40); 3922 else 3923 prectl->yTop -= 32; 3924 } 3925 if (fDrivebar) { 3926 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES), 3927 ((prectl->xRight - 3928 (WinQuerySysValue(HWND_DESKTOP, 3929 SV_CYSIZEBORDER) * 2)) - 4)); 3930 prectl->yTop -= (16 * (DriveLines * 18)); 3931 } 3932 if (fUserComboBox) { 3933 if (!aheight) { 3934 3935 SWP swpTemp; 3936 3937 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT), 3938 &swpTemp); 3939 aheight = swpTemp.cy; 3940 } 3941 prectl->yTop -= (aheight + 6L); 3942 } 3943 if (fAutoView) { 3944 AutoviewHeight = min(AutoviewHeight, 3945 (prectl->yTop - prectl->yBottom) - 116); 3946 AutoviewHeight = max(AutoviewHeight, 36); 3947 prectl->yBottom += (AutoviewHeight + 6); 3948 } 3949 } 3951 3950 } 3952 3951 return mr; … … 3972 3971 pswp = (PSWP) mp1; 3973 3972 { 3974 3975 3976 3977 3978 3979 3980 3981 3982 3973 SHORT x; 3974 3975 for (x = 0; x < soldCount; x++) { 3976 if (WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_CLIENT) { 3977 pswpClient = pswp; 3978 break; 3979 } 3980 pswp++; 3981 } 3983 3982 } 3984 3983 3985 3984 { 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 3985 HPS hps; 3986 POINTL aptl[TXTBOX_COUNT]; 3987 3988 hps = WinGetPS(hwndStatus); 3989 if (hps) { 3990 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 3991 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6; 3992 WinReleasePS(hps); 3993 } 3994 if (fMoreButtons) { 3995 hps = WinGetPS(hwndName); 3996 if (hps) { 3997 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 3998 bheight = aptl[TXTBOX_TOPLEFT].y + 6; 3999 WinReleasePS(hps); 4000 } 4001 } 4003 4002 } 4004 4003 pswpNew = (PSWP) mp1 + soldCount; … … 4010 4009 pswpNew->y = swpClient.y + 2; 4011 4010 if (!fSplitStatus) 4012 4011 width = swpClient.cx - (16 + (sheight * 2) + 4); 4013 4012 else 4014 4013 width = (swpClient.cx - (16 + (sheight * 2) + 4)) / 2; 4015 4014 width = max(width, 10); 4016 4015 if (fSplitStatus) 4017 4016 pswpNew->cx = width - 6; 4018 4017 else 4019 4018 pswpNew->cx = width - 8; 4020 4019 pswpNew->cy = sheight; 4021 4020 pswpClient->y = pswpNew->y + pswpNew->cy + 3; … … 4024 4023 4025 4024 if (fSplitStatus) { 4026 4027 4028 4029 4030 4031 4032 4033 4034 4025 pswpNew = (PSWP) mp1 + (soldCount + 1); 4026 *pswpNew = *pswpClient; 4027 pswpNew->hwnd = hwndStatus2; 4028 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4029 pswpNew->x = width + 8; 4030 pswpNew->y = swpClient.y + 2; 4031 pswpNew->cx = width - 6; 4032 pswpNew->cy = sheight; 4033 sCount++; 4035 4034 } 4036 4035 else { 4037 4038 4036 WinShowWindow(hwndStatus2, FALSE); 4037 WinSetWindowText(hwndStatus2, NullStr); 4039 4038 } 4040 4039 4041 4040 if (fToolbar) { 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4041 if (fTextTools) 4042 theight = 32L; 4043 else if (!fToolTitles) 4044 theight = 40L; 4045 pswpNew = (PSWP) mp1 + (soldCount + 1 + (fSplitStatus != FALSE)); 4046 *pswpNew = *pswpClient; 4047 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_TOOLS); 4048 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4049 pswpNew->x = swpClient.x + 2; 4050 pswpNew->y = (swpClient.y + swpClient.cy) - (theight - 2); 4051 pswpNew->cx = swpClient.cx - 4; 4052 pswpNew->cy = theight - 4; 4053 pswpClient->cy -= theight; 4054 sCount++; 4056 4055 } 4057 4056 else 4058 4057 WinShowWindow(WinWindowFromID(hwnd, MAIN_TOOLS), FALSE); 4059 4058 4060 4059 if (fDrivebar) { 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4060 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES), pswpClient->cx - 4); 4061 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4062 (fSplitStatus != FALSE) + 4063 (fToolbar != FALSE)); 4064 *pswpNew = *pswpClient; 4065 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_DRIVES); 4066 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4067 pswpNew->x = swpClient.x + 2; 4068 dheight += ((dheight - 2) * DriveLines); 4069 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight - 2); 4070 if (fToolbar) 4071 pswpNew->y -= theight; 4072 pswpNew->cx = swpClient.cx - 4; 4073 pswpNew->cy = dheight - 4; 4074 pswpClient->cy -= dheight; 4075 sCount++; 4077 4076 } 4078 4077 else 4079 4078 WinShowWindow(WinWindowFromID(hwnd, MAIN_DRIVES), FALSE); 4080 4079 4081 4080 if (fAutoView) { 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4081 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4082 (fToolbar != FALSE) + 4083 (fDrivebar != FALSE) + 4084 (fSplitStatus != FALSE)); 4085 *pswpNew = *pswpClient; 4086 pswpNew->hwnd = (fComments) ? hwndAutoMLE : hwndAutoview; 4087 pswpNew->x = pswpClient->x + 3; 4088 pswpNew->y = pswpClient->y + 3; 4089 if (fMoreButtons) 4090 pswpNew->y += (bheight + 4); 4091 pswpNew->cx = pswpClient->cx - 6; 4092 AutoviewHeight = min(AutoviewHeight, pswpClient->cy - 116); 4093 AutoviewHeight = max(AutoviewHeight, 36); 4094 pswpNew->cy = AutoviewHeight; 4095 pswpClient->y += (AutoviewHeight + 6); 4096 pswpClient->cy -= (AutoviewHeight + 6); 4097 sCount++; 4098 WinShowWindow((fComments) ? hwndAutoview : hwndAutoMLE, FALSE); 4100 4099 } 4101 4100 else { 4102 4103 4101 WinShowWindow(hwndAutoview, FALSE); 4102 WinShowWindow(hwndAutoMLE, FALSE); 4104 4103 } 4105 4104 4106 4105 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4107 4108 4109 4106 (fToolbar != FALSE) + 4107 (fDrivebar != FALSE) + 4108 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4110 4109 *pswpNew = *pswpClient; 4111 4110 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_OPENWALK); … … 4116 4115 sCount++; 4117 4116 pswpNew = (PSWP) mp1 + (soldCount + 2 + 4118 4119 4120 4117 (fToolbar != FALSE) + 4118 (fDrivebar != FALSE) + 4119 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4121 4120 *pswpNew = *pswpClient; 4122 4121 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_USERLIST); … … 4127 4126 sCount++; 4128 4127 pswpNew = (PSWP) mp1 + (soldCount + 3 + 4129 4130 4131 4128 (fToolbar != FALSE) + 4129 (fDrivebar != FALSE) + 4130 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4132 4131 *pswpNew = *pswpClient; 4133 4132 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_LED); … … 4138 4137 sCount++; 4139 4138 pswpNew = (PSWP) mp1 + (soldCount + 4 + 4140 4141 4142 4139 (fToolbar != FALSE) + 4140 (fDrivebar != FALSE) + 4141 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4143 4142 *pswpNew = *pswpClient; 4144 4143 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_LEDHDR); … … 4149 4148 sCount++; 4150 4149 if (fUserComboBox) { 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4150 if (!aheight) { 4151 4152 SWP swpTemp; 4153 4154 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT), 4155 &swpTemp); 4156 aheight = swpTemp.cy; 4157 } 4158 pswpNew = (PSWP) mp1 + (soldCount + 5 + 4159 (fToolbar != FALSE) + 4160 (fSplitStatus != FALSE) + 4161 (fDrivebar != FALSE) + (fAutoView != FALSE)); 4162 *pswpNew = *pswpClient; 4163 pswpNew->hwnd = hwndDrivelist; 4164 pswpNew->x = swpClient.x; 4165 pswpNew->cx = 48; 4166 pswpClient->cy -= (aheight + 6L); 4167 pswpNew->y = pswpClient->y; 4168 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4169 sCount++; 4170 pswpNew = (PSWP) mp1 + (soldCount + 6 + 4171 (fToolbar != FALSE) + 4172 (fDrivebar != FALSE) + 4173 (fSplitStatus != FALSE) + 4174 (fAutoView != FALSE)); 4175 *pswpNew = *pswpClient; 4176 pswpNew->hwnd = hwndStatelist; 4177 pswpNew->x = swpClient.x + 48; 4178 pswpNew->cx = (swpClient.cx - 48) / 7; 4179 pswpNew->y = pswpClient->y; 4180 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4181 sCount++; 4182 pswpNew = (PSWP) mp1 + (soldCount + 7 + 4183 (fToolbar != FALSE) + 4184 (fDrivebar != FALSE) + 4185 (fSplitStatus != FALSE) + 4186 (fAutoView != FALSE)); 4187 *pswpNew = *pswpClient; 4188 pswpNew->hwnd = hwndCmdlist; 4189 pswpNew->x = swpClient.x + 48 + ((swpClient.cx - 48) / 7); 4190 pswpNew->cx = (swpClient.cx - 48) / 5 + 4191 ((swpClient.cx - 48) / 5) - ((swpClient.cx - 48) / 7); 4192 pswpNew->y = pswpClient->y; 4193 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4194 sCount++; 4195 pswpNew = (PSWP) mp1 + (soldCount + 8 + 4196 (fToolbar != FALSE) + 4197 (fDrivebar != FALSE) + 4198 (fSplitStatus != FALSE) + 4199 (fAutoView != FALSE)); 4200 *pswpNew = *pswpClient; 4201 pswpNew->hwnd = hwndUserlist; 4202 pswpNew->x = swpClient.x + 48 + (((swpClient.cx - 48) / 5) * 2); 4203 pswpNew->cx = ((swpClient.x + swpClient.cx) - pswpNew->x) - 4204 ((fToolbar) ? ((swpClient.cx - 48) / 7) : 0); 4205 pswpNew->y = pswpClient->y; 4206 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4207 sCount++; 4208 if (fToolbar) { 4209 pswpNew = (PSWP) mp1 + (soldCount + 9 + 4210 (fToolbar != FALSE) + 4211 (fDrivebar != FALSE) + 4212 (fSplitStatus != FALSE) + 4213 (fAutoView != FALSE)); 4214 *pswpNew = *pswpClient; 4215 pswpNew->hwnd = hwndButtonlist; 4216 pswpNew->x = swpClient.cx - ((swpClient.cx - 48) / 7) + 4; 4217 pswpNew->cx = (swpClient.x + swpClient.cx) - pswpNew->x; 4218 pswpNew->y = pswpClient->y; 4219 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4220 sCount++; 4221 } 4222 else 4223 WinShowWindow(hwndButtonlist, FALSE); 4225 4224 } 4226 4225 else { 4227 4228 4229 4230 4231 4226 WinShowWindow(hwndUserlist, FALSE); 4227 WinShowWindow(hwndDrivelist, FALSE); 4228 WinShowWindow(hwndStatelist, FALSE); 4229 WinShowWindow(hwndButtonlist, FALSE); 4230 WinShowWindow(hwndCmdlist, FALSE); 4232 4231 } 4233 4232 { 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4233 PSWP pswpTitlebar = (PSWP) 0, pswpMinbutton = (PSWP) 0; 4234 SHORT x; 4235 4236 pswpNew = (PSWP) mp1 + (soldCount + 5 + 4237 (fToolbar != FALSE) + 4238 (fDrivebar != FALSE) + 4239 (fSplitStatus != FALSE) + 4240 (fAutoView != FALSE) + 4241 ((fUserComboBox != FALSE) * 4) + 4242 (fUserComboBox != FALSE && 4243 fToolbar != FALSE)); 4244 pswp = (PSWP) mp1; 4245 for (x = 0; x < soldCount; x++) { 4246 if (!pswpTitlebar && 4247 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_TITLEBAR) 4248 pswpTitlebar = pswp; 4249 else if (!pswpMinbutton && 4250 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_MINMAX) 4251 pswpMinbutton = pswp; 4252 if (pswpTitlebar && pswpMinbutton) 4253 break; 4254 pswp++; 4255 } 4256 if (pswpMinbutton && pswpTitlebar) { 4257 *pswpNew = *pswpMinbutton; 4258 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_IDEALSIZE); 4259 pswpNew->cy = pswpMinbutton->cy + 3; 4260 pswpNew->cx = min(pswpNew->cy, (pswpMinbutton->cx / 2) + 3); 4261 pswpTitlebar->cx -= (pswpNew->cx - 1); 4262 pswpNew->x = pswpTitlebar->x + (pswpTitlebar->cx); 4263 pswpNew->y = pswpMinbutton->y - 1; 4264 sCount++; 4265 } 4266 else 4267 WinShowWindow(WinWindowFromID(hwnd, IDM_IDEALSIZE), FALSE); 4269 4268 } 4270 4269 4271 4270 if (fMoreButtons) { 4272 4271 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4272 LONG lastx; 4273 4274 pswpNew = (PSWP) mp1 + (soldCount + 6 + 4275 (fToolbar != FALSE) + 4276 (fDrivebar != FALSE) + 4277 (fSplitStatus != FALSE) + 4278 (fAutoView != FALSE) + 4279 ((fUserComboBox != FALSE) * 4) + 4280 (fUserComboBox != FALSE && 4281 fToolbar != FALSE)); 4282 *pswpNew = *pswpClient; 4283 pswpNew->hwnd = hwndName; 4284 pswpNew->x = swpClient.x + 3; 4285 pswpNew->y = swpClient.y + (sheight + 6); 4286 pswpNew->cx = ((swpClient.cx / 2) + (swpClient.cx / 5)) - 3; 4287 lastx = pswpNew->x + pswpNew->cx; 4288 pswpNew->cy = bheight; 4289 pswpClient->y += (bheight + 4); 4290 pswpClient->cy -= (bheight + 4); 4291 sCount++; 4292 pswpNew = (PSWP) mp1 + (soldCount + 7 + 4293 (fToolbar != FALSE) + 4294 (fDrivebar != FALSE) + 4295 (fSplitStatus != FALSE) + 4296 (fAutoView != FALSE) + 4297 ((fUserComboBox != FALSE) * 4) + 4298 (fUserComboBox != FALSE && 4299 fToolbar != FALSE)); 4300 *pswpNew = *pswpClient; 4301 pswpNew->hwnd = hwndDate; 4302 pswpNew->x = lastx + 3; 4303 pswpNew->y = swpClient.y + (sheight + 6); 4304 pswpNew->cx = (swpClient.cx / 6) + (swpClient.cx / 16) - 3; 4305 lastx = pswpNew->x + pswpNew->cx; 4306 pswpNew->cy = bheight; 4307 sCount++; 4308 pswpNew = (PSWP) mp1 + (soldCount + 8 + 4309 (fToolbar != FALSE) + 4310 (fDrivebar != FALSE) + 4311 (fSplitStatus != FALSE) + 4312 (fAutoView != FALSE) + 4313 ((fUserComboBox != FALSE) * 4) + 4314 (fUserComboBox != FALSE && 4315 fToolbar != FALSE)); 4316 *pswpNew = *pswpClient; 4317 pswpNew->hwnd = hwndAttr; 4318 pswpNew->x = lastx + 3; 4319 pswpNew->y = swpClient.y + (sheight + 6); 4320 pswpNew->cx = (swpClient.cx - pswpNew->x) - 1; 4321 pswpNew->cy = bheight; 4322 sCount++; 4324 4323 } 4325 4324 else { 4326 4327 4328 4325 WinShowWindow(hwndAttr, FALSE); 4326 WinShowWindow(hwndName, FALSE); 4327 WinShowWindow(hwndDate, FALSE); 4329 4328 } 4330 4329 return MRFROMSHORT(sCount); … … 4339 4338 sCount += 6; 4340 4339 if (fSplitStatus) 4341 4340 sCount++; 4342 4341 if (fToolbar) 4343 4342 sCount++; 4344 4343 if (fUserComboBox) { 4345 4346 4347 4344 sCount += 4; 4345 if (fToolbar) 4346 sCount++; 4348 4347 } 4349 4348 if (fDrivebar) 4350 4349 sCount++; 4351 4350 if (fAutoView) 4352 4351 sCount++; 4353 4352 if (fMoreButtons) 4354 4353 sCount += 3; 4355 4354 return MRFROMSHORT(sCount); 4356 4355 } … … 4373 4372 // DbgMsg(pszSrcFile, __LINE__, "IDM_CONTEXTMENU %x", hwnd); 4374 4373 if (hwnd != NULLHANDLE) { 4375 4376 4377 4378 4379 4380 4381 4382 4383 4374 HWND hwndParent = WinQueryWindow(hwnd, QW_PARENT); 4375 USHORT id = WinQueryWindowUShort(hwndParent, QWS_ID); 4376 switch (id) { 4377 case MAIN_SETUPLIST: 4378 case MAIN_USERLIST: 4379 case MAIN_CMDLIST: 4380 // DbgMsg(pszSrcFile, __LINE__, "WM_CONTEXTMENU"); 4381 WinPostMsg(hwnd, WM_CONTEXTMENU, 0, 0); 4382 } 4384 4383 } 4385 4384 } … … 4410 4409 wa.size = sizeof(wa); 4411 4410 pci = 4412 4413 4414 4415 4416 4411 (PCNRITEM) 4412 WinSendMsg(WinWindowFromID 4413 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 4414 CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST), 4415 MPFROMSHORT(CRA_CURSORED)); 4417 4416 if (pci && (INT) pci != -1) { 4418 4419 4417 strcpy(wa.szCurrentPath1, pci->pszFileName); 4418 MakeValidDir(wa.szCurrentPath1); 4420 4419 } 4421 4420 else 4422 4421 save_dir2(wa.szCurrentPath1); 4423 4422 TopWindowName(hwndMain, (HWND) 0, wa.szCurrentPath2); 4424 4423 if (!*wa.szCurrentPath2) 4425 4424 strcpy(wa.szCurrentPath2, wa.szCurrentPath1); 4426 4425 MakeValidDir(wa.szCurrentPath2); 4427 4426 if (WinDlgBox(HWND_DESKTOP, 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4427 hwnd, 4428 WalkTwoCmpDlgProc, 4429 FM3ModHandle, 4430 WALK2_FRAME, 4431 MPFROMP(&wa)) && 4432 !IsFile(wa.szCurrentPath1) && !IsFile(wa.szCurrentPath2)) { 4433 if (!*dircompare) { 4434 4435 COMPARE *cmp; 4436 4437 cmp = xmallocz(sizeof(COMPARE), pszSrcFile, __LINE__); 4438 if (cmp) { 4439 cmp->size = sizeof(COMPARE); 4440 strcpy(cmp->leftdir, wa.szCurrentPath1); 4441 strcpy(cmp->rightdir, wa.szCurrentPath2); 4442 cmp->hwndParent = hwnd; 4443 cmp->dcd.hwndParent = hwnd; 4444 WinDlgBox(HWND_DESKTOP, 4445 HWND_DESKTOP, 4446 CompareDlgProc, FM3ModHandle, COMP_FRAME, MPFROMP(cmp)); 4447 } 4448 } 4449 else { 4450 4451 CHAR szPath1[CCHMAXPATH]; 4452 CHAR szPath2[CCHMAXPATH]; 4453 runemf2(SEPARATE, 4454 HWND_DESKTOP, pszSrcFile, __LINE__, 4455 NULL, NULL, 4456 "%s %s %s", 4457 dircompare, 4458 BldQuotedFileName(szPath1, wa.szCurrentPath1), 4459 BldQuotedFileName(szPath2, wa.szCurrentPath2)); 4460 } 4462 4461 } 4463 4462 } … … 4471 4470 case IDM_CLI: 4472 4471 if (fSplitStatus && 4473 4474 4475 4472 hwndStatus2 && 4473 !WinIsWindow(WinQueryAnchorBlock(hwnd), 4474 WinWindowFromID(hwndStatus2, COMMAND_LINE))) 4476 4475 PostMsg(hwndStatus2, UM_CLICKED, MPVOID, MPVOID); 4477 4476 break; … … 4486 4485 bstrip(temp); 4487 4486 if (*temp && 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4487 !DosQueryPathInfo(temp, FIL_QUERYFULLNAME, path, sizeof(path))) { 4488 if (SHORT1FROMMP(mp1) == IDM_ADDTOUSERLIST) { 4489 add_udir(TRUE, path); 4490 if (fUdirsChanged) 4491 save_udirs(); 4492 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 4493 } 4494 else { 4495 if (!remove_udir(path)) 4496 Runtime_Error(pszSrcFile, __LINE__, "remove_udir"); 4497 else { 4498 if (fUdirsChanged) 4499 save_udirs(); 4500 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 4501 } 4502 } 4504 4503 } 4505 4504 } … … 4516 4515 // Ignore request if blank or attempting to using illegal name 4517 4516 if (*szStateName && stricmp(szStateName, GetPString(IDS_STATETEXT))) { 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 "\"%s\" state name add failed", szStateName);// 15 Apr 07 SHL failed4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4517 if (SHORT1FROMMP(mp1) == IDM_SAVEDIRCNRSTATE) { 4518 // Save 4519 INT nSaved = SaveDirCnrState(hwnd, szStateName); 4520 if (nSaved > 0) { 4521 INT ret = add_setup(szStateName); 4522 if (ret == 0) { 4523 WinSendMsg(hwndStatelist, LM_INSERTITEM, 4524 MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(szStateName)); 4525 save_setups(); 4526 } 4527 else if (ret != 1) { 4528 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4529 GetPString(IDS_WARNINGTEXT), 4530 "\"%s\" state name add failed", szStateName); // 15 Apr 07 SHL failed 4531 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4532 } 4533 } 4534 else { 4535 saymsg(MB_ENTER | MB_ICONASTERISK, 4536 hwnd, 4537 GetPString(IDS_WARNINGTEXT), 4538 nSaved == 0 ? 4539 "Nothing to save" : 4540 "State data save failed"); 4541 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4542 } 4543 } 4544 else { 4545 // Delete 4546 ULONG numsaves = 0, size, x; 4547 CHAR s[STATE_NAME_MAX_BYTES + 80]; 4548 4549 INT ret = remove_setup(szStateName); 4550 if (ret == 1) 4551 save_setups(); 4552 sprintf(s, "%s.NumDirsLastTime", szStateName); 4553 size = sizeof(ULONG); 4554 if (!PrfQueryProfileData(fmprof, 4555 FM3Str, 4556 s, 4557 (PVOID)&numsaves, 4558 &size)) { 4559 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4560 GetPString(IDS_WARNINGTEXT), 4561 GetPString(IDS_DOESNTEXISTTEXT), szStateName); 4562 } 4563 else if (!size) 4564 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); 4565 else { 4566 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0L); 4567 for (x = 0; x < numsaves; x++) { 4568 sprintf(s, "%s.DirCnrPos.%lu", szStateName, x); 4569 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4570 sprintf(s, "%s.DirCnrDir.%lu", szStateName, x); 4571 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4572 sprintf(s, "%s.DirCnrSort.%lu", szStateName, x); 4573 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4574 sprintf(s, "%s.DirCnrFilter.%lu", szStateName, x); 4575 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4576 sprintf(s, "%s.DirCnrView.%lu", szStateName, x); 4577 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4579 4578 sprintf(s, "%s.DirCnr.%lu.DetailsLongname", szStateName, x); 4580 4579 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); … … 4599 4598 sprintf(s, "%s.DirCnr.%lu.DetailsCRTime", szStateName, x); 4600 4599 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4601 4602 4603 4604 4605 4606 4607 4608 4600 } 4601 sprintf(s, "%s.LastTreePos", szStateName); 4602 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4603 sprintf(s, "%s.MySizeLastTime", szStateName); 4604 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4605 } 4606 PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID); 4607 } 4609 4608 } 4610 4609 } … … 4619 4618 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 4620 4619 if (swp.fl & SWP_MAXIMIZE) { 4621 4622 4623 4620 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), WM_SYSCOMMAND, 4621 MPFROM2SHORT(SC_RESTORE, 0), MPVOID); 4622 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 4624 4623 } 4625 4624 WinGetMaxPosition(WinQueryWindow(hwnd, QW_PARENT), &swpD); … … 4629 4628 swpD.cy -= (icz + bsz); 4630 4629 if (swp.x == swpD.x && swp.y == swpD.y && 4631 4632 4633 4634 4635 4636 4637 4638 4630 swp.cx == swpD.cx && swp.cy == swpD.cy && 4631 // fixme to be #defined someday 4632 WinQueryWindowUShort(hwnd, QWL_USER + 10) && 4633 WinQueryWindowUShort(hwnd, QWL_USER + 14)) { 4634 swpD.x = WinQueryWindowUShort(hwnd, QWL_USER + 8); 4635 swpD.cx = WinQueryWindowUShort(hwnd, QWL_USER + 10); 4636 swpD.y = WinQueryWindowUShort(hwnd, QWL_USER + 12); 4637 swpD.cy = WinQueryWindowUShort(hwnd, QWL_USER + 14); 4639 4638 } 4640 4639 else { 4641 4642 4643 4644 4640 WinSetWindowUShort(hwnd, QWL_USER + 8, (USHORT) swp.x); 4641 WinSetWindowUShort(hwnd, QWL_USER + 10, (USHORT) swp.cx); 4642 WinSetWindowUShort(hwnd, QWL_USER + 12, (USHORT) swp.y); 4643 WinSetWindowUShort(hwnd, QWL_USER + 14, (USHORT) swp.cy); 4645 4644 } 4646 4645 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 4647 4646 swpD.x, swpD.y, swpD.cx, swpD.cy, SWP_MOVE | SWP_SIZE); 4648 4647 } 4649 4648 break; … … 4651 4650 case IDM_BLINK: 4652 4651 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0, 4653 4652 SWP_MINIMIZE); 4654 4653 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0, 4655 4654 SWP_RESTORE | SWP_ZORDER); 4656 4655 break; 4657 4656 … … 4661 4660 4662 4661 if (hwndTop) 4663 4662 WinSetFocus(HWND_DESKTOP, hwndTop); 4664 4663 } 4665 4664 break; … … 4674 4673 case IDM_QUICKSETTINGS: 4675 4674 WinDlgBox(HWND_DESKTOP, 4676 4675 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMLONG(mp1)); 4677 4676 break; 4678 4677 … … 4680 4679 case IDM_VIEWINFS: 4681 4680 WinDlgBox(HWND_DESKTOP, 4682 4683 4684 4685 4686 4687 4681 HWND_DESKTOP, 4682 ViewInfProc, 4683 FM3ModHandle, 4684 VINF_FRAME, 4685 ((SHORT1FROMMP(mp1) == IDM_VIEWHELPS) ? 4686 MPFROMP(NullStr) : MPVOID)); 4688 4687 break; 4689 4688 … … 4695 4694 TopWindowName(hwnd, (HWND) 0, newpath); 4696 4695 if (WinDlgBox(HWND_DESKTOP, 4697 4698 4699 4700 4696 hwnd, 4697 WalkAllDlgProc, 4698 FM3ModHandle, WALK_FRAME, MPFROMP(newpath)) && *newpath) 4699 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, newpath); 4701 4700 } 4702 4701 break; … … 4719 4718 if (SHORT1FROMMP(mp2) == CMDSRC_MENU) { 4720 4719 4721 4722 4723 4724 4725 4726 4727 4728 4729 4720 RECTL rcl; 4721 ULONG icz = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2L; 4722 4723 WinQueryWindowRect(HWND_DESKTOP, &rcl); 4724 rcl.yBottom += icz; 4725 rcl.yTop -= icz; 4726 rcl.xLeft += icz; 4727 rcl.xRight -= icz; 4728 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID); 4730 4729 } 4731 4730 else { 4732 4731 4733 4734 4735 4736 4737 4738 4739 4740 4732 RECTL rcl; 4733 4734 WinQueryWindowRect(HWND_DESKTOP, &rcl); 4735 rcl.yBottom += 8; 4736 rcl.yTop = (rcl.yTop / 2) + (rcl.yTop / 7); 4737 rcl.xLeft = (rcl.xRight / 2) - (rcl.xRight / 7); 4738 rcl.xRight -= 8; 4739 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID); 4741 4740 } 4742 4741 switch (SHORT1FROMMP(mp1)) { 4743 4742 case IDM_HELPCONTEXT: 4744 4745 4746 4743 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4744 MPFROM2SHORT(HELP_CONTEXT, 0), MPFROMSHORT(HM_RESOURCEID)); 4745 break; 4747 4746 4748 4747 case IDM_HELPMOUSE: 4749 4750 4751 4752 4748 if (hwndHelp) 4749 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4750 MPFROM2SHORT(HELP_MOUSE, 0), MPFROMSHORT(HM_RESOURCEID)); 4751 break; 4753 4752 4754 4753 case IDM_HELPPIX: 4755 4756 4757 4754 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4755 MPFROM2SHORT(HELP_BITMAP1, 0), MPFROMSHORT(HM_RESOURCEID)); 4756 break; 4758 4757 4759 4758 case IDM_HELPTUTOR: 4760 4761 4762 4763 4759 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4760 MPFROM2SHORT(HELP_TUTORIAL, 0), 4761 MPFROMSHORT(HM_RESOURCEID)); 4762 break; 4764 4763 4765 4764 case IDM_HELPHINTS: 4766 4767 4768 4765 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4766 MPFROM2SHORT(HELP_HINTS, 0), MPFROMSHORT(HM_RESOURCEID)); 4767 break; 4769 4768 4770 4769 case IDM_HELPGENERAL: 4771 4772 4773 4770 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4771 MPFROM2SHORT(HELP_MAIN, 0), MPFROMSHORT(HM_RESOURCEID)); 4772 break; 4774 4773 case IDM_HELPKEYS: 4775 4776 4777 4774 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4775 MPFROM2SHORT(HELP_KEYS, 0), MPFROMSHORT(HM_RESOURCEID)); 4776 break; 4778 4777 4779 4778 case IDM_HELP: 4780 4779 case IDM_HELPCONTENTS: 4781 4782 4780 WinSendMsg(hwndHelp, HM_HELP_CONTENTS, MPVOID, MPVOID); 4781 break; 4783 4782 4784 4783 case IDM_HELPUSERLIST: 4785 4786 4787 4788 4784 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4785 MPFROM2SHORT(HELP_USERLISTS, 0), 4786 MPFROMSHORT(HM_RESOURCEID)); 4787 break; 4789 4788 } 4790 4789 } … … 4797 4796 case IDM_ABOUT: 4798 4797 WinDlgBox(HWND_DESKTOP, hwnd, AboutDlgProc, FM3ModHandle, 4799 4798 ABT_FRAME, MPVOID); 4800 4799 break; 4801 4800 … … 4811 4810 4812 4811 if (!DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, 4813 4814 4815 4816 4817 4818 4819 4812 (PVOID) & version, (ULONG) sizeof(version))) { 4813 if (version[0] > 20L || (version[0] == 20L && version[1] > 29L)) { 4814 if (SHORT1FROMMP(mp1) == IDM_HICOLORPALETTE) 4815 palette = "<WP_HIRESCLRPAL>"; 4816 else 4817 palette = "<WP_LORESCLRPAL>"; 4818 } 4820 4819 } 4821 4820 OpenObject(palette, Default, hwnd); … … 4833 4832 hWPSObject = WinQueryObject("<WP_SCHPAL>"); 4834 4833 if (hWPSObject != NULLHANDLE) 4835 4836 4837 4838 4834 WinSetObjectData(hWPSObject, "SCHEMES=Winter:PM_Winter," 4835 "Spring:PM_Spring,Summer:PM_Summer," 4836 "System:PM_System,Windows:PM_Windows;" 4837 "OPEN=DEFAULT"); 4839 4838 } 4840 4839 break; … … 4847 4846 case IDM_SYSINFO: 4848 4847 WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, SysInfoDlgProc, FM3ModHandle, 4849 4848 SYS_FRAME, NULL); 4850 4849 break; 4851 4850 #endif … … 4857 4856 4858 4857 if (hwndTree) 4859 4860 4861 4858 pci = (PCNRITEM) WinSendMsg(hwndTree, CM_QUERYRECORDEMPHASIS, 4859 MPFROMLONG(CMA_FIRST), 4860 MPFROMSHORT(CRA_CURSORED)); 4862 4861 if (pci && (INT) pci != -1) { 4863 4864 4862 strcpy(path, pci->pszFileName); 4863 MakeValidDir(path); 4865 4864 } 4866 4865 else 4867 4866 save_dir2(path); 4868 4867 WinDlgBox(HWND_DESKTOP, hwnd, InstantDlgProc, FM3ModHandle, 4869 4868 BAT_FRAME, MPFROMP(path)); 4870 4869 } 4871 4870 break; … … 4881 4880 TopWindowName(hwnd, (HWND) 0, path); 4882 4881 if (SHORT1FROMMP(mp1) == IDM_DOSCOMMANDLINE) 4883 4882 env = GetCmdSpec(TRUE); 4884 4883 else if (SHORT1FROMMP(mp1) != IDM_COMMANDLINE) { 4885 4886 4884 env = "WINOS2.COM"; 4885 type = SEPARATE | FULLSCREEN; 4887 4886 } 4888 4887 runemf2(type, hwnd, pszSrcFile, __LINE__, 4889 4888 path, NULL, "%s", env); 4890 4889 } 4891 4890 break; … … 4893 4892 case IDM_KILLPROC: 4894 4893 WinDlgBox(HWND_DESKTOP, hwnd, KillDlgProc, FM3ModHandle, 4895 4894 KILL_FRAME, NULL); 4896 4895 break; 4897 4896 … … 4908 4907 case IDM_AUTOVIEW: 4909 4908 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 4910 4909 &fAutoView, TRUE, "AutoView"); 4911 4910 AutoChange: 4912 4911 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 4913 4912 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 4914 4913 if (fAutoView) { 4915 4914 … … 4920 4919 hwndDir = TopWindowName(hwnd, (HWND) 0, s); 4921 4920 if (hwndDir) { 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4921 hwndDir = WinWindowFromID(hwndDir, FID_CLIENT); 4922 if (hwndDir) { 4923 hwndDir = WinWindowFromID(hwndDir, DIR_CNR); 4924 if (hwndDir) { 4925 pci = (PCNRITEM) WinSendMsg(hwndDir, CM_QUERYRECORDEMPHASIS, 4926 MPFROMLONG(CMA_FIRST), 4927 MPFROMSHORT(CRA_CURSORED)); 4928 if (pci && (INT) pci != -1 && 4929 (!(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_SLOW))) 4930 WinSendMsg(hwnd, 4931 UM_LOADFILE, 4932 MPFROMP(pci->pszFileName), 4933 (SHORT1FROMMP(mp1) == IDM_AUTOVIEW) ? 4934 MPVOID : MPFROMLONG(1)); 4935 } 4936 } 4938 4937 } 4939 4938 } … … 4942 4941 case IDM_TEXTTOOLS: 4943 4942 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 4944 4943 &fTextTools, TRUE, "TextTools"); 4945 4944 BuildTools(hwndToolback, TRUE); 4946 4945 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 4947 4946 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 4948 4947 break; 4949 4948 4950 4949 case IDM_TOOLTITLES: 4951 4950 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 4952 4951 &fToolTitles, TRUE, "ToolTitles"); 4953 4952 BuildTools(hwndToolback, TRUE); 4954 4953 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 4955 4954 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 4956 4955 break; 4957 4956 … … 4963 4962 MenuInvisible = (MenuInvisible) ? FALSE : TRUE; 4964 4963 if (MenuInvisible) { 4965 4966 4967 4968 4964 WinSetParent(hwndMenu, HWND_OBJECT, FALSE); 4965 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 4966 FID_SYSMENU), IDM_HIDEMENU, 4967 GetPString(IDS_UNHIDEMENUTEXT)); 4969 4968 } 4970 4969 else { 4971 4972 4973 4974 4970 WinSetParent(hwndMenu, WinQueryWindow(hwnd, QW_PARENT), FALSE); 4971 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 4972 FID_SYSMENU), IDM_HIDEMENU, 4973 GetPString(IDS_HIDEMENUTEXT)); 4975 4974 } 4976 4975 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 4977 4976 MPFROMLONG(FCF_MENU), MPVOID); 4978 4977 PrfWriteProfileData(fmprof, FM3Str, "MenuInvisible", 4979 4978 &MenuInvisible, sizeof(BOOL)); 4980 4979 } 4981 4980 break; … … 4990 4989 4991 4990 if (Collector) 4992 4991 already = TRUE; 4993 4992 if (!already && !fAutoTile && !fExternalCollector) 4994 4993 GetNextWindowPos(hwnd, &swp, NULL, NULL); 4995 4994 hwndC = StartCollector(fExternalCollector ? HWND_DESKTOP : hwnd, 4); 4996 4995 if (hwndC) { 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 4996 if (!already && !fAutoTile && !fExternalCollector) 4997 WinSetWindowPos(hwndC, HWND_TOP, 4998 swp.x, swp.y, swp.cx, swp.cy, 4999 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER); 5000 else if (fAutoTile && !already) 5001 TileChildren(hwnd, TRUE); 5002 WinSetWindowPos(hwndC, HWND_TOP, 0, 0, 0, 0, SWP_SHOW | SWP_RESTORE | 5003 SWP_ACTIVATE); 5004 if (SHORT1FROMMP(mp1) == IDM_GREP) 5005 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND, 5006 MPFROM2SHORT(IDM_GREP, 0), MPVOID); 5007 if (SHORT1FROMMP(mp1) == IDM_SEEALL) 5008 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND, 5009 MPFROM2SHORT(IDM_SEEALL, 0), MPVOID); 5011 5010 } 5012 5011 } … … 5019 5018 5020 5019 if (!toolhead || !toolhead->next) { 5021 5022 5020 firsttool = (toolhead) ? toolhead->id : 0; 5021 break; 5023 5022 } 5024 5023 tool = find_tool(firsttool); 5025 5024 if (!tool) 5026 5025 tool = toolhead; 5027 5026 if (SHORT1FROMMP(mp1) == IDM_TOOLRIGHT) { 5028 5029 5027 tool = prev_tool(tool, TRUE); 5028 firsttool = tool->id; 5030 5029 } 5031 5030 else { 5032 5033 5031 tool = next_tool(tool, TRUE); 5032 firsttool = tool->id; 5034 5033 } 5035 5034 ResizeTools(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5036 5035 MAIN_TOOLS)); 5037 5036 } 5038 5037 break; … … 5044 5043 case IDM_TOOLBAR: 5045 5044 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5046 5045 IDM_TOOLSUBMENU, &fToolbar, TRUE, "Toolbar"); 5047 5046 BuildTools(hwndToolback, TRUE); 5048 5047 WinShowWindow(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5049 5048 MAIN_TOOLS), fToolbar); 5050 5049 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 5051 5050 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5052 5051 if (fDrivebar) 5053 5052 WinInvalidateRect(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5054 5053 MAIN_DRIVES), NULL, TRUE); 5055 5054 break; 5056 5055 5057 5056 case IDM_DRIVEBAR: 5058 5057 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5059 5058 IDM_DRIVEBAR, &fDrivebar, TRUE, "Drivebar"); 5060 5059 WinShowWindow(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5061 5060 MAIN_DRIVES), fDrivebar); 5062 5061 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5063 5062 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5064 5063 PostMsg(hwnd, UM_BUILDDRIVEBAR, MPVOID, MPVOID); 5065 5064 break; … … 5067 5066 case IDM_USERLIST: 5068 5067 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5069 5068 SHORT1FROMMP(mp1), &fUserComboBox, TRUE, "UserComboBox"); 5070 5069 WinShowWindow(hwndUserlist, fUserComboBox); 5071 5070 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5072 5071 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5073 5072 PostMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 5074 5073 PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID); … … 5082 5081 WinSetWindowText(hwndAttr, NullStr); 5083 5082 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5084 5083 SHORT1FROMMP(mp1), &fMoreButtons, TRUE, "MoreButtons"); 5085 5084 if (fMoreButtons) { 5086 5085 … … 5090 5089 5091 5090 if (hwndTemp) { 5092 5093 5091 WinSetFocus(HWND_DESKTOP, hwnd); 5092 WinSetFocus(HWND_DESKTOP, hwndTemp); 5094 5093 } 5095 5094 } 5096 5095 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5097 5096 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5098 5097 break; 5099 5098 5100 5099 case IDM_TOGGLEDRAGDIALOG: 5101 5100 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5102 5103 5104 5105 5101 IDM_TOGGLEDRAGDIALOG, 5102 &fDragndropDlg, 5103 TRUE, 5104 "Drag&DropDlg"); 5106 5105 break; 5107 5106 5108 5107 case IDM_SYNCUPDATES: 5109 5108 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5110 5111 5112 5113 5109 IDM_SYNCUPDATES, 5110 &fSyncUpdates, 5111 TRUE, 5112 "SyncUpdates"); 5114 5113 break; 5115 5114 … … 5121 5120 WinQueryWindowPos(hwnd, &swp); 5122 5121 WinSetWindowPos(hwndTree, HWND_TOP, 0, swp.cy - swpT.cy, 0, 0, 5123 5122 SWP_MOVE); 5124 5123 } 5125 5124 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5126 5125 &fFreeTree, TRUE, "FreeTree"); 5127 5126 if (fAutoTile) 5128 5127 TileChildren(hwnd, TRUE); … … 5131 5130 case IDM_AUTOTILE: 5132 5131 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5133 5132 SHORT1FROMMP(mp1), &fAutoTile, TRUE, "AutoTile"); 5134 5133 if (fAutoTile) 5135 5134 TileChildren(hwnd, TRUE); … … 5138 5137 case IDM_TILEBACKWARDS: 5139 5138 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5140 5139 SHORT1FROMMP(mp1), &fTileBackwards, TRUE, "TileBackwards"); 5141 5140 if (fAutoTile) 5142 5141 TileChildren(hwnd, TRUE); … … 5183 5182 default: 5184 5183 if (!SwitchCommand((HWND) WinQueryWindowULong(hwnd, QWL_USER), 5185 5184 SHORT1FROMMP(mp1))) { 5186 5185 if (SHORT1FROMMP(mp1) >= IDM_COMMANDSTART && 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5186 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART) { 5187 5188 INT x; 5189 HWND hwndCnr; 5190 5191 if (!cmdloaded) 5192 load_commands(); 5193 hwndCnr = TopWindow(hwnd, (HWND) 0); 5194 hwndCnr = (HWND) WinSendMsg(WinWindowFromID(hwndCnr, FID_CLIENT), 5195 UM_CONTAINERHWND, MPVOID, MPVOID); 5196 if (!hwndCnr) { 5197 Runtime_Error2(pszSrcFile, __LINE__, IDS_NOWINDOWTEXT); 5198 break; 5199 } 5200 x = SHORT1FROMMP(mp1) - IDM_COMMANDSTART; 5201 if (x >= 0) { 5202 x++; 5203 RunCommand(hwndCnr, x); 5204 if (fUnHilite) { 5205 5206 PCNRITEM pci; 5207 DIRCNRDATA *dcd = NULL; 5208 5209 // 12 May 07 SHL fixme to understand? backwards maybe? looking for DIR_CNR? 5210 if (WinQueryWindowUShort(hwndCnr, QWS_ID) != TREE_CNR) 5211 dcd = INSTDATA(hwndCnr); 5212 pci = (PCNRITEM) WinSendMsg(hwndCnr, 5213 CM_QUERYRECORDEMPHASIS, 5214 MPFROMLONG(CMA_FIRST), 5215 MPFROMSHORT(CRA_CURSORED)); 5216 if (pci && (INT) pci != -1 && 5217 (pci->rc.flRecordAttr & CRA_SELECTED)) 5218 { 5219 UnHilite(hwnd, 5220 TRUE, 5221 dcd ? &dcd->lastselection : NULL, 5222 dcd ? dcd ->ulItemsToUnHilite : 0); 5223 } 5224 } 5225 } 5227 5226 } 5228 5227 else if (SHORT1FROMMP(mp1) >= IDM_QUICKTOOLSTART && 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5228 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART + 50) { 5229 if (!qtloaded) 5230 load_quicktools(); 5231 if (quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]) { 5232 if (fToolsChanged) 5233 save_tools(NULL); 5234 if (!load_tools(quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART])) 5235 load_tools(NULL); 5236 else { 5237 strcpy(lasttoolbox, 5238 quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]); 5239 PrfWriteProfileString(fmprof, FM3Str, "LastToolBox", lasttoolbox); 5240 } 5241 BuildTools(hwndToolback, TRUE); 5242 } 5244 5243 } 5245 5244 else { 5246 5245 5247 5248 5249 5250 5251 5252 5253 } 5254 } 5255 break; 5246 HWND hwndActive; 5247 5248 hwndActive = TopWindow(hwnd, (HWND) 0); 5249 if (hwndActive) 5250 PostMsg(WinWindowFromID(hwndActive, FID_CLIENT), 5251 WM_COMMAND, mp1, mp2); 5252 } 5253 } 5254 break; // default 5256 5255 } // switch mp1 5257 5256 return 0; … … 5259 5258 5260 5259 static MRESULT EXPENTRY MainWMOnce(HWND hwnd, ULONG msg, MPARAM mp1, 5261 5260 MPARAM mp2) 5262 5261 { 5263 5262 TID tid; … … 5282 5281 if (_beginthread(MakeMainObjWin, NULL, 245760, MPVOID) == -1) { 5283 5282 Runtime_Error(pszSrcFile, __LINE__, 5284 5283 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 5285 5284 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID); 5286 5285 return 0; … … 5301 5300 5302 5301 if (!WinCreateWindow(hwndFrame, 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5302 WC_BUTTON, 5303 "I", 5304 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS, 5305 ((swp.cx - 5306 WinQuerySysValue(HWND_DESKTOP, 5307 SV_CXMINMAXBUTTON)) - 5308 WinQuerySysValue(HWND_DESKTOP, 5309 SV_CXMINMAXBUTTON) / 2) - 5310 WinQuerySysValue(HWND_DESKTOP, 5311 SV_CXSIZEBORDER), 5312 (swp.cy - WinQuerySysValue(HWND_DESKTOP, 5313 SV_CYMINMAXBUTTON)) - 5314 WinQuerySysValue(HWND_DESKTOP, 5315 SV_CYSIZEBORDER), 5316 WinQuerySysValue(HWND_DESKTOP, 5317 SV_CXMINMAXBUTTON) / 2, 5318 WinQuerySysValue(HWND_DESKTOP, 5319 SV_CYMINMAXBUTTON), 5320 hwnd, HWND_TOP, IDM_IDEALSIZE, NULL, NULL)) { 5322 5321 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5323 5322 } 5324 5323 else { 5325 5324 WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_IDEALSIZE), 5326 5325 IdealButtonProc); 5327 5326 SetPresParams(WinWindowFromID(hwndFrame, 5328 5329 5327 IDM_IDEALSIZE), 5328 NULL, NULL, NULL, GetPString(IDS_10SYSTEMVIOTEXT)); 5330 5329 } 5331 5330 5332 5331 hwndTmp = WinCreateWindow(hwndFrame, 5333 5334 5335 5336 5337 5338 5339 5340 5332 WC_BUTTON, 5333 "#1019", 5334 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS | 5335 BS_BITMAP, 5336 swp.cx - 46, 5337 swp.y + 2, 5338 24, 5339 22, hwnd, HWND_TOP, IDM_OPENWALK, NULL, NULL); 5341 5340 if (!hwndTmp) 5342 5341 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5343 5342 5344 5343 hwndTmp = WinCreateWindow(hwndFrame, 5345 5346 5347 5348 5349 5350 5351 5352 5344 WC_BUTTON, 5345 "#3062", 5346 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS | 5347 BS_BITMAP, 5348 swp.cx - 22, 5349 swp.y + 2, 5350 24, 5351 22, hwnd, HWND_TOP, IDM_USERLIST, NULL, NULL); 5353 5352 if (!hwndTmp) 5354 5353 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5355 5354 5356 5355 hwndUserlist = WinCreateWindow(hwndFrame, 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5356 WC_COMBOBOX, 5357 (PSZ) NULL, 5358 WS_VISIBLE | CBS_DROPDOWN | 5359 LS_HORZSCROLL, 5360 (swp.x + 5361 WinQuerySysValue(HWND_DESKTOP, 5362 SV_CXSIZEBORDER) + 48L), 5363 (swp.cy - 5364 WinQuerySysValue(HWND_DESKTOP, 5365 SV_CYSIZEBORDER)) - 60, 5366 ((swp.cx - 5367 (WinQuerySysValue(HWND_DESKTOP, 5368 SV_CXSIZEBORDER) * 5369 2)) - 64L), 60L, hwndFrame, HWND_TOP, 5370 MAIN_USERLIST, NULL, NULL); 5372 5371 if (!hwndUserlist) 5373 5372 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5374 5373 hwndCmdlist = WinCreateWindow(hwndFrame, 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5374 WC_COMBOBOX, 5375 (PSZ) NULL, 5376 WS_VISIBLE | CBS_DROPDOWN | 5377 LS_HORZSCROLL, 5378 (swp.x + 5379 WinQuerySysValue(HWND_DESKTOP, 5380 SV_CXSIZEBORDER) + 48L), 5381 (swp.cy - 5382 WinQuerySysValue(HWND_DESKTOP, 5383 SV_CYSIZEBORDER)) - 60, 5384 ((swp.cx - 5385 (WinQuerySysValue(HWND_DESKTOP, 5386 SV_CXSIZEBORDER) * 2)) - 5387 64L), 60L, hwndFrame, HWND_TOP, 5388 MAIN_CMDLIST, NULL, NULL); 5390 5389 if (!hwndCmdlist) 5391 5390 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5392 5391 WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT)); 5393 5392 hwndStatelist = WinCreateWindow(hwndFrame, 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5393 WC_COMBOBOX, 5394 (PSZ) NULL, 5395 WS_VISIBLE | CBS_DROPDOWN | 5396 LS_HORZSCROLL, 5397 (swp.x + 5398 WinQuerySysValue(HWND_DESKTOP, 5399 SV_CXSIZEBORDER) + 48L), 5400 (swp.cy - 5401 WinQuerySysValue(HWND_DESKTOP, 5402 SV_CYSIZEBORDER)) - 60, 5403 ((swp.cx - 5404 (WinQuerySysValue(HWND_DESKTOP, 5405 SV_CXSIZEBORDER) * 5406 2)) - 64L), 60L, hwndFrame, HWND_TOP, 5407 MAIN_SETUPLIST, NULL, NULL); 5409 5408 if (!hwndStatelist) 5410 5409 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5411 5410 5412 5411 hwndDrivelist = WinCreateWindow(hwndFrame, 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5412 WC_COMBOBOX, 5413 (PSZ) NULL, 5414 WS_VISIBLE | CBS_DROPDOWN, 5415 (swp.x + 5416 WinQuerySysValue(HWND_DESKTOP, 5417 SV_CXSIZEBORDER)), 5418 (swp.cy - 5419 WinQuerySysValue(HWND_DESKTOP, 5420 SV_CYSIZEBORDER)) - 60, 5421 48L, 5422 60L, 5423 hwndFrame, 5424 HWND_TOP, MAIN_DRIVELIST, NULL, NULL); 5426 5425 if (!hwndDrivelist) 5427 5426 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5428 5427 SetPresParams(hwndDrivelist, 5429 5428 NULL, NULL, NULL, GetPString(IDS_10SYSTEMMONOTEXT)); 5430 5429 hwndButtonlist = WinCreateWindow(hwndFrame, 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5430 WC_COMBOBOX, 5431 (PSZ) NULL, 5432 WS_VISIBLE | CBS_DROPDOWN | 5433 LS_HORZSCROLL, 5434 (swp.cx - 5435 WinQuerySysValue(HWND_DESKTOP, 5436 SV_CXSIZEBORDER)) - 5437 164L, 5438 (swp.cy - 5439 WinQuerySysValue(HWND_DESKTOP, 5440 SV_CYSIZEBORDER)) - 60, 5441 164L, 60L, hwndFrame, HWND_TOP, 5442 MAIN_BUTTONLIST, NULL, NULL); 5444 5443 if (!hwndButtonlist) 5445 5444 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5446 5445 WinSendMsg(WinWindowFromID(hwndUserlist, CBID_EDIT), 5447 5446 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 5448 5447 WinSendMsg(WinWindowFromID(hwndStatelist, CBID_EDIT), 5449 5448 EM_SETTEXTLIMIT, MPFROM2SHORT(STATE_NAME_MAX_BYTES, 0), MPVOID); 5450 5449 WinSendMsg(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5451 5450 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5452 5451 WinSendMsg(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5453 5452 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5454 5453 WinSendMsg(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5455 5454 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5456 5455 5457 5456 oldproc = WinSubclassWindow(WinWindowFromID(hwndUserlist, CBID_EDIT), 5458 5457 DropDownListProc); 5459 5458 WinSetWindowPtr(WinWindowFromID(hwndUserlist, CBID_EDIT), 5460 5459 QWL_USER, (PVOID) oldproc); 5461 5460 oldproc = WinSubclassWindow(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5462 5461 DropDownListProc); 5463 5462 WinSetWindowPtr(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5464 5463 QWL_USER, (PVOID) oldproc); 5465 5464 oldproc = WinSubclassWindow(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5466 5465 DropDownListProc); 5467 5466 WinSetWindowPtr(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5468 5467 QWL_USER, (PVOID) oldproc); 5469 5468 oldproc = WinSubclassWindow(WinWindowFromID(hwndStatelist, CBID_EDIT), 5470 5469 DropDownListProc); 5471 5470 WinSetWindowPtr(WinWindowFromID(hwndStatelist, CBID_EDIT), 5472 5471 QWL_USER, (PVOID) oldproc); 5473 5472 oldproc = WinSubclassWindow(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5474 5473 DropDownListProc); 5475 5474 WinSetWindowPtr(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5476 5475 QWL_USER, (PVOID) oldproc); 5477 5476 oldproc = WinSubclassWindow(hwndUserlist, DropDownListProc); 5478 5477 WinSetWindowPtr(hwndUserlist, QWL_USER, (PVOID) oldproc); … … 5486 5485 WinSetWindowPtr(hwndButtonlist, QWL_USER, (PVOID) oldproc); 5487 5486 oldproc = WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_USERLIST), 5488 5487 ChildFrameButtonProc); 5489 5488 WinSetWindowPtr(WinWindowFromID(hwndFrame, IDM_USERLIST), 5490 5489 QWL_USER, (PVOID) oldproc); 5491 5490 oldproc = WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_OPENWALK), 5492 5491 ChildFrameButtonProc); 5493 5492 WinSetWindowPtr(WinWindowFromID(hwndFrame, IDM_OPENWALK), 5494 5493 QWL_USER, (PVOID) oldproc); 5495 5494 hwndMenu = WinWindowFromID(hwndFrame, FID_MENU); 5496 5495 WinSendMsg(hwnd, UM_ADDTOMENU, MPVOID, MPVOID); … … 5504 5503 hwndSysMenu = WinWindowFromID(hwndFrame, FID_SYSMENU); 5505 5504 idSysMenu = SHORT1FROMMR(WinSendMsg(hwndSysMenu, 5506 5507 5505 MM_ITEMIDFROMPOSITION, 5506 MPVOID, MPVOID)); 5508 5507 WinSendMsg(hwndSysMenu, 5509 5508 MM_QUERYITEM, MPFROM2SHORT(idSysMenu, 0), MPFROMP(&mit)); 5510 5509 hwndSysSubMenu = mit.hwndSubMenu; 5511 5510 mi.iPosition = MIT_END; … … 5516 5515 mi.id = IDM_IDEALSIZE; 5517 5516 WinSendMsg(hwndSysSubMenu, 5518 5519 5517 MM_INSERTITEM, 5518 MPFROMP(&mi), MPFROMP(GetPString(IDS_IDEALMENUTEXT))); 5520 5519 mi.afStyle = MIS_TEXT; 5521 5520 mi.id = IDM_HIDEMENU; 5522 5521 WinSendMsg(hwndSysSubMenu, 5523 5524 5522 MM_INSERTITEM, 5523 MPFROMP(&mi), MPFROMP(GetPString(IDS_HIDEMENUTEXT))); 5525 5524 SetSysMenu(hwndSysMenu); 5526 5525 5527 5526 size = sizeof(BOOL); 5528 5527 if (PrfQueryProfileData(fmprof, 5529 5530 5528 FM3Str, 5529 "MenuInvisible", &temp, &size) && size && temp) 5531 5530 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 5532 5531 size = sizeof(BOOL); 5533 5532 if (PrfQueryProfileData(fmprof, 5534 5533 FM3Str, "FreeTree", &temp, &size) && size && temp) 5535 5534 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_FREETREE, 0), MPVOID); 5536 5535 size = sizeof(BOOL); 5537 5536 if (PrfQueryProfileData(fmprof, 5538 5539 5537 FM3Str, 5538 "AutoTile", &temp, &size) && size && !temp) 5540 5539 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_AUTOTILE, 0), MPVOID); 5541 5540 size = sizeof(BOOL); 5542 5541 if (PrfQueryProfileData(fmprof, 5543 5542 FM3Str, "Toolbar", &temp, &size) && size && !temp) 5544 5543 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 5545 5544 5546 5545 WinSetWindowText(WinWindowFromID(hwndFrame, FID_TITLEBAR), "FM/2"); 5547 5546 FixSwitchList(hwndFrame, NULL); 5548 break; 5547 break; // WM_CREATE 5549 5548 5550 5549 case UM_SETUP: … … 5566 5565 hwndTree = StartTreeCnr(hwnd, 0); 5567 5566 if (!hwndTree) 5568 5567 WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT)); 5569 5568 else { 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5569 if (!fSaveState || 5570 !PrfQueryProfileData(fmprof, 5571 FM3Str, 5572 "LastTreePos", 5573 &swp, &size) || size != sizeof(SWP)) { 5574 5575 INT ratio, height = 0; 5576 5577 if (!fNoTreeGap) 5578 height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2; 5579 size = sizeof(ratio); 5580 if (!PrfQueryProfileData(fmprof, 5581 FM3Str, 5582 "TreeWindowRatio", 5583 (PVOID) & ratio, 5584 &size) || size < sizeof(ratio)) 5585 ratio = 400; 5586 WinSetWindowPos(hwndTree, 5587 HWND_TOP, 5588 0, 5589 height, 5590 (swp.cx * 100) / ratio, 5591 swp.cy - height, 5592 SWP_SHOW | SWP_SIZE | SWP_MOVE | 5593 SWP_ACTIVATE | SWP_ZORDER); 5594 } 5595 else 5596 WinSetWindowPos(hwndTree, 5597 HWND_TOP, 5598 swp.x, 5599 swp.y, 5600 swp.cx, 5601 swp.cy, 5602 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW | 5603 SWP_ZORDER | SWP_ACTIVATE); 5605 5604 } 5606 5605 ResizeTools(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5607 5606 MAIN_TOOLS)); 5608 5607 } 5609 5608 PostMsg(MainObjectHwnd, UM_SETUP3, mp1, mp2); … … 5613 5612 /* start remaining child windows */ 5614 5613 if (!fNoSaveState && fSaveState) 5615 // JBS PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPVOID);5616 5614 PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(FM2_STATE_AT_CLOSE), MPVOID); 5617 5615 PostMsg(MainObjectHwnd, UM_SETUP4, mp1, mp2); … … 5624 5622 5625 5623 for (x = 1; x < argc; x++) { 5626 5627 5628 5629 5624 if (*argv[x] == '/' || *argv[x] == ';') 5625 continue; 5626 if (!IsFile(argv[x]) && !FindDirCnrByName(argv[x], FALSE)) 5627 OpenDirCnr((HWND) 0, hwndMain, hwndTree, TRUE, argv[x]); 5630 5628 } 5631 5629 } … … 5645 5643 hwndActive = TopWindow(hwnd, hwndTree); 5646 5644 if (hwndActive) 5647 5645 WinSetWindowPos(hwndActive, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE); 5648 5646 } 5649 5647 if (fStartMinimized || fReminimize) … … 5675 5673 case WM_CONTROLPOINTER: 5676 5674 if (!fNoFinger && 5677 5678 5675 (SHORT1FROMMP(mp1) == IDM_OPENWALK || 5676 SHORT1FROMMP(mp1) == IDM_USERLIST)) 5679 5677 return MRFROMLONG(hptrFinger); 5680 5678 break; … … 5716 5714 if (mp1) { 5717 5715 if (fUserComboBox) 5718 5719 5716 WinSetWindowText(WinWindowFromID(hwndUserlist, CBID_EDIT), 5717 (CHAR *) mp1); 5720 5718 if (add_udir(FALSE, (CHAR *) mp1)) { 5721 5722 5723 5724 5725 5719 if (fUserComboBox && fAutoAddDirs) { 5720 WinSendMsg(hwndUserlist, LM_INSERTITEM, 5721 MPFROM2SHORT(LIT_SORTASCENDING, 0), 5722 MPFROMP((CHAR *) mp1)); 5723 } 5726 5724 } 5727 5725 } … … 5755 5753 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 5756 5754 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE))) { 5757 WinStoreWindowPos(FM2Str, 5758 "MainWindowPos", WinQueryWindow(hwnd, QW_PARENT)); 5759 if (!fNoSaveState && fSaveState) 5760 // JBS SaveDirCnrState(hwnd, NULL); 5755 WinStoreWindowPos(FM2Str, 5756 "MainWindowPos", WinQueryWindow(hwnd, QW_PARENT)); 5757 if (!fNoSaveState && fSaveState) 5761 5758 SaveDirCnrState(hwnd, FM2_STATE_AT_CLOSE); 5762 5759 } … … 5769 5766 case 1: 5770 5767 { 5771 5772 5773 5774 5775 5776 5777 5778 5768 HWND hwndCurrent; 5769 ULONG wmsg; 5770 5771 wmsg = (SHORT1FROMMP(mp1) == 0) ? UM_FILESMENU : UM_VIEWSMENU; 5772 hwndCurrent = TopWindow(hwnd, (HWND) 0); 5773 PortholeInit((HWND) WinSendMsg(WinWindowFromID(hwndCurrent, 5774 FID_CLIENT), wmsg, 5775 MPVOID, MPVOID), mp1, mp2); 5779 5776 } 5780 5777 break; … … 5794 5791 */ 5795 5792 { 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5793 HWND hwndMenu, hwndSubMenu; 5794 MENUITEM mi; 5795 5796 hwndMenu = WinQueryWindowULong(hwnd, QWL_USER); 5797 memset(&mi, 0, sizeof(mi)); 5798 mi.iPosition = MIT_END; 5799 mi.afStyle = MIS_TEXT; 5800 if (!WinSendMsg(hwndMenu, MM_QUERYITEM, 5801 MPFROM2SHORT(IDM_WINDOWSMENU, TRUE), MPFROMP(&mi))) 5802 break; 5803 hwndSubMenu = mi.hwndSubMenu; 5804 SetupWinList(hwndSubMenu, hwnd, WinQueryWindow(hwnd, QW_PARENT)); 5808 5805 } 5809 5806 break; … … 5811 5808 default: 5812 5809 { 5813 5814 5815 5816 5817 5810 HWND hwndCurrent; 5811 5812 hwndCurrent = TopWindow(hwnd, (HWND) 0); 5813 if (hwndCurrent) 5814 WinSendMsg(hwndCurrent, UM_INITMENU, mp1, mp2); 5818 5815 } 5819 5816 break; … … 5823 5820 case UM_ADDTOMENU: 5824 5821 AddToMenu((CHAR *) mp1, WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5825 5822 FID_MENU)); 5826 5823 return 0; 5827 5824 … … 5836 5833 info = cmdhead; 5837 5834 while (info) { 5838 5839 5840 5835 WinSendMsg(hwndCmdlist, LM_INSERTITEM, 5836 MPFROM2SHORT(LIT_END, 0), MPFROMP(info->title)); 5837 info = info->next; 5841 5838 } 5842 5839 } … … 5862 5859 ulSearchCount = 1; 5863 5860 if (!DosFindFirst("*.TLS", &hDir, FILE_READONLY | FILE_ARCHIVED, 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5861 &findbuf, sizeof(FILEFINDBUF3), 5862 &ulSearchCount, FIL_STANDARD)) { 5863 do { 5864 priority_bumped(); 5865 if (!foundit) { 5866 thisone = FALSE; 5867 p = strrchr(lasttoolbox, '\\'); 5868 if (!p) 5869 p = lasttoolbox; 5870 else 5871 p++; 5872 if (!stricmp(findbuf.achName, p)) 5873 thisone = TRUE; 5874 } 5875 p = strrchr(findbuf.achName, '.'); 5876 if (p) 5877 *p = 0; 5878 sSelect = (SHORT) WinSendMsg(hwndButtonlist, LM_INSERTITEM, 5879 MPFROM2SHORT(LIT_SORTASCENDING, 0), 5880 MPFROMP(findbuf.achName)); 5881 if (!foundit && thisone && sSelect >= 0) { 5882 WinSendMsg(hwndButtonlist, LM_SELECTITEM, 5883 MPFROM2SHORT(sSelect, 0), MPFROMLONG(TRUE)); 5884 foundit = TRUE; 5885 } 5886 } 5887 while (!DosFindNext(hDir, &findbuf, sizeof(FILEFINDBUF3), 5888 &ulSearchCount)); 5889 DosFindClose(hDir); 5890 priority_bumped(); 5894 5891 } 5895 5892 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBOXTEXT)); … … 5910 5907 5911 5908 if (!loadedudirs) 5912 5909 load_udirs(); 5913 5910 DosError(FERR_DISABLEHARDERR); 5914 5911 DosQCurDisk(&ulDriveNum, &ulDriveMap); 5915 5912 info = udirhead; 5916 5913 while (info) { 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5914 if (IsFullName(info->path) && 5915 !(driveflags[toupper(*info->path) - 'A'] & 5916 (DRIVE_IGNORE | DRIVE_INVALID))) { 5917 DosError(FERR_DISABLEHARDERR); 5918 hDir = HDIR_CREATE; 5919 ulSearchCount = 1; 5920 if (!IsRoot(info->path)) 5921 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY | 5922 MUST_HAVE_DIRECTORY | FILE_READONLY | 5923 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN, 5924 &findbuf, sizeof(FILEFINDBUF3), 5925 &ulSearchCount, FIL_STANDARD); 5926 else { 5927 rc = 0; 5928 findbuf.attrFile = FILE_DIRECTORY; 5929 } 5930 priority_bumped(); 5931 if (!rc) { 5932 if (!IsRoot(info->path)) 5933 DosFindClose(hDir); 5934 if (findbuf.attrFile & FILE_DIRECTORY) 5935 WinSendMsg(hwndUserlist, LM_INSERTITEM, 5936 MPFROM2SHORT(LIT_SORTASCENDING, 0), 5937 MPFROMP(info->path)); 5938 else { 5939 temp = info->next; 5940 remove_udir(info->path); 5941 info = temp; 5942 continue; 5943 } 5944 } 5945 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) { 5946 temp = info->next; 5947 remove_udir(info->path); 5948 info = temp; 5949 continue; 5950 } 5951 } 5952 info = info->next; 5956 5953 } 5957 5954 info = ldirhead; 5958 5955 while (info) { 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5956 if (IsFullName(info->path) && 5957 !(driveflags[toupper(*info->path) - 'A'] & 5958 (DRIVE_IGNORE | DRIVE_INVALID))) { 5959 DosError(FERR_DISABLEHARDERR); 5960 hDir = HDIR_CREATE; 5961 ulSearchCount = 1; 5962 if (!IsRoot(info->path)) 5963 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY | 5964 MUST_HAVE_DIRECTORY | FILE_READONLY | 5965 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN, 5966 &findbuf, sizeof(FILEFINDBUF3), 5967 &ulSearchCount, FIL_STANDARD); 5968 else { 5969 rc = 0; 5970 findbuf.attrFile = FILE_DIRECTORY; 5971 } 5972 priority_bumped(); 5973 if (!rc) { 5974 if (!IsRoot(info->path)) 5975 DosFindClose(hDir); 5976 if (findbuf.attrFile & FILE_DIRECTORY) 5977 WinSendMsg(hwndUserlist, LM_INSERTITEM, 5978 MPFROM2SHORT(LIT_SORTASCENDING, 0), 5979 MPFROMP(info->path)); 5980 else { 5981 temp = info->next; 5982 remove_udir(info->path); 5983 info = temp; 5984 continue; 5985 } 5986 } 5987 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) { 5988 temp = info->next; 5989 remove_udir(info->path); 5990 info = temp; 5991 continue; 5992 } 5993 } 5994 info = info->next; 5998 5995 } 5999 5996 WinSendMsg(hwndUserlist, LM_INSERTITEM, 6000 6001 5997 MPFROM2SHORT(0, 0), 5998 MPFROMP(GetPString(IDS_NEWDIRECTORYTEXT))); 6002 5999 WinSetWindowText(hwndUserlist, GetPString(IDS_COMMONDIRTEXT)); 6003 6000 } … … 6013 6010 case WM_SIZE: 6014 6011 ResizeChildren(hwnd, SHORT1FROMMP(mp1), SHORT2FROMMP(mp1), 6015 6012 SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)); 6016 6013 break; 6017 6014 … … 6027 6024 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 6028 6025 if (hps) { 6029 6030 6031 6026 WinQueryWindowRect(hwnd, &rcl); 6027 WinFillRect(hps, &rcl, CLR_PALEGRAY); 6028 WinEndPaint(hps); 6032 6029 } 6033 6030 } … … 6043 6040 switch (SHORT2FROMMP(mp1)) { 6044 6041 case CBN_ENTER: 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 ul = 13;// fixme to not be hardcoded6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 sprintf(szKey, "%s.NumDirsLastTime", path);// path is state name6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 // WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT));// 15 Apr 07 SHL6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6042 { 6043 HWND hwndUL = WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 6044 SHORT1FROMMP(mp1)); 6045 CHAR path[CCHMAXPATH]; 6046 ULONG ul; 6047 6048 switch (SHORT1FROMMP(mp1)) { 6049 case MAIN_USERLIST: 6050 ul = CCHMAXPATH; 6051 break; 6052 case MAIN_SETUPLIST: 6053 ul = STATE_NAME_MAX_BYTES; 6054 break; 6055 default: 6056 ul = 13; // fixme to not be hardcoded 6057 } 6058 6059 SetShiftState(); 6060 WinQueryWindowText(WinWindowFromID(hwndUL, CBID_EDIT), ul, path); 6061 bstrip(path); 6062 if (*path) { 6063 if (SHORT1FROMMP(mp1) == MAIN_USERLIST) { 6064 if (!strcmp(path, GetPString(IDS_NEWDIRECTORYTEXT))) { 6065 if (!LastDir || 6066 !WinSendMsg(WinQueryWindow(LastDir, QW_PARENT), 6067 UM_CONTAINERDIR, MPFROMP(path), MPVOID)) 6068 save_dir2(path); 6069 if (!PMMkDir(hwnd, path, TRUE)) { 6070 WinSetWindowText(hwndUL, GetPString(IDS_COMMONDIRTEXT)); 6071 break; 6072 } 6073 } 6074 if (!IsFile(path) && !FindDirCnrByName(path, TRUE)) { 6075 6076 HWND hwndDir; 6077 6078 if ((fUserListSwitches && 6079 !(shiftstate & KC_SHIFT)) || 6080 (!fUserListSwitches && (shiftstate & KC_SHIFT))) { 6081 hwndDir = FindDirCnr(hwnd); 6082 if (hwndDir) { 6083 WinSendMsg(LastDir, UM_SETDIR, MPFROMP(path), MPVOID); 6084 break; 6085 } 6086 } 6087 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, path); 6088 } 6089 } 6090 else if (SHORT1FROMMP(mp1) == MAIN_DRIVELIST) { 6091 ShowTreeRec(WinWindowFromID(WinWindowFromID(hwndTree, 6092 FID_CLIENT), 6093 TREE_CNR), path, FALSE, TRUE); 6094 WinSetFocus(HWND_DESKTOP, hwndTree); 6095 } 6096 else if (SHORT1FROMMP(mp1) == MAIN_BUTTONLIST) { 6097 strcat(path, ".TLS"); 6098 load_tools(path); 6099 PrfWriteProfileString(fmprof, 6100 FM3Str, "LastToolBox", lasttoolbox); 6101 BuildTools(hwndToolback, TRUE); 6102 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBOXTEXT)); 6103 } 6104 else if (SHORT1FROMMP(mp1) == MAIN_SETUPLIST) { 6105 6106 CHAR szKey[80]; 6107 ULONG size, numsaves = 0; 6108 6109 SetShiftState(); 6110 size = sizeof(ULONG); 6111 sprintf(szKey, "%s.NumDirsLastTime", path); // path is state name 6112 if (!PrfQueryProfileData(fmprof, 6113 FM3Str, 6114 szKey, 6115 (PVOID)&numsaves, 6116 &size)) 6117 { 6118 if ((WinGetLastError(WinQueryAnchorBlock(hwnd)) & 0xffff) == PMERR_NOT_IN_IDX) { 6119 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 6120 GetPString(IDS_WARNINGTEXT), 6121 GetPString(IDS_DOESNTEXISTTEXT), path); 6122 } 6123 else { 6124 Win_Error2(hwnd, hwnd, __FILE__, __LINE__, 6125 IDS_PRFQUERYPROFILEDATA); 6126 } 6127 } 6128 else if (!numsaves) 6129 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); 6130 else { 6131 if ((shiftstate & KC_SHIFT) == 0) 6132 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2L)); 6133 { 6134 char *temp; 6135 6136 temp = xstrdup(path, pszSrcFile, __LINE__); 6137 if (!temp) { 6138 if ((shiftstate & KC_SHIFT) != 0 || fAutoTile) 6139 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, 6140 MPFROMLONG(1)); 6141 } 6142 else { 6143 if (!PostMsg 6144 (MainObjectHwnd, UM_RESTORE, MPFROMP(temp), MPVOID)) 6145 free(temp); 6146 } 6147 } 6148 } 6149 // fixme to hold restored state name for a while 6150 // WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); // 15 Apr 07 SHL 6151 } 6152 else if (SHORT1FROMMP(mp1) == MAIN_CMDLIST) { 6153 6154 SHORT sSelect; 6155 6156 sSelect = (SHORT) WinSendMsg(hwndCmdlist, 6157 LM_QUERYSELECTION, 6158 MPFROMSHORT(LIT_FIRST), MPVOID); 6159 if (sSelect >= 0) 6160 WinPostMsg(hwnd, 6161 WM_COMMAND, 6162 MPFROM2SHORT(IDM_COMMANDSTART + sSelect, 0), 6163 MPVOID); 6164 WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT)); 6165 } 6166 } 6167 } 6168 break; 6172 6169 6173 6170 default: 6174 6171 break; 6175 6172 } 6176 6173 break; … … 6192 6189 case WM_CLOSE: 6193 6190 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 6194 6191 WM_SYSCOMMAND, MPFROM2SHORT(SC_RESTORE, 0), MPVOID); 6195 6192 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID); 6196 6193 fAmClosing = TRUE; 6197 6194 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 6198 6195 WM_SYSCOMMAND, MPFROM2SHORT(SC_MINIMIZE, 0), MPVOID); 6199 6196 if (CloseChildren(hwnd)) { 6200 6197 fAmClosing = FALSE; 6201 6198 if (fAutoTile) 6202 6199 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TILE, 0), MPVOID); 6203 6200 return 0; 6204 6201 } 6205 6202 if (hwndTree) { 6206 6203 if (!PostMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID)) 6207 6204 WinSendMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID); 6208 6205 } 6209 6206 DosSleep(1); 6210 return 0; 6207 return 0; // Hold off WM_QUIT 6211 6208 6212 6209 case UM_CLOSE: … … 6221 6218 temp = xstrdup(GetPString(IDS_FM2TEMPTEXT), pszSrcFile, __LINE__); 6222 6219 if (temp) { 6223 6224 6220 if (!PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(temp), MPVOID)) 6221 free(temp); 6225 6222 } 6226 6223 } … … 6231 6228 if (mp1) 6232 6229 return MRFROMLONG(OpenDirCnr((HWND) 0, 6233 6234 6230 hwndMain, 6231 hwndTree, (BOOL) mp2, (char *)mp1)); 6235 6232 return 0; 6236 6233 -
trunk/dll/misc.c
r923 r930 37 37 22 Nov 07 GKY Use CopyPresParams to fix presparam inconsistencies in menus 38 38 12 Jan 08 SHL Document SetConditionalCascade 39 xx Jan 08 JBS Ticket 150: fix/improve save and restore of dir cnr state at FM/2 close/reopen 39 40 40 41 ***********************************************************************/ … … 44 45 #include <ctype.h> 45 46 #include <share.h> 46 #include <malloc.h> 47 #include <malloc.h> // _heapmin 47 48 48 49 #define INCL_DOS … … 53 54 #include "fm3dlg.h" 54 55 #include "fm3str.h" 55 #include "pathutil.h" 56 #include "errutil.h" 57 #include "strutil.h" 56 #include "pathutil.h" // BldQuotedFileName 57 #include "errutil.h" // Dos_Error... 58 #include "strutil.h" // GetPString 58 59 #include "fm3dll.h" 59 60 … … 63 64 64 65 #ifndef BEGIN_LIBPATH 65 #define BEGIN_LIBPATH 66 #define BEGIN_LIBPATH 1 66 67 #endif 67 68 68 69 #ifndef END_LIBPATH 69 #define END_LIBPATH 70 #define END_LIBPATH 2 70 71 #endif 71 72 … … 803 804 if (strcmp(szData, testname)) { 804 805 if (stricmp(szData, testname) && IsFile(testname) != -1) { 805 DosBeep(50, 100); 806 DosBeep(50, 100); /* exists; disallow */ 806 807 return (MRESULT) FALSE; 807 808 } … … 1343 1344 PrfQueryProfileData(fmprof, appname, s, (PVOID) bool, &size); 1344 1345 if (dcd->SubjectDisplayWidth < 50) 1345 1346 dcd->SubjectDisplayWidth = 0; 1346 1347 else if (dcd->SubjectDisplayWidth > 1000) 1347 1348 dcd->SubjectDisplayWidth = 1000; 1348 1349 } 1349 1350 } … … 1358 1359 PrfQueryProfileData(fmprof, appname, s, (PVOID) bool, &size); 1359 1360 if (SubjectDisplayWidth < 50) 1360 1361 SubjectDisplayWidth = 0; 1361 1362 else if (SubjectDisplayWidth > 1000) 1362 1363 SubjectDisplayWidth = 1000; 1363 1364 } 1364 1365 } … … 1453 1454 MPFROMLONG(CMA_FIRST), 1454 1455 MPFROMSHORT(attrib)); 1455 if ((!pmi || (INT) pmi == -1) && attrib == CRA_SELECTED) 1456 if ((!pmi || (INT) pmi == -1) && attrib == CRA_SELECTED) /* punt */ 1456 1457 attrib = CRA_CURSORED; 1457 1458 else … … 1479 1480 if (WinPeekMsg((HAB) 0, &qmsg, (HWND) 0, 0, 0, PM_NOREMOVE)) 1480 1481 break; // Queue has message(s) 1481 } 1482 } // for 1482 1483 } 1483 1484 } -
trunk/dll/notebook.c
r927 r930 24 24 10 Jan 08 SHL Remember last settings page 25 25 10 Jan 08 SHL Rework page select logic 26 xx Jan 08 JBS Ticket 150: fix/improve save and restore of dir cnr state at FM/2 close/reopen 26 27 27 28 ***********************************************************************/ … … 200 201 szCLBuf[MAXCOMLINESTRG - 1] = 0; 201 202 if (strcmp(szCLBuf, virus)){ 202 203 204 205 206 203 NormalizeCmdLine(pszWorkBuf, szCLBuf); 204 memcpy(virus, pszWorkBuf, strlen(pszWorkBuf) + 1); 205 xfree(pszWorkBuf); 206 if (!strchr(virus, '%') && strlen(virus) > 3) 207 strcat(virus, " %p"); 207 208 } 208 209 if (!*virus) … … 212 213 bstrip(szPathBuf); 213 214 if (strcmp(extractpath, szPathBuf)) { 214 215 216 217 218 219 220 221 222 223 224 225 215 memcpy(extractpath, szPathBuf, strlen(szPathBuf) + 1); 216 if (*extractpath){ 217 MakeFullName(extractpath); 218 if (IsFile(extractpath)) { 219 ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP, 220 GetPString(IDS_WARNINGTEXT), 221 GetPString(IDS_EXTPATHNOTVALIDTEXT), 222 extractpath); 223 if (ulResult == MBID_YES) 224 *extractpath = 0; 225 if (ulResult == MBID_CANCEL){ 226 WinDlgBox(HWND_DESKTOP, 226 227 hwnd, 227 228 CfgDlgProc, … … 229 230 CFG_FRAME, 230 231 MPFROMLONG(IDM_ARCHIVERSETTINGS)); 231 232 233 234 232 break; 233 } 234 } 235 } 235 236 } 236 237 } … … 465 466 szCLBuf[MAXCOMLINESTRG - 1] = 0; 466 467 if (strcmp(szCLBuf, viewer)){ 467 468 469 470 468 NormalizeCmdLine(pszWorkBuf, szCLBuf); 469 memcpy(viewer, pszWorkBuf, strlen(pszWorkBuf) + 1); 470 if (!strchr(viewer, '%') && strlen(viewer) > 3) 471 strcat(viewer, " %a"); 471 472 } 472 473 WinQueryDlgItemText(hwnd, CFGV_EDITOR, MAXCOMLINESTRG, szCLBuf); 473 474 szCLBuf[MAXCOMLINESTRG - 1] = 0; 474 475 if (strcmp(szCLBuf, editor)){ 475 476 477 478 476 NormalizeCmdLine(pszWorkBuf, szCLBuf); 477 memcpy(editor, pszWorkBuf, strlen(pszWorkBuf) + 1); 478 if (!strchr(editor, '%') && strlen(editor) > 3) 479 strcat(editor, " %a"); 479 480 } 480 481 WinQueryDlgItemText(hwnd, CFGV_BINVIEW, MAXCOMLINESTRG, szCLBuf); 481 482 szCLBuf[MAXCOMLINESTRG - 1] = 0; 482 483 if (strcmp(szCLBuf, binview)){ 483 484 485 486 484 NormalizeCmdLine(pszWorkBuf, szCLBuf); 485 memcpy(binview, pszWorkBuf, strlen(pszWorkBuf) + 1); 486 if (!strchr(binview, '%') && strlen(binview) > 3) 487 strcat(binview, " %a"); 487 488 } 488 489 WinQueryDlgItemText(hwnd, CFGV_BINED, MAXCOMLINESTRG, szCLBuf); 489 490 szCLBuf[MAXCOMLINESTRG - 1] = 0; 490 491 if (strcmp(szCLBuf, bined)){ 491 492 493 494 492 NormalizeCmdLine(pszWorkBuf, szCLBuf); 493 memcpy(bined, pszWorkBuf, strlen(pszWorkBuf) + 1); 494 if (!strchr(bined, '%') && strlen(bined) > 3) 495 strcat(bined, " %a"); 495 496 } 496 497 xfree(pszWorkBuf); … … 537 538 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 538 539 WinSendDlgItemMsg(hwnd, CFGH_HTTPRUN, EM_SETTEXTLIMIT, 539 540 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 540 541 WinSendDlgItemMsg(hwnd, CFGH_MAILRUN, EM_SETTEXTLIMIT, 541 542 MPFROM2SHORT(MAXCOMLINESTRG, 0), MPVOID); 542 543 WinSendDlgItemMsg(hwnd, CFGH_RUNMAILWORKDIR, EM_SETTEXTLIMIT, 543 544 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); … … 672 673 szCLBuf[MAXCOMLINESTRG - 1] = 0; 673 674 if (strcmp(szCLBuf, ftprun)){ 674 675 675 NormalizeCmdLine(pszWorkBuf, szCLBuf); 676 memcpy(ftprun, pszWorkBuf, strlen(pszWorkBuf) + 1); 676 677 } 677 678 WinQueryDlgItemText(hwnd, CFGH_HTTPRUN, MAXCOMLINESTRG, szCLBuf); 678 679 szCLBuf[MAXCOMLINESTRG - 1] = 0; 679 680 if (strcmp(szCLBuf, httprun)){ 680 681 681 NormalizeCmdLine(pszWorkBuf, szCLBuf); 682 memcpy(httprun, pszWorkBuf, strlen(pszWorkBuf) + 1); 682 683 } 683 684 WinQueryDlgItemText(hwnd, CFGH_MAILRUN, MAXCOMLINESTRG, szCLBuf); 684 685 szCLBuf[MAXCOMLINESTRG - 1] = 0; 685 686 if (strcmp(szCLBuf, mailrun)){ 686 687 687 NormalizeCmdLine(pszWorkBuf, szCLBuf); 688 memcpy(mailrun, pszWorkBuf, strlen(pszWorkBuf) + 1); 688 689 } 689 690 xfree(pszWorkBuf); … … 1270 1271 pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__); 1271 1272 WinQueryDlgItemText(hwnd, CFGC_DIRCOMPARE, MAXCOMLINESTRG, szCLBuf); 1272 1273 1274 1275 1276 1277 1278 1273 szCLBuf[MAXCOMLINESTRG - 1] = 0; 1274 if (strcmp(szCLBuf, dircompare)){ 1275 NormalizeCmdLine(pszWorkBuf, szCLBuf); 1276 memcpy(dircompare, pszWorkBuf, strlen(pszWorkBuf) + 1); 1277 if (!strchr(dircompare, '%') && strlen(dircompare) > 3) 1278 strcat(dircompare, " %a"); 1279 } 1279 1280 PrfWriteProfileString(fmprof, appname, "DirCompare", dircompare); 1280 1281 WinQueryDlgItemText(hwnd, CFGC_COMPARE, MAXCOMLINESTRG, szCLBuf); 1281 1282 1283 1284 1285 1286 1287 1282 szCLBuf[MAXCOMLINESTRG - 1] = 0; 1283 if (strcmp(szCLBuf, compare)){ 1284 NormalizeCmdLine(pszWorkBuf, szCLBuf); 1285 memcpy(compare, pszWorkBuf, strlen(pszWorkBuf) + 1); 1286 if (!strchr(compare, '%') && strlen(compare) > 3) 1287 strcat(compare, " %a"); 1288 } 1288 1289 xfree(pszWorkBuf); 1289 1290 PrfWriteProfileString(fmprof, appname, "Compare", compare); … … 1683 1684 WinCheckButton(hwnd, CFG5_SUBJECTLENGTHMAX, fSubjectLengthMax); 1684 1685 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETCURRENTVALUE, 1685 1686 MPFROMLONG(SubjectDisplayWidth), MPVOID); 1686 1687 } 1687 1688 return 0; … … 1753 1754 PrfWriteProfileData(fmprof, appname, "DetailsLongname", 1754 1755 &detailslongname, sizeof(BOOL)); 1755 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname",1756 // JBS &detailslongname, sizeof(BOOL));1757 1756 detailssubject = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSUBJECT); 1758 1757 PrfWriteProfileData(fmprof, appname, "DetailsSubject", 1759 1758 &detailssubject, sizeof(BOOL)); 1760 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject",1761 // JBS &detailssubject, sizeof(BOOL));1762 detailsea = WinQueryButtonCheckstate(hwnd, CFG5_SHOWEAS);1763 1759 PrfWriteProfileData(fmprof, appname, "DetailsEA", 1764 1760 &detailsea, sizeof(BOOL)); 1765 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA",1766 // JBS &detailsea, sizeof(BOOL));1767 1761 detailssize = WinQueryButtonCheckstate(hwnd, CFG5_SHOWSIZE); 1768 1762 PrfWriteProfileData(fmprof, appname, "DetailsSize", 1769 1763 &detailssize, sizeof(BOOL)); 1770 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize",1771 // JBS &detailssize, sizeof(BOOL));1772 1764 detailsicon = WinQueryButtonCheckstate(hwnd, CFG5_SHOWICON); 1773 1765 PrfWriteProfileData(fmprof, appname, "DetailsIcon", 1774 1766 &detailsicon, sizeof(BOOL)); 1775 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon",1776 // JBS &detailsicon, sizeof(BOOL));1777 1767 detailslwdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWDATE); 1778 1768 PrfWriteProfileData(fmprof, appname, "DetailsLWDate", 1779 1769 &detailslwdate, sizeof(BOOL)); 1780 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate",1781 // JBS &detailslwdate, sizeof(BOOL));1782 1770 detailslwtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLWTIME); 1783 1771 PrfWriteProfileData(fmprof, appname, "DetailsLWTime", 1784 1772 &detailslwtime, sizeof(BOOL)); 1785 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime",1786 // JBS &detailslwtime, sizeof(BOOL));1787 1773 detailsladate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLADATE); 1788 1774 PrfWriteProfileData(fmprof, appname, "DetailsLADate", 1789 1775 &detailsladate, sizeof(BOOL)); 1790 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate",1791 // JBS &detailsladate, sizeof(BOOL));1792 1776 detailslatime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWLATIME); 1793 1777 PrfWriteProfileData(fmprof, appname, "DetailsLATime", 1794 1778 &detailslatime, sizeof(BOOL)); 1795 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime",1796 // JBS &detailslatime, sizeof(BOOL));1797 1779 detailscrdate = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRDATE); 1798 1780 PrfWriteProfileData(fmprof, appname, "DetailsCRDate", 1799 1781 &detailscrdate, sizeof(BOOL)); 1800 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate",1801 // JBS &detailscrdate, sizeof(BOOL));1802 1782 detailscrtime = WinQueryButtonCheckstate(hwnd, CFG5_SHOWCRTIME); 1803 1783 PrfWriteProfileData(fmprof, appname, "DetailsCRTime", 1804 1784 &detailscrtime, sizeof(BOOL)); 1805 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime",1806 // JBS &detailscrtime, sizeof(BOOL));1807 1785 detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR); 1808 1786 PrfWriteProfileData(fmprof, appname, "DetailsAttr", 1809 1787 &detailsattr, sizeof(BOOL)); 1810 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr",1811 // JBS &detailsattr, sizeof(BOOL));1812 1788 fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE); 1813 1789 PrfWriteProfileData(fmprof, appname, "SubjectInLeftPane", 1814 1790 &fSubjectInLeftPane, sizeof(BOOL)); 1815 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectInLeftPane",1816 // JBS &fSubjectInLeftPane, sizeof(BOOL));1817 1791 fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX); 1818 1792 PrfWriteProfileData(fmprof, appname, "SubjectLengthMax", 1819 1793 &fSubjectLengthMax, sizeof(BOOL)); 1820 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.SubjectLengthMax",1821 // JBS &fSubjectLengthMax, sizeof(BOOL));1822 1794 *mask.prompt = 0; 1823 1795 PrfWriteProfileData(fmprof, appname, "DirFilter", &mask, sizeof(MASK)); … … 2039 2011 WinCheckButton(hwnd, CFG5_SUBJECTLENGTHMAX, dcd.fSubjectLengthMax); 2040 2012 WinSendDlgItemMsg(hwnd, CFG5_SUBJECTDISPLAYWIDTH, SPBM_SETCURRENTVALUE, 2041 2013 MPFROMLONG(dcd.SubjectDisplayWidth), MPVOID); 2042 2014 2043 2015 } … … 2149 2121 dcd.detailsattr = WinQueryButtonCheckstate(hwnd, CFG5_SHOWATTR); 2150 2122 PrfWriteProfileData(fmprof, appname, "Collector.DetailsAttr", 2151 2123 &dcd.detailsattr, sizeof(BOOL)); 2152 2124 dcd.fSubjectInLeftPane = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTINLEFTPANE); 2153 2125 PrfWriteProfileData(fmprof, appname, "Collector.SubjectInLeftPane", 2154 2126 &dcd.fSubjectInLeftPane, sizeof(BOOL)); 2155 2127 dcd.fSubjectLengthMax = WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX); 2156 2128 PrfWriteProfileData(fmprof, appname, "Collector.SubjectLengthMax", … … 2158 2130 *mask.prompt = 0; 2159 2131 PrfWriteProfileData(fmprof, 2160 2132 appname, "CollectorFilter", &mask, sizeof(MASK)); 2161 2133 { 2162 2134 if (!WinQueryButtonCheckstate(hwnd, CFG5_SUBJECTLENGTHMAX)) { … … 2939 2911 PrfWriteProfileData(fmprof, appname, "DetailsLongname", 2940 2912 &detailslongname, sizeof(BOOL)); 2941 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLongname",2942 // JBS &detailslongname, sizeof(BOOL));2943 2913 PrfWriteProfileData(fmprof, appname, "DetailsSubject", 2944 2914 &detailssubject, sizeof(BOOL)); 2945 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSubject",2946 // JBS &detailssubject, sizeof(BOOL));2947 2915 PrfWriteProfileData(fmprof, appname, "DetailsEA", 2948 2916 &detailsea, sizeof(BOOL)); 2949 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsEA",2950 // JBS &detailsea, sizeof(BOOL));2951 2917 PrfWriteProfileData(fmprof, appname, "DetailsSize", 2952 2918 &detailssize, sizeof(BOOL)); 2953 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsSize",2954 // JBS &detailssize, sizeof(BOOL));2955 2919 PrfWriteProfileData(fmprof, appname, "DetailsIcon", 2956 2920 &detailsicon, sizeof(BOOL)); 2957 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsIcon",2958 // JBS &detailsicon, sizeof(BOOL));2959 2921 PrfWriteProfileData(fmprof, appname, "DetailsLWDate", 2960 2922 &detailslwdate, sizeof(BOOL)); 2961 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWDate",2962 // JBS &detailslwdate, sizeof(BOOL));2963 2923 PrfWriteProfileData(fmprof, appname, "DetailsLWTime", 2964 2924 &detailslwtime, sizeof(BOOL)); 2965 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLWTime",2966 // JBS &detailslwtime, sizeof(BOOL));2967 2925 PrfWriteProfileData(fmprof, appname, "DetailsLADate", 2968 2926 &detailsladate, sizeof(BOOL)); 2969 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLADate",2970 // JBS &detailsladate, sizeof(BOOL));2971 2927 PrfWriteProfileData(fmprof, appname, "DetailsLATime", 2972 2928 &detailslatime, sizeof(BOOL)); 2973 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsLATime",2974 // JBS &detailslatime, sizeof(BOOL));2975 2929 PrfWriteProfileData(fmprof, appname, "DetailsCRDate", 2976 2930 &detailscrdate, sizeof(BOOL)); 2977 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRDate",2978 // JBS &detailscrdate, sizeof(BOOL));2979 2931 PrfWriteProfileData(fmprof, appname, "DetailsCRTime", 2980 2932 &detailscrtime, sizeof(BOOL)); 2981 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsCRTime",2982 // JBS &detailscrtime, sizeof(BOOL));2983 2933 PrfWriteProfileData(fmprof, appname, "DetailsAttr", 2984 2934 &detailsattr, sizeof(BOOL)); 2985 // JBS PrfWriteProfileData(fmprof, appname, "DirCnr.DetailsAttr",2986 // JBS &detailsattr, sizeof(BOOL));2987 2935 if (hwndMain) { 2988 2936 if (SaveDirCnrState(hwndMain, GetPString(IDS_FM2TEMPTEXT)) > 0) {
Note:
See TracChangeset
for help on using the changeset viewer.