Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/mainwnd.c
r1025 r1027 55 55 22 Feb 08 JBS Ticket 230: Fix/improve various code related to state or presparam values in the INI file. 56 56 29 Feb 08 GKY Use xfree where appropriate 57 19 Jun 08 JBS Ticket 227: Allow temporary saving/deleting of the shutdown state of directory containers 57 58 58 59 ***********************************************************************/ … … 78 79 #include "errutil.h" // Dos_Error... 79 80 #include "strutil.h" // GetPString 80 #include "notebook.h" // CfgDlgProc CfgMenuInit81 #include "notebook.h" // CfgDlgProc CfgMenuInit 81 82 #include "command.h" // LINKCMDS 82 83 #include "fm3dll.h" … … 94 95 95 96 static MRESULT EXPENTRY MainObjectWndProc(HWND hwnd, ULONG msg, MPARAM mp1, 96 MPARAM mp2)97 MPARAM mp2) 97 98 { 98 99 switch (msg) { … … 120 121 *dv = 0; 121 122 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwndB, QW_PARENT), 122 id + 50), sizeof(dv), dv);123 id + 50), sizeof(dv), dv); 123 124 d = toupper(*dv); 124 125 if (isalpha(d) && d > 'B' && 125 !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID |126 DRIVE_SLOW)) &&127 (!hwndBubble ||128 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&129 !WinQueryCapture(HWND_DESKTOP)) {130 131 FSALLOCATE fsa;132 CHAR s[90], szQty[38];133 ULONG ulPctFree;134 ULONGLONG ullFreeQty;135 136 if (!DosQueryFSInfo((d - 'A') + 1,137 FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) {138 ullFreeQty = (ULONGLONG) fsa.cUnitAvail *139 (fsa.cSectorUnit * fsa.cbSector);140 ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ?141 (fsa.cUnitAvail * 100) / fsa.cUnit : 0;142 CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' ');143 sprintf(s, "%s (%lu%%) free", szQty, ulPctFree);144 }145 if ((!hwndBubble ||146 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) &&147 !WinQueryCapture(HWND_DESKTOP))148 WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID);126 !(driveflags[d - 'A'] & (DRIVE_CDROM | DRIVE_INVALID | 127 DRIVE_SLOW)) && 128 (!hwndBubble || 129 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) && 130 !WinQueryCapture(HWND_DESKTOP)) { 131 132 FSALLOCATE fsa; 133 CHAR s[90], szQty[38]; 134 ULONG ulPctFree; 135 ULONGLONG ullFreeQty; 136 137 if (!DosQueryFSInfo((d - 'A') + 1, 138 FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) { 139 ullFreeQty = (ULONGLONG) fsa.cUnitAvail * 140 (fsa.cSectorUnit * fsa.cbSector); 141 ulPctFree = (fsa.cUnit && fsa.cUnitAvail) ? 142 (fsa.cUnitAvail * 100) / fsa.cUnit : 0; 143 CommaFmtULL(szQty, sizeof(szQty), ullFreeQty, ' '); 144 sprintf(s, "%s (%lu%%) free", szQty, ulPctFree); 145 } 146 if ((!hwndBubble || 147 WinQueryWindowULong(hwndBubble, QWL_USER) != hwndB) && 148 !WinQueryCapture(HWND_DESKTOP)) 149 WinSendMsg(hwndB, UM_SETUP6, MPFROMP(s), MPVOID); 149 150 } 150 151 } … … 157 158 158 159 if (DosQuerySysInfo(QSV_BOOT_DRIVE, 159 QSV_BOOT_DRIVE,160 (PVOID) & bd, (ULONG) sizeof(ULONG)))161 bd = 3L;160 QSV_BOOT_DRIVE, 161 (PVOID) & bd, (ULONG) sizeof(ULONG))) 162 bd = 3L; 162 163 *s = (CHAR) bd + '@'; 163 164 WinSendMsg(hwndMain, UM_SETDIR, MPFROMP(s), MPFROMLONG(1)); 164 165 if (!mp1) { 165 s[3] = 0;166 WinSendMsg(hwndMain, UM_SETDIR, MPFROMP(s), MPVOID);166 s[3] = 0; 167 WinSendMsg(hwndMain, UM_SETDIR, MPFROMP(s), MPVOID); 167 168 } 168 169 PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMLONG(1), MPFROMLONG(1)); … … 186 187 //xfree((char *)mp1, pszSrcFile, __LINE__); 187 188 if (fAutoTile) 188 TileChildren(hwndMain, TRUE);189 TileChildren(hwndMain, TRUE); 189 190 break; 190 191 default: … … 225 226 DosError(FERR_DISABLEHARDERR); 226 227 WinRegisterClass(hab2, 227 (PSZ) WC_OBJECTWINDOW,228 MainObjectWndProc, 0, sizeof(PVOID));228 (PSZ) WC_OBJECTWINDOW, 229 MainObjectWndProc, 0, sizeof(PVOID)); 229 230 MainObjectHwnd = WinCreateWindow(HWND_OBJECT, 230 WC_OBJECTWINDOW,231 (PSZ) NULL,232 0,233 0L,234 0L,235 0L,236 0L,237 0L, HWND_TOP, OBJ_FRAME, NULL, NULL);231 WC_OBJECTWINDOW, 232 (PSZ) NULL, 233 0, 234 0L, 235 0L, 236 0L, 237 0L, 238 0L, HWND_TOP, OBJ_FRAME, NULL, NULL); 238 239 if (!MainObjectHwnd) 239 Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__,240 IDS_WINCREATEWINDOW);240 Win_Error2(HWND_OBJECT, HWND_DESKTOP, pszSrcFile, __LINE__, 241 IDS_WINCREATEWINDOW); 241 242 else { 242 WinSetWindowPtr(MainObjectHwnd, QWL_USER, args);243 while (WinGetMsg(hab2, &qmsg2, (HWND) 0, 0, 0))244 WinDispatchMsg(hab2, &qmsg2);245 WinDestroyWindow(MainObjectHwnd);243 WinSetWindowPtr(MainObjectHwnd, QWL_USER, args); 244 while (WinGetMsg(hab2, &qmsg2, (HWND) 0, 0, 0)) 245 WinDispatchMsg(hab2, &qmsg2); 246 WinDestroyWindow(MainObjectHwnd); 246 247 } 247 248 WinDestroyMsgQueue(hmq2); … … 252 253 253 254 static MRESULT EXPENTRY IdealButtonProc(HWND hwnd, ULONG msg, MPARAM mp1, 254 MPARAM mp2)255 MPARAM mp2) 255 256 { 256 257 switch (msg) { … … 272 273 while ((hwndC = WinGetNextWindow(henum)) != NULLHANDLE) { 273 274 if (hwndC != exclude) { 274 id = WinQueryWindowUShort(hwndC, QWS_ID);275 if (id)276 break;275 id = WinQueryWindowUShort(hwndC, QWS_ID); 276 if (id) 277 break; 277 278 } 278 279 } … … 294 295 henum = WinBeginEnumWindows(hwndMain); 295 296 while ((hwndC = WinGetNextWindow(henum)) != NULLHANDLE) { 296 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu",hwndTree,exclude,hwndC);297 if (hwndC != exclude && hwndC != hwndTree) {298 id = WinQueryWindowUShort(hwndC, QWS_ID);299 if (id) {300 hwndClient = WinWindowFromID(hwndC, FID_CLIENT);301 if (hwndClient) {302 hwndDir = WinWindowFromID(hwndClient, DIR_CNR);303 if (hwndDir) {304 if (fLookInDir) {305 pci = (PCNRITEM) WinSendMsg(hwndDir,306 CM_QUERYRECORDEMPHASIS,307 MPFROMLONG(CMA_FIRST),308 MPFROMSHORT(CRA_CURSORED));309 if (pci && (INT) pci != -1)310 break;311 }312 if (WinSendMsg(hwndClient,313 UM_CONTAINERDIR, MPFROMP(ret), MPVOID)) {314 MakeValidDir(ret);315 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu\r\"%s\"",hwndTree,exclude,hwndC,ret);316 WinEndEnumWindows(henum);317 return hwndC;318 }319 }320 }321 }322 }297 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu",hwndTree,exclude,hwndC); 298 if (hwndC != exclude && hwndC != hwndTree) { 299 id = WinQueryWindowUShort(hwndC, QWS_ID); 300 if (id) { 301 hwndClient = WinWindowFromID(hwndC, FID_CLIENT); 302 if (hwndClient) { 303 hwndDir = WinWindowFromID(hwndClient, DIR_CNR); 304 if (hwndDir) { 305 if (fLookInDir) { 306 pci = (PCNRITEM) WinSendMsg(hwndDir, 307 CM_QUERYRECORDEMPHASIS, 308 MPFROMLONG(CMA_FIRST), 309 MPFROMSHORT(CRA_CURSORED)); 310 if (pci && (INT) pci != -1) 311 break; 312 } 313 if (WinSendMsg(hwndClient, 314 UM_CONTAINERDIR, MPFROMP(ret), MPVOID)) { 315 MakeValidDir(ret); 316 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu\r\"%s\"",hwndTree,exclude,hwndC,ret); 317 WinEndEnumWindows(henum); 318 return hwndC; 319 } 320 } 321 } 322 } 323 } 323 324 } 324 325 WinEndEnumWindows(henum); 325 326 if (!pci || (INT) pci == -1) { 326 hwndC = hwndTree;327 pci = (PCNRITEM) WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree,328 FID_CLIENT),329 TREE_CNR),330 CM_QUERYRECORDEMPHASIS,331 MPFROMLONG(CMA_FIRST),332 MPFROMSHORT(CRA_CURSORED));327 hwndC = hwndTree; 328 pci = (PCNRITEM) WinSendMsg(WinWindowFromID(WinWindowFromID(hwndTree, 329 FID_CLIENT), 330 TREE_CNR), 331 CM_QUERYRECORDEMPHASIS, 332 MPFROMLONG(CMA_FIRST), 333 MPFROMSHORT(CRA_CURSORED)); 333 334 } 334 335 if (pci && (INT) pci != -1) { 335 strcpy(ret, pci->pszFileName);336 MakeValidDir(ret);336 strcpy(ret, pci->pszFileName); 337 MakeValidDir(ret); 337 338 } 338 339 else 339 save_dir2(ret);340 save_dir2(ret); 340 341 } 341 342 } … … 355 356 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 356 357 if (hwndDir) 357 ret++;358 ret++; 358 359 } 359 360 } … … 373 374 hwndC = WinWindowFromID(hwndF, FID_CLIENT); 374 375 if (hwndC) { 375 hwndDir = WinWindowFromID(hwndC, DIR_CNR);376 if (hwndDir) {377 *retstr = 0;378 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(retstr), MPVOID);379 if (*retstr && !stricmp(retstr, directory)) {380 if (restore)381 WinSetWindowPos(hwndF,382 HWND_TOP,383 0,384 0,385 0,386 0,387 SWP_RESTORE | SWP_SHOW |388 SWP_ACTIVATE | SWP_ZORDER);389 break;390 }391 }376 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 377 if (hwndDir) { 378 *retstr = 0; 379 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(retstr), MPVOID); 380 if (*retstr && !stricmp(retstr, directory)) { 381 if (restore) 382 WinSetWindowPos(hwndF, 383 HWND_TOP, 384 0, 385 0, 386 0, 387 0, 388 SWP_RESTORE | SWP_SHOW | 389 SWP_ACTIVATE | SWP_ZORDER); 390 break; 391 } 392 } 392 393 } 393 394 } … … 456 457 while (tool) { 457 458 if (!(tool->flags & T_INVISIBLE)) { 458 swp[x].x = butx;459 if (fTextTools || (tool->flags & T_TEXT)) {460 butx += 55L;461 swp[x].cx = 54L;462 swp[x].cy = 24L;463 swp[x].y = 3L;464 }465 else466 butx += 33L;467 if (tool->flags & T_SEPARATOR)468 butx += 12;459 swp[x].x = butx; 460 if (fTextTools || (tool->flags & T_TEXT)) { 461 butx += 55L; 462 swp[x].cx = 54L; 463 swp[x].cy = 24L; 464 swp[x].y = 3L; 465 } 466 else 467 butx += 33L; 468 if (tool->flags & T_SEPARATOR) 469 butx += 12; 469 470 } 470 471 else 471 swp[x].fl = noattrib;472 swp[x].fl = noattrib; 472 473 swp[x].hwnd = WinWindowFromID(hwnd, tool->id); 473 474 x++; … … 478 479 swp[x].x = butx; 479 480 if (!(tool->flags & T_INVISIBLE)) { 480 if (fTextTools || (tool->flags & T_TEXT)) {481 butx += 55L;482 swp[x].cx = 54L;483 swp[x].cy = 24L;484 swp[x].y = 3L;485 }486 else487 butx += 33L;488 if (tool->flags & T_SEPARATOR)489 butx += 12;481 if (fTextTools || (tool->flags & T_TEXT)) { 482 butx += 55L; 483 swp[x].cx = 54L; 484 swp[x].cy = 24L; 485 swp[x].y = 3L; 486 } 487 else 488 butx += 33L; 489 if (tool->flags & T_SEPARATOR) 490 butx += 12; 490 491 } 491 492 else 492 swp[x].fl = noattrib;493 swp[x].fl = noattrib; 493 494 swp[x].hwnd = WinWindowFromID(hwnd, tool->id); 494 495 x++; … … 498 499 if (!fTextTools && fToolTitles) { 499 500 for (x = 2L; x < numtools + 2L; x++) { 500 if (fTextTools || !fToolTitles)501 swp[x].fl = noattrib;502 else {503 tool = find_tool(WinQueryWindowUShort(swp[x].hwnd, QWS_ID));504 if (tool && (tool->flags & T_TEXT))505 swp[x].fl = noattrib;506 else {507 swp[x].hwndInsertBehind = HWND_TOP;508 swp[x].y = 1L;509 swp[x].cy = 10L;510 }511 }512 swp[x].hwnd = WinWindowFromID(hwnd,513 WinQueryWindowUShort(swp[x].hwnd,514 QWS_ID) + 25000);501 if (fTextTools || !fToolTitles) 502 swp[x].fl = noattrib; 503 else { 504 tool = find_tool(WinQueryWindowUShort(swp[x].hwnd, QWS_ID)); 505 if (tool && (tool->flags & T_TEXT)) 506 swp[x].fl = noattrib; 507 else { 508 swp[x].hwndInsertBehind = HWND_TOP; 509 swp[x].y = 1L; 510 swp[x].cy = 10L; 511 } 512 } 513 swp[x].hwnd = WinWindowFromID(hwnd, 514 WinQueryWindowUShort(swp[x].hwnd, 515 QWS_ID) + 25000); 515 516 } 516 517 WinSetMultWindowPos(WinQueryAnchorBlock(hwnd), &swp[2], numtools); … … 522 523 523 524 static MRESULT EXPENTRY DropDownListProc(HWND hwnd, ULONG msg, MPARAM mp1, 524 MPARAM mp2)525 MPARAM mp2) 525 526 { 526 527 PFNWP oldproc = (PFNWP) INSTDATA(hwnd); … … 560 561 id = WinQueryWindowUShort(hwndParent, QWS_ID); 561 562 if (SHORT1FROMMP(mp2)) { 562 // If getting focus 1st time - save original accelerator563 if (haccelSaved == NULLHANDLE) {564 haccelSaved = WinQueryAccelTable(hab, hwndFrame);565 if (haccelSaved == NULLHANDLE)566 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinQueryAccelTable");567 // else568 // DbgMsg(pszSrcFile, __LINE__, "WinQueryAccelTable SAVED %x", haccelSaved);569 }570 if (haccelSaved != NULLHANDLE) {571 switch (id) {572 case MAIN_DRIVELIST:573 if (haccelDriveList == NULLHANDLE) {574 haccelDriveList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_DRIVELIST);575 if (haccelDriveList == NULLHANDLE)576 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");577 }578 if (haccelDriveList != NULLHANDLE) {579 if (!WinSetAccelTable(hab, haccelDriveList, hwndFrame))580 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");581 // else582 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_DRIVELIST %x %x", hwndFrame, haccelDriveList);583 }584 break;585 case MAIN_SETUPLIST:586 if (haccelSetupList == NULLHANDLE) {587 haccelSetupList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_SETUPLIST);588 if (haccelSetupList == NULLHANDLE)589 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");590 }591 if (haccelSetupList != NULLHANDLE) {592 if (!WinSetAccelTable(hab, haccelSetupList, hwndFrame))593 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");594 // else595 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_SETUPLIST %x %x", hwndFrame, haccelSetupList);596 }597 break;598 case MAIN_CMDLIST:599 if (haccelCmdList == NULLHANDLE) {600 haccelCmdList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_CMDLIST);601 if (haccelCmdList == NULLHANDLE)602 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");603 }604 if (haccelCmdList != NULLHANDLE) {605 if (!WinSetAccelTable(hab, haccelCmdList, hwndFrame))606 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");607 // else608 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_CMDLIST %x %x", hwndFrame, haccelCmdList);609 }610 break;611 case MAIN_USERLIST:612 if (haccelUserList == NULLHANDLE) {613 haccelUserList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_USERLIST);614 if (haccelUserList == NULLHANDLE)615 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");616 }617 if (haccelUserList != NULLHANDLE) {618 if (!WinSetAccelTable(hab, haccelUserList, hwndFrame))619 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");620 // else621 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_USERLIST %x %x", hwndFrame, haccelUserList);622 }623 break;624 case MAIN_BUTTONLIST:625 if (haccelButtonList == NULLHANDLE) {626 haccelButtonList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_BUTTONLIST);627 if (haccelButtonList == NULLHANDLE)628 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable");629 }630 if (haccelButtonList != NULLHANDLE) {631 if (!WinSetAccelTable(hab, haccelButtonList, hwndFrame))632 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");633 // else634 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_BUTTONLIST %x %x", hwndFrame, haccelButtonList);635 }636 break;637 } // switch638 }563 // If getting focus 1st time - save original accelerator 564 if (haccelSaved == NULLHANDLE) { 565 haccelSaved = WinQueryAccelTable(hab, hwndFrame); 566 if (haccelSaved == NULLHANDLE) 567 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinQueryAccelTable"); 568 // else 569 // DbgMsg(pszSrcFile, __LINE__, "WinQueryAccelTable SAVED %x", haccelSaved); 570 } 571 if (haccelSaved != NULLHANDLE) { 572 switch (id) { 573 case MAIN_DRIVELIST: 574 if (haccelDriveList == NULLHANDLE) { 575 haccelDriveList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_DRIVELIST); 576 if (haccelDriveList == NULLHANDLE) 577 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 578 } 579 if (haccelDriveList != NULLHANDLE) { 580 if (!WinSetAccelTable(hab, haccelDriveList, hwndFrame)) 581 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 582 // else 583 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_DRIVELIST %x %x", hwndFrame, haccelDriveList); 584 } 585 break; 586 case MAIN_SETUPLIST: 587 if (haccelSetupList == NULLHANDLE) { 588 haccelSetupList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_SETUPLIST); 589 if (haccelSetupList == NULLHANDLE) 590 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 591 } 592 if (haccelSetupList != NULLHANDLE) { 593 if (!WinSetAccelTable(hab, haccelSetupList, hwndFrame)) 594 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 595 // else 596 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_SETUPLIST %x %x", hwndFrame, haccelSetupList); 597 } 598 break; 599 case MAIN_CMDLIST: 600 if (haccelCmdList == NULLHANDLE) { 601 haccelCmdList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_CMDLIST); 602 if (haccelCmdList == NULLHANDLE) 603 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 604 } 605 if (haccelCmdList != NULLHANDLE) { 606 if (!WinSetAccelTable(hab, haccelCmdList, hwndFrame)) 607 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 608 // else 609 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_CMDLIST %x %x", hwndFrame, haccelCmdList); 610 } 611 break; 612 case MAIN_USERLIST: 613 if (haccelUserList == NULLHANDLE) { 614 haccelUserList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_USERLIST); 615 if (haccelUserList == NULLHANDLE) 616 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 617 } 618 if (haccelUserList != NULLHANDLE) { 619 if (!WinSetAccelTable(hab, haccelUserList, hwndFrame)) 620 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 621 // else 622 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_USERLIST %x %x", hwndFrame, haccelUserList); 623 } 624 break; 625 case MAIN_BUTTONLIST: 626 if (haccelButtonList == NULLHANDLE) { 627 haccelButtonList = WinLoadAccelTable(hab, FM3ModHandle, MAIN_BUTTONLIST); 628 if (haccelButtonList == NULLHANDLE) 629 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinLoadAccelTable"); 630 } 631 if (haccelButtonList != NULLHANDLE) { 632 if (!WinSetAccelTable(hab, haccelButtonList, hwndFrame)) 633 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 634 // else 635 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_BUTTONLIST %x %x", hwndFrame, haccelButtonList); 636 } 637 break; 638 } // switch 639 } 639 640 } 640 641 else { 641 // Losing focus642 switch (id) {643 case MAIN_DRIVELIST:644 case MAIN_SETUPLIST:645 case MAIN_CMDLIST:646 case MAIN_USERLIST:647 case MAIN_BUTTONLIST:648 if (haccelSaved != NULLHANDLE) {649 if (!WinSetAccelTable(hab, haccelSaved, hwndFrame))650 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable");651 // else652 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable SAVED %x %x", hwndFrame, haccelSaved);653 }654 break;655 } // switch642 // Losing focus 643 switch (id) { 644 case MAIN_DRIVELIST: 645 case MAIN_SETUPLIST: 646 case MAIN_CMDLIST: 647 case MAIN_USERLIST: 648 case MAIN_BUTTONLIST: 649 if (haccelSaved != NULLHANDLE) { 650 if (!WinSetAccelTable(hab, haccelSaved, hwndFrame)) 651 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, "WinSetAccelTable"); 652 // else 653 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable SAVED %x %x", hwndFrame, haccelSaved); 654 } 655 break; 656 } // switch 656 657 } 657 658 } … … 663 664 664 665 if (hwndMenu) 665 WinDestroyWindow(hwndMenu);666 WinDestroyWindow(hwndMenu); 666 667 hwndMenu = (HWND) 0; 667 668 id = WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID); 668 669 switch (id) { 669 670 case MAIN_CMDLIST: 670 WinPostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,671 QW_PARENT),672 QW_PARENT),673 FID_CLIENT),674 WM_COMMAND, MPFROM2SHORT(IDM_EDITCOMMANDS, 0), MPVOID);675 break;671 WinPostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 672 QW_PARENT), 673 QW_PARENT), 674 FID_CLIENT), 675 WM_COMMAND, MPFROM2SHORT(IDM_EDITCOMMANDS, 0), MPVOID); 676 break; 676 677 case MAIN_USERLIST: 677 678 case MAIN_SETUPLIST: 678 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id);679 if (hwndMenu)680 PopupMenu(hwnd,681 WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,682 QW_PARENT),683 QW_PARENT),684 FID_CLIENT), hwndMenu);685 break;679 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id); 680 if (hwndMenu) 681 PopupMenu(hwnd, 682 WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 683 QW_PARENT), 684 QW_PARENT), 685 FID_CLIENT), hwndMenu); 686 break; 686 687 default: 687 ret = FALSE;688 break;688 ret = FALSE; 689 break; 689 690 } // switch 690 691 return ret; … … 695 696 switch (SHORT1FROMMP(mp1)) { 696 697 case CBID_EDIT: 697 id = WinQueryWindowUShort(hwnd, QWS_ID);698 switch (SHORT2FROMMP(mp1)) {699 case EN_SETFOCUS:700 switch (id) {701 case MAIN_CMDLIST:702 WinSetWindowText(hwndStatus2, GetPString(IDS_CMDLISTHELP));703 break;704 case MAIN_SETUPLIST:705 WinSetWindowText(hwndStatus2, GetPString(IDS_SETUPLISTHELP));706 break;707 case MAIN_USERLIST:708 WinSetWindowText(hwndStatus2, GetPString(IDS_USERLISTHELP));709 break;710 case MAIN_DRIVELIST:711 WinSetWindowText(hwndStatus2, GetPString(IDS_DRIVELISTHELP));712 break;713 case MAIN_BUTTONLIST:714 WinSetWindowText(hwndStatus2, GetPString(IDS_BUTTONLISTHELP));715 break;716 default:717 break;718 }719 break;720 721 default:722 break;723 }698 id = WinQueryWindowUShort(hwnd, QWS_ID); 699 switch (SHORT2FROMMP(mp1)) { 700 case EN_SETFOCUS: 701 switch (id) { 702 case MAIN_CMDLIST: 703 WinSetWindowText(hwndStatus2, GetPString(IDS_CMDLISTHELP)); 704 break; 705 case MAIN_SETUPLIST: 706 WinSetWindowText(hwndStatus2, GetPString(IDS_SETUPLISTHELP)); 707 break; 708 case MAIN_USERLIST: 709 WinSetWindowText(hwndStatus2, GetPString(IDS_USERLISTHELP)); 710 break; 711 case MAIN_DRIVELIST: 712 WinSetWindowText(hwndStatus2, GetPString(IDS_DRIVELISTHELP)); 713 break; 714 case MAIN_BUTTONLIST: 715 WinSetWindowText(hwndStatus2, GetPString(IDS_BUTTONLISTHELP)); 716 break; 717 default: 718 break; 719 } 720 break; 721 722 default: 723 break; 724 } 724 725 } 725 726 break; … … 734 735 // 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); 735 736 if (id == CBID_EDIT && 736 WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID) ==737 MAIN_USERLIST) {737 WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID) == 738 MAIN_USERLIST) { 738 739 739 740 CHAR path[CCHMAXPATH]; … … 744 745 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Dragging: %s",path); 745 746 if (*path && !IsRoot(path)) 746 DragOne(hwnd, (HWND) 0, path, FALSE);747 DragOne(hwnd, (HWND) 0, path, FALSE); 747 748 return 0; 748 749 } … … 753 754 if (id == MAIN_USERLIST) { 754 755 if (!emphasized) { 755 emphasized = TRUE;756 DrawTargetEmphasis(hwnd, emphasized);756 emphasized = TRUE; 757 DrawTargetEmphasis(hwnd, emphasized); 757 758 } 758 759 if (AcceptOneDrop(hwnd, mp1, mp2)) 759 return MRFROM2SHORT(DOR_DROP, DO_MOVE);760 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 760 761 return MRFROM2SHORT(DOR_NEVERDROP, 0); 761 762 } … … 766 767 if (id == MAIN_USERLIST) { 767 768 if (emphasized) { 768 emphasized = FALSE;769 DrawTargetEmphasis(hwnd, emphasized);769 emphasized = FALSE; 770 DrawTargetEmphasis(hwnd, emphasized); 770 771 } 771 772 } … … 787 788 788 789 if (emphasized) { 789 emphasized = FALSE;790 DrawTargetEmphasis(hwnd, emphasized);790 emphasized = FALSE; 791 DrawTargetEmphasis(hwnd, emphasized); 791 792 } 792 793 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 793 MakeValidDir(szFrom);794 WinSetWindowText(hwnd, szFrom);795 PostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,796 QW_PARENT),797 QW_PARENT),798 FID_CLIENT),799 UM_COMMAND, MPFROM2SHORT(IDM_ADDTOUSERLIST, 0), MPVOID);800 return 0;794 MakeValidDir(szFrom); 795 WinSetWindowText(hwnd, szFrom); 796 PostMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 797 QW_PARENT), 798 QW_PARENT), 799 FID_CLIENT), 800 UM_COMMAND, MPFROM2SHORT(IDM_ADDTOUSERLIST, 0), MPVOID); 801 return 0; 801 802 } 802 803 } … … 819 820 (other && fOtherHelp) || (!other && !drive && fToolbarHelp))) { 820 821 if ((!hwndBubble || 821 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) &&822 !WinQueryCapture(HWND_DESKTOP))822 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 823 !WinQueryCapture(HWND_DESKTOP)) 823 824 MakeBubble(hwnd, above, help); 824 825 } … … 841 842 /* don't bring up help if window isn't active */ 842 843 if (!WinIsChild(hwnd, hwndActive)) 843 return;844 return; 844 845 } 845 846 hwndActive = WinQueryFocus(HWND_DESKTOP); … … 847 848 /* don't bring up help if a menu is active */ 848 849 if (!strcmp(ucClassname, "#4")) 849 return;850 return; 850 851 } 851 852 } 852 853 853 854 hwndBubble = WinCreateWindow(HWND_DESKTOP, 854 WC_BUBBLE,855 help,856 WS_CLIPSIBLINGS | SS_TEXT |857 DT_CENTER | DT_VCENTER,858 0,859 0,860 0,861 0,862 HWND_DESKTOP, HWND_TOP, MAIN_HELP, NULL, NULL);855 WC_BUBBLE, 856 help, 857 WS_CLIPSIBLINGS | SS_TEXT | 858 DT_CENTER | DT_VCENTER, 859 0, 860 0, 861 0, 862 0, 863 HWND_DESKTOP, HWND_TOP, MAIN_HELP, NULL, NULL); 863 864 if (!hwndBubble) 864 865 Win_Error2(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, 865 IDS_WINCREATEWINDOW);866 IDS_WINCREATEWINDOW); 866 867 else { 867 868 HPS hps; … … 883 884 pp = strchr(p, '\r'); 884 885 if (pp) { 885 wp = pp;886 *pp = 0;887 pp++;886 wp = pp; 887 *pp = 0; 888 pp++; 888 889 } 889 890 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl); 890 891 tptl.x = max(aptl[TXTBOX_TOPRIGHT].x, tptl.x); 891 892 if (tptl.y) 892 tptl.y += extra;893 tptl.y += extra; 893 894 else 894 extra = aptl[TXTBOX_TOPLEFT].y / 4;895 extra = aptl[TXTBOX_TOPLEFT].y / 4; 895 896 tptl.y += aptl[TXTBOX_TOPLEFT].y; 896 897 if (wp) 897 *wp = '\r';898 *wp = '\r'; 898 899 p = pp; 899 900 } … … 905 906 sy = ptl.y + swp.cy + 4; 906 907 if (sy + tptl.y + 12 > lyScreen) { 907 above = FALSE;908 sy = ptl.y - (tptl.y + 14);908 above = FALSE; 909 sy = ptl.y - (tptl.y + 14); 909 910 } 910 911 } … … 922 923 sy = ptl.y + swp.cy + 4; 923 924 if (sy + tptl.y + 12 > lyScreen) 924 sy = 0;925 sy = 0; 925 926 } 926 927 WinSetWindowPos(hwndBubble, HWND_TOP, sx, sy, 927 tptl.x + 14,928 tptl.y + 12,929 SWP_DEACTIVATE | SWP_SHOW | SWP_ZORDER |930 SWP_MOVE | SWP_SIZE);928 tptl.x + 14, 929 tptl.y + 12, 930 SWP_DEACTIVATE | SWP_SHOW | SWP_ZORDER | 931 SWP_MOVE | SWP_SIZE); 931 932 } 932 933 } … … 954 955 WinQueryPointerPos(HWND_DESKTOP, &ptl); 955 956 if (WinWindowFromPoint(HWND_DESKTOP, &ptl, TRUE) != 956 WinQueryWindowULong(hwnd, QWL_USER) || !WinIsWindowVisible(hwnd))957 WinDestroyWindow(hwnd);957 WinQueryWindowULong(hwnd, QWL_USER) || !WinIsWindowVisible(hwnd)) 958 WinDestroyWindow(hwnd); 958 959 } 959 960 return 0; … … 969 970 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 970 971 if (hps) { 971 WinQueryWindowPos(hwnd, &swp);972 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, 0);973 GpiSetColor(hps, ((255 << 16) | (255 << 8) | 198));974 GpiSetBackMix(hps, BM_LEAVEALONE);975 GpiSetMix(hps, FM_OVERPAINT);976 ptl.x = ptl.y = 0;977 GpiMove(hps, &ptl);978 ptl.x = swp.cx - 1;979 ptl.y = swp.cy - 1;980 GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0);981 tlen = WinQueryWindowTextLength(hwnd);982 if (tlen) {983 s = xmalloc(tlen + 2, pszSrcFile, __LINE__);984 if (s) {985 WinQueryWindowText(hwnd, tlen + 1, s);986 if (*s) {987 p = s;988 y = swp.cy - 3;989 extra = WinQueryWindowULong(hwnd, QWL_USER + 4);990 GpiSetColor(hps, 0);991 GpiSetMix(hps, FM_OVERPAINT);992 while (p && *p) {993 wp = NULL;994 pp = strchr(p, '\r');995 if (pp) {996 wp = pp;997 *pp = 0;998 pp++;999 }1000 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl);1001 ptl.x = 7;1002 y -= aptl[TXTBOX_TOPLEFT].y;1003 if (p != s)1004 y -= extra;1005 ptl.y = y;1006 GpiCharStringAt(hps, &ptl, strlen(p), p);1007 if (wp)1008 *wp = '\r';1009 p = pp;1010 }1011 }1012 xfree(s, pszSrcFile, __LINE__);1013 }1014 }1015 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE)) && swp.cx > 6 && swp.cy > 6) {1016 GpiSetColor(hps, CLR_WHITE);1017 ptl.x = 1;1018 ptl.y = 1;1019 GpiMove(hps, &ptl);1020 ptl.y = swp.cy - 2;1021 GpiLine(hps, &ptl);1022 ptl.x = swp.cx - 2;1023 GpiLine(hps, &ptl);1024 ptl.x = 2;1025 ptl.y = 2;1026 GpiMove(hps, &ptl);1027 ptl.y = swp.cy - 3;1028 GpiLine(hps, &ptl);1029 ptl.x = swp.cx - 3;1030 GpiLine(hps, &ptl);1031 GpiSetColor(hps, CLR_BROWN);1032 ptl.x = 1;1033 ptl.y = 1;1034 GpiMove(hps, &ptl);1035 ptl.x = swp.cx - 2;1036 GpiLine(hps, &ptl);1037 ptl.y = swp.cy - 2;1038 GpiLine(hps, &ptl);1039 ptl.x = 2;1040 ptl.y = 2;1041 GpiMove(hps, &ptl);1042 ptl.x = swp.cx - 3;1043 GpiLine(hps, &ptl);1044 ptl.y = swp.cy - 3;1045 GpiLine(hps, &ptl);1046 }1047 WinEndPaint(hps);972 WinQueryWindowPos(hwnd, &swp); 973 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, 0); 974 GpiSetColor(hps, ((255 << 16) | (255 << 8) | 198)); 975 GpiSetBackMix(hps, BM_LEAVEALONE); 976 GpiSetMix(hps, FM_OVERPAINT); 977 ptl.x = ptl.y = 0; 978 GpiMove(hps, &ptl); 979 ptl.x = swp.cx - 1; 980 ptl.y = swp.cy - 1; 981 GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0); 982 tlen = WinQueryWindowTextLength(hwnd); 983 if (tlen) { 984 s = xmalloc(tlen + 2, pszSrcFile, __LINE__); 985 if (s) { 986 WinQueryWindowText(hwnd, tlen + 1, s); 987 if (*s) { 988 p = s; 989 y = swp.cy - 3; 990 extra = WinQueryWindowULong(hwnd, QWL_USER + 4); 991 GpiSetColor(hps, 0); 992 GpiSetMix(hps, FM_OVERPAINT); 993 while (p && *p) { 994 wp = NULL; 995 pp = strchr(p, '\r'); 996 if (pp) { 997 wp = pp; 998 *pp = 0; 999 pp++; 1000 } 1001 GpiQueryTextBox(hps, strlen(p), p, TXTBOX_COUNT, aptl); 1002 ptl.x = 7; 1003 y -= aptl[TXTBOX_TOPLEFT].y; 1004 if (p != s) 1005 y -= extra; 1006 ptl.y = y; 1007 GpiCharStringAt(hps, &ptl, strlen(p), p); 1008 if (wp) 1009 *wp = '\r'; 1010 p = pp; 1011 } 1012 } 1013 xfree(s, pszSrcFile, __LINE__); 1014 } 1015 } 1016 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE)) && swp.cx > 6 && swp.cy > 6) { 1017 GpiSetColor(hps, CLR_WHITE); 1018 ptl.x = 1; 1019 ptl.y = 1; 1020 GpiMove(hps, &ptl); 1021 ptl.y = swp.cy - 2; 1022 GpiLine(hps, &ptl); 1023 ptl.x = swp.cx - 2; 1024 GpiLine(hps, &ptl); 1025 ptl.x = 2; 1026 ptl.y = 2; 1027 GpiMove(hps, &ptl); 1028 ptl.y = swp.cy - 3; 1029 GpiLine(hps, &ptl); 1030 ptl.x = swp.cx - 3; 1031 GpiLine(hps, &ptl); 1032 GpiSetColor(hps, CLR_BROWN); 1033 ptl.x = 1; 1034 ptl.y = 1; 1035 GpiMove(hps, &ptl); 1036 ptl.x = swp.cx - 2; 1037 GpiLine(hps, &ptl); 1038 ptl.y = swp.cy - 2; 1039 GpiLine(hps, &ptl); 1040 ptl.x = 2; 1041 ptl.y = 2; 1042 GpiMove(hps, &ptl); 1043 ptl.x = swp.cx - 3; 1044 GpiLine(hps, &ptl); 1045 ptl.y = swp.cy - 3; 1046 GpiLine(hps, &ptl); 1047 } 1048 WinEndPaint(hps); 1048 1049 } 1049 1050 } … … 1072 1073 switch (WinQueryWindowUShort(hwnd, QWS_ID)) { 1073 1074 case MAIN_LED: 1074 hps = WinGetPS(hwnd);1075 hbmold = (HBITMAP) WinSendMsg(hwnd, SM_QUERYHANDLE, MPVOID, MPVOID);1076 if (!fBlueLED) {1077 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON_BMP, 12, 12);1078 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF_BMP, 12, 12);1079 }1080 else {1081 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON2_BMP, 12, 12);1082 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF2_BMP, 12, 12);1083 }1084 if (hbmLEDoff && hbmLEDon)1085 WinSendMsg(hwnd, SM_SETHANDLE, MPFROMLONG(hbmLEDoff), MPVOID);1086 else {1087 if (hbmLEDoff)1088 GpiDeleteBitmap(hbmLEDoff);1089 if (hbmLEDon)1090 GpiDeleteBitmap(hbmLEDon);1091 }1092 if (hbmold &&1093 hbmLEDon &&1094 hbmLEDoff && hbmold != hbmLEDon && hbmold != hbmLEDoff)1095 GpiDeleteBitmap(hbmold);1096 if (hps)1097 WinReleasePS(hps);1098 break;1075 hps = WinGetPS(hwnd); 1076 hbmold = (HBITMAP) WinSendMsg(hwnd, SM_QUERYHANDLE, MPVOID, MPVOID); 1077 if (!fBlueLED) { 1078 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON_BMP, 12, 12); 1079 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF_BMP, 12, 12); 1080 } 1081 else { 1082 hbmLEDon = GpiLoadBitmap(hps, 0, LEDON2_BMP, 12, 12); 1083 hbmLEDoff = GpiLoadBitmap(hps, 0, LEDOFF2_BMP, 12, 12); 1084 } 1085 if (hbmLEDoff && hbmLEDon) 1086 WinSendMsg(hwnd, SM_SETHANDLE, MPFROMLONG(hbmLEDoff), MPVOID); 1087 else { 1088 if (hbmLEDoff) 1089 GpiDeleteBitmap(hbmLEDoff); 1090 if (hbmLEDon) 1091 GpiDeleteBitmap(hbmLEDon); 1092 } 1093 if (hbmold && 1094 hbmLEDon && 1095 hbmLEDoff && hbmold != hbmLEDon && hbmold != hbmLEDoff) 1096 GpiDeleteBitmap(hbmold); 1097 if (hps) 1098 WinReleasePS(hps); 1099 break; 1099 1100 default: 1100 SetPresParams(hwnd,1101 &RGBGREY,1102 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT));1103 break;1101 SetPresParams(hwnd, 1102 &RGBGREY, 1103 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT)); 1104 break; 1104 1105 } 1105 1106 return mr; … … 1125 1126 case WM_BUTTON1CLICK: 1126 1127 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1127 WM_COMMAND, MPFROM2SHORT(IDM_SHOWNOTEWND, 0), MPVOID);1128 WM_COMMAND, MPFROM2SHORT(IDM_SHOWNOTEWND, 0), MPVOID); 1128 1129 break; 1129 1130 1130 1131 case WM_BUTTON2CLICK: 1131 1132 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1132 WM_COMMAND, MPFROM2SHORT(IDM_HIDENOTEWND, 0), MPVOID);1133 WM_COMMAND, MPFROM2SHORT(IDM_HIDENOTEWND, 0), MPVOID); 1133 1134 break; 1134 1135 … … 1136 1137 case WM_BUTTON3CLICK: 1137 1138 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 1138 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID);1139 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID); 1139 1140 break; 1140 1141 } … … 1159 1160 if (fToolbarHelp) { 1160 1161 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 1161 && !WinQueryCapture(HWND_DESKTOP)) {1162 id = WinQueryWindowUShort(hwnd, QWS_ID);1163 tool = find_tool(id);1164 if (tool && tool->help && *tool->help) {1165 1166 char s[128];1167 1168 strcpy(s, tool->help);1169 if (tool->flags & T_DROPABLE)1170 strcat(s, GetPString(IDS_DROPONMETEXT));1171 MakeBubble(hwnd, FALSE, s);1172 }1162 && !WinQueryCapture(HWND_DESKTOP)) { 1163 id = WinQueryWindowUShort(hwnd, QWS_ID); 1164 tool = find_tool(id); 1165 if (tool && tool->help && *tool->help) { 1166 1167 char s[128]; 1168 1169 strcpy(s, tool->help); 1170 if (tool->flags & T_DROPABLE) 1171 strcat(s, GetPString(IDS_DROPONMETEXT)); 1172 MakeBubble(hwnd, FALSE, s); 1173 } 1173 1174 } 1174 1175 } … … 1179 1180 case IDM_HELP: 1180 1181 if (hwndHelp) 1181 WinSendMsg(hwndHelp,1182 HM_DISPLAY_HELP,1183 MPFROM2SHORT(HELP_TOOLBAR, 0), MPFROMSHORT(HM_RESOURCEID));1182 WinSendMsg(hwndHelp, 1183 HM_DISPLAY_HELP, 1184 MPFROM2SHORT(HELP_TOOLBAR, 0), MPFROMSHORT(HM_RESOURCEID)); 1184 1185 break; 1185 1186 … … 1187 1188 case IDM_HIDETOOL: /* hide tool */ 1188 1189 if (SHORT1FROMMP(mp1) == IDM_HIDETOOL) 1189 id = WinQueryWindowUShort(hwnd, QWS_ID);1190 id = WinQueryWindowUShort(hwnd, QWS_ID); 1190 1191 else 1191 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd,1192 PickToolProc, FM3ModHandle,1193 PICKBTN_FRAME, GetPString(IDS_HIDETEXT));1192 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, 1193 PickToolProc, FM3ModHandle, 1194 PICKBTN_FRAME, GetPString(IDS_HIDETEXT)); 1194 1195 if (id) { 1195 tool = find_tool(id);1196 if (tool) {1197 tool->flags |= T_INVISIBLE;1198 fToolsChanged = TRUE;1199 }1196 tool = find_tool(id); 1197 if (tool) { 1198 tool->flags |= T_INVISIBLE; 1199 fToolsChanged = TRUE; 1200 } 1200 1201 } 1201 1202 break; … … 1204 1205 tool = toolhead; 1205 1206 while (tool) { 1206 tool->flags &= (~T_INVISIBLE);1207 tool = tool->next;1208 fToolsChanged = TRUE;1207 tool->flags &= (~T_INVISIBLE); 1208 tool = tool->next; 1209 fToolsChanged = TRUE; 1209 1210 } 1210 1211 break; … … 1213 1214 case IDM_DELETETOOL: /* delete button */ 1214 1215 if (SHORT1FROMMP(mp1) == IDM_DELETETOOL) 1215 id = WinQueryWindowUShort(hwnd, QWS_ID);1216 id = WinQueryWindowUShort(hwnd, QWS_ID); 1216 1217 else 1217 id =1218 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle,1219 PICKBTN_FRAME, GetPString(IDS_DELETETEXT));1218 id = 1219 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle, 1220 PICKBTN_FRAME, GetPString(IDS_DELETETEXT)); 1220 1221 if (id) 1221 PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_SETUP,1222 MPFROM2SHORT(id, 0), MPVOID);1222 PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_SETUP, 1223 MPFROM2SHORT(id, 0), MPVOID); 1223 1224 return 0; 1224 1225 … … 1226 1227 case IDM_EDITTOOL: /* edit button */ 1227 1228 if (SHORT1FROMMP(mp1) == IDM_EDITTOOL) 1228 id = WinQueryWindowUShort(hwnd, QWS_ID);1229 id = WinQueryWindowUShort(hwnd, QWS_ID); 1229 1230 else 1230 id =1231 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle,1232 PICKBTN_FRAME, GetPString(IDS_EDITTEXT));1231 id = 1232 (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, PickToolProc, FM3ModHandle, 1233 PICKBTN_FRAME, GetPString(IDS_EDITTEXT)); 1233 1234 if (id) { 1234 tool = find_tool(id);1235 if (tool) {1236 if (WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle,1237 ADDBTN_FRAME, (PVOID) tool))1238 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,1239 QW_PARENT),1240 QW_PARENT), FID_CLIENT),1241 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0),1242 MPFROM2SHORT(id, 0));1243 }1235 tool = find_tool(id); 1236 if (tool) { 1237 if (WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle, 1238 ADDBTN_FRAME, (PVOID) tool)) 1239 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 1240 QW_PARENT), 1241 QW_PARENT), FID_CLIENT), 1242 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0), 1243 MPFROM2SHORT(id, 0)); 1244 } 1244 1245 } 1245 1246 break; … … 1247 1248 case IDM_ADDTOOL: /* add tool */ 1248 1249 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle, 1249 ADDBTN_FRAME, MPVOID);1250 ADDBTN_FRAME, MPVOID); 1250 1251 if (id && id != (USHORT) - 1) 1251 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd,1252 QW_PARENT),1253 QW_PARENT), FID_CLIENT),1254 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0),1255 MPFROM2SHORT(id, 0));1252 WinSendMsg(WinWindowFromID(WinQueryWindow(WinQueryWindow(hwnd, 1253 QW_PARENT), 1254 QW_PARENT), FID_CLIENT), 1255 WM_COMMAND, MPFROM2SHORT(IDM_CREATETOOL, 0), 1256 MPFROM2SHORT(id, 0)); 1256 1257 break; 1257 1258 1258 1259 case IDM_REORDERTOOLS: /* reorder tools */ 1259 1260 WinDlgBox(HWND_DESKTOP, 1260 hwnd, ReOrderToolsProc, FM3ModHandle, RE_FRAME, MPVOID);1261 hwnd, ReOrderToolsProc, FM3ModHandle, RE_FRAME, MPVOID); 1261 1262 break; 1262 1263 … … 1264 1265 case IDM_LOADTOOLS: 1265 1266 if (WinDlgBox(HWND_DESKTOP, 1266 hwnd,1267 ToolIODlgProc,1268 FM3ModHandle,1269 SVBTN_FRAME,1270 (PVOID) (SHORT1FROMMP(mp1) == IDM_SAVETOOLS) ?1271 "TRUE" : NULL))1272 BuildTools(hwndToolback, TRUE);1267 hwnd, 1268 ToolIODlgProc, 1269 FM3ModHandle, 1270 SVBTN_FRAME, 1271 (PVOID) (SHORT1FROMMP(mp1) == IDM_SAVETOOLS) ? 1272 "TRUE" : NULL)) 1273 BuildTools(hwndToolback, TRUE); 1273 1274 break; 1274 1275 } … … 1302 1303 tool = find_tool(id); 1303 1304 if (!tool) { 1304 DrgFreeDraginfo(pDInfo);1305 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */1305 DrgFreeDraginfo(pDInfo); 1306 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */ 1306 1307 } 1307 1308 if (!(tool->flags & T_DROPABLE)) { 1308 DrgFreeDraginfo(pDInfo);1309 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */1309 DrgFreeDraginfo(pDInfo); 1310 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); /* Drop not valid */ 1310 1311 } 1311 1312 { 1312 PDRAGITEM pDItem; /* Pointer to DRAGITEM */1313 1314 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */1315 0); /* Index to DRAGITEM */1316 if (DrgVerifyRMF(pDItem, /* Check valid rendering */1317 DRM_OS2FILE, /* mechanisms and data */1318 NULL)) { /* formats */1319 if (!(tool->flags & T_EMPHASIZED)) {1320 tool->flags |= T_EMPHASIZED;1321 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0));1322 DrgFreeDraginfo(pDInfo);1323 }1324 return (MRFROM2SHORT(DOR_DROP, /* Return okay to drop */1325 DO_MOVE)); /* Move operation valid */1326 }1327 DrgFreeDraginfo(pDInfo);1313 PDRAGITEM pDItem; /* Pointer to DRAGITEM */ 1314 1315 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */ 1316 0); /* Index to DRAGITEM */ 1317 if (DrgVerifyRMF(pDItem, /* Check valid rendering */ 1318 DRM_OS2FILE, /* mechanisms and data */ 1319 NULL)) { /* formats */ 1320 if (!(tool->flags & T_EMPHASIZED)) { 1321 tool->flags |= T_EMPHASIZED; 1322 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1323 DrgFreeDraginfo(pDInfo); 1324 } 1325 return (MRFROM2SHORT(DOR_DROP, /* Return okay to drop */ 1326 DO_MOVE)); /* Move operation valid */ 1327 } 1328 DrgFreeDraginfo(pDInfo); 1328 1329 } 1329 1330 } … … 1342 1343 if (tool && (tool->flags & T_DROPABLE)) { 1343 1344 if (tool->flags & T_EMPHASIZED) { 1344 tool->flags &= (~T_EMPHASIZED);1345 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0));1345 tool->flags &= (~T_EMPHASIZED); 1346 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1346 1347 } 1347 1348 } … … 1356 1357 1357 1358 if (tool->flags & T_EMPHASIZED) { 1358 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0));1359 tool->flags &= (~T_EMPHASIZED);1359 DrawTargetEmphasis(hwnd, ((tool->flags & T_EMPHASIZED) != 0)); 1360 tool->flags &= (~T_EMPHASIZED); 1360 1361 } 1361 1362 memset(&cdi, 0, sizeof(cdi)); … … 1364 1365 CheckPmDrgLimit(cdi.pDragInfo); 1365 1366 if (li) { 1366 li->type = id;1367 if (!li->list || !li->list[0])1368 FreeListInfo(li);1369 else {1370 HWND hwndActive;1371 1372 hwndActive = TopWindow(hwndMain, (HWND) 0);1373 if (hwndActive) {1374 if (!WinSendMsg(hwndActive, UM_COMMAND, MPFROMP(li), MPVOID))1375 FreeListInfo(li);1376 }1377 else1378 FreeListInfo(li);1379 }1367 li->type = id; 1368 if (!li->list || !li->list[0]) 1369 FreeListInfo(li); 1370 else { 1371 HWND hwndActive; 1372 1373 hwndActive = TopWindow(hwndMain, (HWND) 0); 1374 if (hwndActive) { 1375 if (!WinSendMsg(hwndActive, UM_COMMAND, MPFROMP(li), MPVOID)) 1376 FreeListInfo(li); 1377 } 1378 else 1379 FreeListInfo(li); 1380 } 1380 1381 } 1381 1382 } … … 1414 1415 if (!fTextTools) { 1415 1416 if (!(tool->flags & T_MYICON)) { 1416 hwndTool = WinCreateWindow(hwndT,1417 WC_TOOLBUTTONS,1418 s,1419 BS_NOPOINTERFOCUS |1420 BS_BITMAP | BS_PUSHBUTTON,1421 ctrlxpos,1422 14,1423 32,1424 32, hwndT, HWND_TOP, tool->id, NULL, NULL);1417 hwndTool = WinCreateWindow(hwndT, 1418 WC_TOOLBUTTONS, 1419 s, 1420 BS_NOPOINTERFOCUS | 1421 BS_BITMAP | BS_PUSHBUTTON, 1422 ctrlxpos, 1423 14, 1424 32, 1425 32, hwndT, HWND_TOP, tool->id, NULL, NULL); 1425 1426 } 1426 1427 if (!hwndTool) { 1427 HBITMAP hbm = LoadBitmapFromFileNum(tool->id);1428 1429 if (hbm) {1430 BTNCDATA btc;1431 1432 memset(&btc, 0, sizeof(btc));1433 btc.cb = sizeof(btc);1434 btc.hImage = hbm;1435 hwndTool = WinCreateWindow(hwndT,1436 WC_TOOLBUTTONS,1437 NullStr,1438 BS_NOPOINTERFOCUS |1439 BS_BITMAP | BS_PUSHBUTTON,1440 ctrlxpos,1441 14,1442 32,1443 32,1444 hwndT, HWND_TOP, tool->id, &btc, NULL);1445 if (!hwndTool)1446 GpiDeleteBitmap(hbm);1447 }1428 HBITMAP hbm = LoadBitmapFromFileNum(tool->id); 1429 1430 if (hbm) { 1431 BTNCDATA btc; 1432 1433 memset(&btc, 0, sizeof(btc)); 1434 btc.cb = sizeof(btc); 1435 btc.hImage = hbm; 1436 hwndTool = WinCreateWindow(hwndT, 1437 WC_TOOLBUTTONS, 1438 NullStr, 1439 BS_NOPOINTERFOCUS | 1440 BS_BITMAP | BS_PUSHBUTTON, 1441 ctrlxpos, 1442 14, 1443 32, 1444 32, 1445 hwndT, HWND_TOP, tool->id, &btc, NULL); 1446 if (!hwndTool) 1447 GpiDeleteBitmap(hbm); 1448 } 1448 1449 } 1449 1450 if (hwndTool) 1450 tool->flags &= (~T_TEXT);1451 tool->flags &= (~T_TEXT); 1451 1452 } 1452 1453 if (!hwndTool) { 1453 1454 hwndTool = WinCreateWindow(hwndT, 1454 WC_TOOLBUTTONS,1455 (!tool->text && tool->id >= IDM_COMMANDSTART1456 && tool->id <1457 IDM_QUICKTOOLSTART) ? command_title(tool->1458 id -1459 IDM_COMMANDSTART)1460 : tool->text,1461 BS_NOPOINTERFOCUS | BS_PUSHBUTTON, ctrlxpos,1462 2, 54, 24, hwndT, HWND_TOP, tool->id, NULL,1463 NULL);1455 WC_TOOLBUTTONS, 1456 (!tool->text && tool->id >= IDM_COMMANDSTART 1457 && tool->id < 1458 IDM_QUICKTOOLSTART) ? command_title(tool-> 1459 id - 1460 IDM_COMMANDSTART) 1461 : tool->text, 1462 BS_NOPOINTERFOCUS | BS_PUSHBUTTON, ctrlxpos, 1463 2, 54, 24, hwndT, HWND_TOP, tool->id, NULL, 1464 NULL); 1464 1465 if (!hwndTool) 1465 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,1466 IDS_WINCREATEWINDOW);1466 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1467 IDS_WINCREATEWINDOW); 1467 1468 tool->flags |= T_TEXT; 1468 1469 } 1469 1470 if (fToolTitles && !fTextTools) { 1470 1471 hwndTool = WinCreateWindow(hwndT, 1471 WC_STATIC,1472 tool->text,1473 SS_TEXT | DT_LEFT | DT_VCENTER,1474 ctrlxpos,1475 1,1476 32,1477 10,1478 hwndT,1479 HWND_TOP, tool->id + 25000, NULL, NULL);1472 WC_STATIC, 1473 tool->text, 1474 SS_TEXT | DT_LEFT | DT_VCENTER, 1475 ctrlxpos, 1476 1, 1477 32, 1478 10, 1479 hwndT, 1480 HWND_TOP, tool->id + 25000, NULL, NULL); 1480 1481 if (!hwndTool) 1481 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,1482 IDS_WINCREATEWINDOW);1482 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1483 IDS_WINCREATEWINDOW); 1483 1484 else { 1484 SetPresParams(hwndTool,1485 &RGBGREY,1486 &RGBBLACK, &RGBGREY, GetPString(IDS_2SYSTEMVIOTEXT));1485 SetPresParams(hwndTool, 1486 &RGBGREY, 1487 &RGBBLACK, &RGBGREY, GetPString(IDS_2SYSTEMVIOTEXT)); 1487 1488 } 1488 1489 } 1489 1490 ctrlxpos += ((tool->flags & T_TEXT) ? 55L : 33L); 1490 1491 SetPresParams(WinWindowFromID(hwndT, tool->id), 1491 NULL, NULL, NULL, GetPString(IDS_8HELVTEXT));1492 NULL, NULL, NULL, GetPString(IDS_8HELVTEXT)); 1492 1493 tool = tool->next; 1493 1494 } // while tool 1494 1495 1495 1496 hwndTool = WinCreateWindow(hwndT, 1496 WC_BUTTON,1497 "#6010",1498 BS_NOPOINTERFOCUS |1499 BS_BITMAP | BS_PUSHBUTTON,1500 1,1501 19,1502 14,1503 13, hwndT, HWND_TOP, IDM_TOOLLEFT, NULL, NULL);1497 WC_BUTTON, 1498 "#6010", 1499 BS_NOPOINTERFOCUS | 1500 BS_BITMAP | BS_PUSHBUTTON, 1501 1, 1502 19, 1503 14, 1504 13, hwndT, HWND_TOP, IDM_TOOLLEFT, NULL, NULL); 1504 1505 if (!hwndTool) 1505 1506 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1506 IDS_WINCREATEWINDOW);1507 IDS_WINCREATEWINDOW); 1507 1508 hwndTool = 1508 1509 WinCreateWindow(hwndT, WC_BUTTON, "#6011", 1509 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON, 1, 4, 14,1510 13, hwndT, HWND_TOP, IDM_TOOLRIGHT, NULL, NULL);1510 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON, 1, 4, 14, 1511 13, hwndT, HWND_TOP, IDM_TOOLRIGHT, NULL, NULL); 1511 1512 if (!hwndTool) 1512 1513 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 1513 IDS_WINCREATEWINDOW);1514 IDS_WINCREATEWINDOW); 1514 1515 if (resize) 1515 1516 ResizeTools(hwndT); … … 1517 1518 1518 1519 static MRESULT EXPENTRY CommandLineProc(HWND hwnd, ULONG msg, MPARAM mp1, 1519 MPARAM mp2)1520 MPARAM mp2) 1520 1521 { 1521 1522 PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER); … … 1534 1535 1535 1536 if (WinQueryWindowUShort((HWND) mp1, QWS_ID) == COMMAND_BUTTON) 1536 break;1537 break; 1537 1538 if (!WinQueryWindowProcess((HWND) mp1, &pid, &tid) || pid == mypid) 1538 WinDestroyWindow(hwnd);1539 WinDestroyWindow(hwnd); 1539 1540 } 1540 1541 break; … … 1548 1549 lbup = TRUE; 1549 1550 if (WinDlgBox(HWND_DESKTOP, 1550 hwnd,1551 CmdLine2DlgProc,1552 FM3ModHandle, EXEC2_FRAME, MPFROMP(pszCmdLine))) {1553 lstrip(pszCmdLine);1554 WinSetWindowText(hwnd, pszCmdLine);1551 hwnd, 1552 CmdLine2DlgProc, 1553 FM3ModHandle, EXEC2_FRAME, MPFROMP(pszCmdLine))) { 1554 lstrip(pszCmdLine); 1555 WinSetWindowText(hwnd, pszCmdLine); 1555 1556 } 1556 1557 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); … … 1573 1574 case COMMAND_BUTTON: 1574 1575 if (!lbup) 1575 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);1576 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1576 1577 break; 1577 1578 } … … 1592 1593 bstrip(cl + len); 1593 1594 if (strlen(cl) > len) { 1594 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT),1595 UM_SETUP, MPFROMP(cl + len), MPVOID);1596 WinQueryWindowText(hwndStatus, CCHMAXPATH, directory);1597 bstrip(directory);1598 if (*directory && (IsRoot(directory) || !IsFile(directory))) {1599 if (!FM2Command(directory, cl + len)) {1600 hwndCnr = TopWindow(hwndMain, (HWND) 0);1601 if (hwndCnr) {1602 hwndCnr = WinWindowFromID(hwndCnr, FID_CLIENT);1603 if (hwndCnr) {1604 hwndCnr = WinWindowFromID(hwndCnr, DIR_CNR);1605 if (hwndCnr)1606 list = BuildList(hwndCnr);1607 }1608 }1609 WinSetActiveWindow(HWND_DESKTOP, hwndCnr);1610 if (add_cmdline(cl + len, FALSE) && fSaveMiniCmds)1611 save_cmdlines(FALSE);1612 ExecOnList(hwndCnr,1613 cl,1614 WINDOWED | ((fKeepCmdLine) ?1615 SEPARATEKEEP : SEPARATE),1616 directory, list, NULL, pszSrcFile, __LINE__);1617 xfree(list, pszSrcFile, __LINE__);1618 WinDestroyWindow(hwnd);1619 break;1620 }1621 }1595 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 1596 UM_SETUP, MPFROMP(cl + len), MPVOID); 1597 WinQueryWindowText(hwndStatus, CCHMAXPATH, directory); 1598 bstrip(directory); 1599 if (*directory && (IsRoot(directory) || !IsFile(directory))) { 1600 if (!FM2Command(directory, cl + len)) { 1601 hwndCnr = TopWindow(hwndMain, (HWND) 0); 1602 if (hwndCnr) { 1603 hwndCnr = WinWindowFromID(hwndCnr, FID_CLIENT); 1604 if (hwndCnr) { 1605 hwndCnr = WinWindowFromID(hwndCnr, DIR_CNR); 1606 if (hwndCnr) 1607 list = BuildList(hwndCnr); 1608 } 1609 } 1610 WinSetActiveWindow(HWND_DESKTOP, hwndCnr); 1611 if (add_cmdline(cl + len, FALSE) && fSaveMiniCmds) 1612 save_cmdlines(FALSE); 1613 ExecOnList(hwndCnr, 1614 cl, 1615 WINDOWED | ((fKeepCmdLine) ? 1616 SEPARATEKEEP : SEPARATE), 1617 directory, list, NULL, pszSrcFile, __LINE__); 1618 xfree(list, pszSrcFile, __LINE__); 1619 WinDestroyWindow(hwnd); 1620 break; 1621 } 1622 } 1622 1623 } 1623 1624 WinSendMsg(hwnd, EM_SETSEL, MPFROM2SHORT(0, 1024), MPVOID); … … 1628 1629 if (!lbup && !(SHORT1FROMMP(mp1) & KC_KEYUP)) { 1629 1630 if (SHORT1FROMMP(mp1) & KC_VIRTUALKEY) { 1630 if ((SHORT1FROMMP(mp2) & 255) == '\r')1631 PostMsg(hwnd, UM_OPENWINDOWFORME, MPVOID, MPVOID);1632 else if ((SHORT1FROMMP(mp2) & 0xff) == 0x1b)1633 WinDestroyWindow(hwnd);1634 else if (SHORT2FROMMP(mp2) == VK_UP || SHORT2FROMMP(mp2) == VK_DOWN)1635 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);1631 if ((SHORT1FROMMP(mp2) & 255) == '\r') 1632 PostMsg(hwnd, UM_OPENWINDOWFORME, MPVOID, MPVOID); 1633 else if ((SHORT1FROMMP(mp2) & 0xff) == 0x1b) 1634 WinDestroyWindow(hwnd); 1635 else if (SHORT2FROMMP(mp2) == VK_UP || SHORT2FROMMP(mp2) == VK_DOWN) 1636 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1636 1637 } 1637 1638 } 1638 1639 else if ((SHORT1FROMMP(mp1) & KC_VIRTUALKEY) && 1639 ((SHORT2FROMMP(mp2) == VK_UP ||1640 SHORT2FROMMP(mp2) == VK_DOWN) ||1641 (SHORT1FROMMP(mp2) == '\x1b') || (SHORT1FROMMP(mp2) == '\r')))1640 ((SHORT2FROMMP(mp2) == VK_UP || 1641 SHORT2FROMMP(mp2) == VK_DOWN) || 1642 (SHORT1FROMMP(mp2) == '\x1b') || (SHORT1FROMMP(mp2) == '\r'))) 1642 1643 return 0; 1643 1644 break; … … 1665 1666 rgb.bRed = (BYTE)128; 1666 1667 SetPresParams(hwnd, 1667 &RGBGREY, &rgb, &RGBGREY, GetPString(IDS_8HELVTEXT));1668 &RGBGREY, &rgb, &RGBGREY, GetPString(IDS_8HELVTEXT)); 1668 1669 SetTargetDir(hwnd, TRUE); 1669 1670 } … … 1695 1696 case WM_CONTROLPOINTER: 1696 1697 if (!fNoFinger && 1697 (SHORT1FROMMP(mp1) >= IDM_DRIVEA &&1698 SHORT1FROMMP(mp1) < IDM_DRIVEA + 26))1698 (SHORT1FROMMP(mp1) >= IDM_DRIVEA && 1699 SHORT1FROMMP(mp1) < IDM_DRIVEA + 26)) 1699 1700 return MRFROMLONG(hptrFinger); 1700 1701 break; … … 1706 1707 *dv = 0; 1707 1708 WinQueryWindowText(WinWindowFromID(hwnd, SHORT1FROMMP(mp1) + 50), 1708 2, dv);1709 2, dv); 1709 1710 if (isalpha(*dv)) { 1710 1711 1711 HWND hwndActive;1712 1713 dv[1] = ':';1714 dv[2] = '\\';1715 dv[3] = 0;1716 hwndActive = TopWindow(hwnd, (HWND) 0);1717 if (hwndActive)1718 WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT),1719 UM_DRIVECMD, MPFROMP(dv), MPVOID);1712 HWND hwndActive; 1713 1714 dv[1] = ':'; 1715 dv[2] = '\\'; 1716 dv[3] = 0; 1717 hwndActive = TopWindow(hwnd, (HWND) 0); 1718 if (hwndActive) 1719 WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT), 1720 UM_DRIVECMD, MPFROMP(dv), MPVOID); 1720 1721 } 1721 1722 } … … 1745 1746 case WM_MOUSEMOVE: 1746 1747 if (fDrivebarHelp && 1747 (!hwndBubble ||1748 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) &&1749 !WinQueryCapture(HWND_DESKTOP)) {1748 (!hwndBubble || 1749 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 1750 !WinQueryCapture(HWND_DESKTOP)) { 1750 1751 id = WinQueryWindowUShort(hwnd, QWS_ID); 1751 1752 if (helpid != id) { 1752 helpid = id;1753 PostMsg(MainObjectHwnd, UM_SETUP6, MPFROMLONG((ULONG) hwnd), MPVOID);1753 helpid = id; 1754 PostMsg(MainObjectHwnd, UM_SETUP6, MPFROMLONG((ULONG) hwnd), MPVOID); 1754 1755 } 1755 1756 else 1756 helpid = 0;1757 helpid = 0; 1757 1758 } 1758 1759 break; … … 1761 1762 if (helpid == WinQueryWindowUShort(hwnd, QWS_ID)) { 1762 1763 if ((char *)mp1 && 1763 (!hwndBubble ||1764 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) &&1765 !WinQueryCapture(HWND_DESKTOP)) {1766 1767 RECTL rcl;1768 POINTL ptl;1769 1770 WinQueryPointerPos(HWND_DESKTOP, &ptl);1771 WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1);1772 WinQueryWindowRect(hwnd, &rcl);1773 if (WinPtInRect(WinQueryAnchorBlock(hwnd), &rcl, &ptl))1774 BubbleHelp(hwnd, FALSE, TRUE, FALSE, (char *)mp1);1764 (!hwndBubble || 1765 WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) && 1766 !WinQueryCapture(HWND_DESKTOP)) { 1767 1768 RECTL rcl; 1769 POINTL ptl; 1770 1771 WinQueryPointerPos(HWND_DESKTOP, &ptl); 1772 WinMapWindowPoints(HWND_DESKTOP, hwnd, &ptl, 1); 1773 WinQueryWindowRect(hwnd, &rcl); 1774 if (WinPtInRect(WinQueryAnchorBlock(hwnd), &rcl, &ptl)) 1775 BubbleHelp(hwnd, FALSE, TRUE, FALSE, (char *)mp1); 1775 1776 } 1776 1777 } … … 1791 1792 *szDrv = 0; 1792 1793 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1793 id + 50), sizeof(szDrv), szDrv);1794 id + 50), sizeof(szDrv), szDrv); 1794 1795 if (isalpha(*szDrv)) { 1795 1796 hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, MAIN_DRIVES); 1796 1797 if (hwndMenu) { 1797 BOOL rdy;1798 CHAR chDrv = *szDrv;1799 UINT iDrv;1800 1801 strcpy(szDrv + 2, "\\");1802 MakeValidDir(szDrv);1803 // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c1804 rdy = toupper(*szDrv) == toupper(chDrv);1805 iDrv = toupper(*szDrv) - 'A';1806 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOTE)1807 WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE);1808 1809 if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE) {1810 WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE);1811 WinEnableMenuItem(hwndMenu, IDM_FORMAT, FALSE);1812 WinEnableMenuItem(hwndMenu, IDM_OPTIMIZE, FALSE);1813 WinEnableMenuItem(hwndMenu, IDM_UNDELETE, FALSE);1814 }1815 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOVABLE) {1816 WinEnableMenuItem(hwndMenu, IDM_EJECT, FALSE);1817 WinEnableMenuItem(hwndMenu, IDM_LOCK, FALSE);1818 WinEnableMenuItem(hwndMenu, IDM_UNLOCK, FALSE);1819 }1820 if (!rdy) {1821 WinEnableMenuItem(hwndMenu, IDM_INFO, FALSE);1822 WinEnableMenuItem(hwndMenu, IDM_ARCHIVE, FALSE);1823 WinEnableMenuItem(hwndMenu, IDM_SIZES, FALSE);1824 WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE);1825 WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE);1826 }1827 /* fixme to be gone?1828 if (!rdy || ~driveflags[iDrv] & DRIVE_CDROM) {1829 WinEnableMenuItem(hwndMenu, IDM_CLOSETRAY, FALSE);1830 }1831 */1832 PopupMenu(hwnd, hwnd, hwndMenu);1798 BOOL rdy; 1799 CHAR chDrv = *szDrv; 1800 UINT iDrv; 1801 1802 strcpy(szDrv + 2, "\\"); 1803 MakeValidDir(szDrv); 1804 // Disable menus if MakeValidDir changes drive letter fixme this section doesn't do anything see treecnt.c 1805 rdy = toupper(*szDrv) == toupper(chDrv); 1806 iDrv = toupper(*szDrv) - 'A'; 1807 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOTE) 1808 WinEnableMenuItem(hwndMenu, IDM_DETACH, FALSE); 1809 1810 if (!rdy || driveflags[iDrv] & DRIVE_NOTWRITEABLE) { 1811 WinEnableMenuItem(hwndMenu, IDM_MKDIR, FALSE); 1812 WinEnableMenuItem(hwndMenu, IDM_FORMAT, FALSE); 1813 WinEnableMenuItem(hwndMenu, IDM_OPTIMIZE, FALSE); 1814 WinEnableMenuItem(hwndMenu, IDM_UNDELETE, FALSE); 1815 } 1816 if (!rdy || ~driveflags[iDrv] & DRIVE_REMOVABLE) { 1817 WinEnableMenuItem(hwndMenu, IDM_EJECT, FALSE); 1818 WinEnableMenuItem(hwndMenu, IDM_LOCK, FALSE); 1819 WinEnableMenuItem(hwndMenu, IDM_UNLOCK, FALSE); 1820 } 1821 if (!rdy) { 1822 WinEnableMenuItem(hwndMenu, IDM_INFO, FALSE); 1823 WinEnableMenuItem(hwndMenu, IDM_ARCHIVE, FALSE); 1824 WinEnableMenuItem(hwndMenu, IDM_SIZES, FALSE); 1825 WinEnableMenuItem(hwndMenu, IDM_SHOWALLFILES, FALSE); 1826 WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE); 1827 } 1828 /* fixme to be gone? 1829 if (!rdy || ~driveflags[iDrv] & DRIVE_CDROM) { 1830 WinEnableMenuItem(hwndMenu, IDM_CLOSETRAY, FALSE); 1831 } 1832 */ 1833 PopupMenu(hwnd, hwnd, hwndMenu); 1833 1834 } 1834 1835 } … … 1845 1846 *szDrv = 0; 1846 1847 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1847 id + 50), sizeof(szDrv), szDrv);1848 id + 50), sizeof(szDrv), szDrv); 1848 1849 if (isalpha(*szDrv)) { 1849 1850 strcat(szDrv, "\\"); 1850 1851 if (!FindDirCnrByName(szDrv, TRUE)) 1851 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szDrv);1852 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szDrv); 1852 1853 } 1853 1854 break; … … 1861 1862 *szDrv = 0; 1862 1863 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1863 id + 50), sizeof(szDrv), szDrv);1864 id + 50), sizeof(szDrv), szDrv); 1864 1865 if (isalpha(*szDrv)) { 1865 1866 strcat(szDrv, "\\"); … … 1872 1873 *szDrv = 0; 1873 1874 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1874 id + 50), sizeof(szDrv), szDrv);1875 id + 50), sizeof(szDrv), szDrv); 1875 1876 if (isalpha(*szDrv) && 1876 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) {1877 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1877 1878 if (!emphasized) { 1878 emphasized = TRUE;1879 DrawTargetEmphasis(hwnd, emphasized);1879 emphasized = TRUE; 1880 DrawTargetEmphasis(hwnd, emphasized); 1880 1881 } 1881 1882 if (AcceptOneDrop(hwnd, mp1, mp2)) 1882 return MRFROM2SHORT(DOR_DROP, DO_MOVE);1883 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 1883 1884 return MRFROM2SHORT(DOR_NEVERDROP, 0); 1884 1885 } … … 1889 1890 *szDrv = 0; 1890 1891 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1891 id + 50), sizeof(szDrv), szDrv);1892 id + 50), sizeof(szDrv), szDrv); 1892 1893 if (isalpha(*szDrv) && 1893 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) {1894 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1894 1895 if (emphasized) { 1895 emphasized = FALSE;1896 DrawTargetEmphasis(hwnd, emphasized);1896 emphasized = FALSE; 1897 DrawTargetEmphasis(hwnd, emphasized); 1897 1898 } 1898 1899 } … … 1903 1904 *szDrv = 0; 1904 1905 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1905 id + 50), sizeof(szDrv), szDrv);1906 id + 50), sizeof(szDrv), szDrv); 1906 1907 if (isalpha(*szDrv) && 1907 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) {1908 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1908 1909 DropHelp(mp1, mp2, hwnd, GetPString(IDS_DRIVEDROPHELP)); 1909 1910 return 0; … … 1915 1916 *szDrv = 0; 1916 1917 WinQueryWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 1917 id + 50), sizeof(szDrv), szDrv);1918 id + 50), sizeof(szDrv), szDrv); 1918 1919 if (isalpha(*szDrv) && 1919 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) {1920 !(driveflags[toupper(*szDrv) - 'A'] & DRIVE_NOTWRITEABLE)) { 1920 1921 1921 1922 CNRDRAGINFO cnd; … … 1924 1925 1925 1926 if (emphasized) { 1926 emphasized = FALSE;1927 DrawTargetEmphasis(hwnd, emphasized);1927 emphasized = FALSE; 1928 DrawTargetEmphasis(hwnd, emphasized); 1928 1929 } 1929 1930 memset(&cnd, 0, sizeof(cnd)); … … 1931 1932 cnd.pRecord = NULL; 1932 1933 li = DoFileDrop(hwnd, 1933 NULL,1934 TRUE, MPFROM2SHORT(TREE_CNR, CN_DROP), MPFROMP(&cnd));1934 NULL, 1935 TRUE, MPFROM2SHORT(TREE_CNR, CN_DROP), MPFROMP(&cnd)); 1935 1936 CheckPmDrgLimit(cnd.pDragInfo); 1936 1937 if (li) { 1937 strcpy(li->targetpath, szDrv);1938 strcat(li->targetpath, "\\");1939 if (li->list && li->list[0] && IsRoot(li->list[0]))1940 li->type = DO_LINK;1941 else if (fDragndropDlg && (!*li->arcname || !li->info)) {1942 1943 CHECKLIST cl;1944 1945 memset(&cl, 0, sizeof(cl));1946 cl.size = sizeof(cl);1947 cl.flags = li->type;1948 cl.list = li->list;1949 cl.cmd = li->type;1950 cl.prompt = li->targetpath;1951 li->type = WinDlgBox(HWND_DESKTOP,1952 hwndMain,1953 DropListProc,1954 FM3ModHandle, DND_FRAME, MPFROMP(&cl));1955 if (li->type == DID_ERROR)1956 Win_Error(DND_FRAME, HWND_DESKTOP, pszSrcFile, __LINE__,1957 "Drag & Drop Dialog");1958 if (!li->type) {1959 FreeListInfo(li);1960 return 0;1961 }1962 li->list = cl.list;1963 if (!li->list || !li->list[0]) {1964 FreeListInfo(li);1965 return 0;1966 }1967 }1968 else {1969 if (!WinDlgBox(HWND_DESKTOP,1970 hwndMain,1971 WalkDlgProc,1972 FM3ModHandle,1973 WALK_FRAME,1974 MPFROMP(li->targetpath)) || !*li->targetpath) {1975 FreeListInfo(li);1976 return 0;1977 }1978 }1979 switch (li->type) {1980 case DND_LAUNCH:1981 strcat(li->targetpath, " %a");1982 ExecOnList(hwndMain,1983 li->targetpath, PROMPT | WINDOWED, NULL, li->list, NULL,1984 pszSrcFile, __LINE__);1985 FreeList(li->list);1986 li->list = NULL;1987 break;1988 case DO_LINK:1989 if (fLinkSetsIcon) {1990 li->type = IDM_SETICON;1991 action = UM_MASSACTION;1992 }1993 else1994 li->type = IDM_COMPARE;1995 break;1996 case DND_EXTRACT:1997 if (*li->targetpath && !IsFile(li->targetpath))1998 li->type = IDM_EXTRACT;1999 break;2000 case DND_MOVE:2001 li->type = IDM_MOVE;2002 if (*li->targetpath && IsFile(li->targetpath) == 1) {2003 action = UM_MASSACTION;2004 li->type = IDM_ARCHIVEM;2005 }2006 break;2007 case DND_WILDMOVE:2008 li->type = IDM_WILDMOVE;2009 if (*li->targetpath && IsFile(li->targetpath) == 1) {2010 action = UM_MASSACTION;2011 li->type = IDM_ARCHIVEM;2012 }2013 break;2014 case DND_OBJECT:2015 li->type = IDM_OBJECT;2016 action = UM_MASSACTION;2017 break;2018 case DND_SHADOW:2019 li->type = IDM_SHADOW;2020 action = UM_MASSACTION;2021 break;2022 case DND_COMPARE:2023 li->type = IDM_COMPARE;2024 break;2025 case DND_SETICON:2026 action = UM_MASSACTION;2027 li->type = IDM_SETICON;2028 break;2029 case DND_COPY:2030 li->type = IDM_COPY;2031 if (*li->targetpath && IsFile(li->targetpath) == 1) {2032 action = UM_MASSACTION;2033 li->type = IDM_ARCHIVE;2034 }2035 break;2036 case DND_WILDCOPY:2037 li->type = IDM_WILDCOPY;2038 if (*li->targetpath && IsFile(li->targetpath) == 1) {2039 action = UM_MASSACTION;2040 li->type = IDM_ARCHIVE;2041 }2042 break;2043 default:2044 if (*li->arcname && li->info) {2045 action = UM_MASSACTION;2046 li->type = (li->type == DO_MOVE) ? IDM_FAKEEXTRACTM :2047 IDM_FAKEEXTRACT;2048 }2049 else if (*li->targetpath && IsFile(li->targetpath) == 1) {2050 action = UM_MASSACTION;2051 li->type = (li->type == DO_MOVE) ? IDM_ARCHIVEM : IDM_ARCHIVE;2052 }2053 else2054 li->type = (li->type == DO_MOVE) ? IDM_MOVE : IDM_COPY;2055 break;2056 }2057 if (!li->list || !li->list[0])2058 FreeListInfo(li);2059 else2060 WinSendMsg(hwndTree, UM_ACTION, MPFROMP(li), MPFROMLONG(action));1938 strcpy(li->targetpath, szDrv); 1939 strcat(li->targetpath, "\\"); 1940 if (li->list && li->list[0] && IsRoot(li->list[0])) 1941 li->type = DO_LINK; 1942 else if (fDragndropDlg && (!*li->arcname || !li->info)) { 1943 1944 CHECKLIST cl; 1945 1946 memset(&cl, 0, sizeof(cl)); 1947 cl.size = sizeof(cl); 1948 cl.flags = li->type; 1949 cl.list = li->list; 1950 cl.cmd = li->type; 1951 cl.prompt = li->targetpath; 1952 li->type = WinDlgBox(HWND_DESKTOP, 1953 hwndMain, 1954 DropListProc, 1955 FM3ModHandle, DND_FRAME, MPFROMP(&cl)); 1956 if (li->type == DID_ERROR) 1957 Win_Error(DND_FRAME, HWND_DESKTOP, pszSrcFile, __LINE__, 1958 "Drag & Drop Dialog"); 1959 if (!li->type) { 1960 FreeListInfo(li); 1961 return 0; 1962 } 1963 li->list = cl.list; 1964 if (!li->list || !li->list[0]) { 1965 FreeListInfo(li); 1966 return 0; 1967 } 1968 } 1969 else { 1970 if (!WinDlgBox(HWND_DESKTOP, 1971 hwndMain, 1972 WalkDlgProc, 1973 FM3ModHandle, 1974 WALK_FRAME, 1975 MPFROMP(li->targetpath)) || !*li->targetpath) { 1976 FreeListInfo(li); 1977 return 0; 1978 } 1979 } 1980 switch (li->type) { 1981 case DND_LAUNCH: 1982 strcat(li->targetpath, " %a"); 1983 ExecOnList(hwndMain, 1984 li->targetpath, PROMPT | WINDOWED, NULL, li->list, NULL, 1985 pszSrcFile, __LINE__); 1986 FreeList(li->list); 1987 li->list = NULL; 1988 break; 1989 case DO_LINK: 1990 if (fLinkSetsIcon) { 1991 li->type = IDM_SETICON; 1992 action = UM_MASSACTION; 1993 } 1994 else 1995 li->type = IDM_COMPARE; 1996 break; 1997 case DND_EXTRACT: 1998 if (*li->targetpath && !IsFile(li->targetpath)) 1999 li->type = IDM_EXTRACT; 2000 break; 2001 case DND_MOVE: 2002 li->type = IDM_MOVE; 2003 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2004 action = UM_MASSACTION; 2005 li->type = IDM_ARCHIVEM; 2006 } 2007 break; 2008 case DND_WILDMOVE: 2009 li->type = IDM_WILDMOVE; 2010 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2011 action = UM_MASSACTION; 2012 li->type = IDM_ARCHIVEM; 2013 } 2014 break; 2015 case DND_OBJECT: 2016 li->type = IDM_OBJECT; 2017 action = UM_MASSACTION; 2018 break; 2019 case DND_SHADOW: 2020 li->type = IDM_SHADOW; 2021 action = UM_MASSACTION; 2022 break; 2023 case DND_COMPARE: 2024 li->type = IDM_COMPARE; 2025 break; 2026 case DND_SETICON: 2027 action = UM_MASSACTION; 2028 li->type = IDM_SETICON; 2029 break; 2030 case DND_COPY: 2031 li->type = IDM_COPY; 2032 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2033 action = UM_MASSACTION; 2034 li->type = IDM_ARCHIVE; 2035 } 2036 break; 2037 case DND_WILDCOPY: 2038 li->type = IDM_WILDCOPY; 2039 if (*li->targetpath && IsFile(li->targetpath) == 1) { 2040 action = UM_MASSACTION; 2041 li->type = IDM_ARCHIVE; 2042 } 2043 break; 2044 default: 2045 if (*li->arcname && li->info) { 2046 action = UM_MASSACTION; 2047 li->type = (li->type == DO_MOVE) ? IDM_FAKEEXTRACTM : 2048 IDM_FAKEEXTRACT; 2049 } 2050 else if (*li->targetpath && IsFile(li->targetpath) == 1) { 2051 action = UM_MASSACTION; 2052 li->type = (li->type == DO_MOVE) ? IDM_ARCHIVEM : IDM_ARCHIVE; 2053 } 2054 else 2055 li->type = (li->type == DO_MOVE) ? IDM_MOVE : IDM_COPY; 2056 break; 2057 } 2058 if (!li->list || !li->list[0]) 2059 FreeListInfo(li); 2060 else 2061 WinSendMsg(hwndTree, UM_ACTION, MPFROMP(li), MPFROMLONG(action)); 2061 2062 } 2062 2063 return 0; … … 2092 2093 for (x = 0; x < 26; x++) { 2093 2094 if ((ulDriveMap & (1L << x)) && !(driveflags[x] & DRIVE_IGNORE)) { 2094 if (x > 1) {2095 if (driveflags[x] & DRIVE_CDROM)2096 iconid = CDROM_ICON;2097 else2098 iconid = (driveflags[x] & DRIVE_REMOVABLE) ?2099 REMOVABLE_ICON :2100 (driveflags[x] & DRIVE_VIRTUAL) ?2101 VIRTUAL_ICON :2102 (driveflags[x] & DRIVE_REMOTE) ?2103 REMOTE_ICON :2104 (driveflags[x] & DRIVE_RAMDISK) ?2105 RAMDISK_ICON :2106 (driveflags[x] & DRIVE_ZIPSTREAM) ?2107 ZIPSTREAM_ICON :DRIVE_ICON;2108 }2109 else2110 iconid = FLOPPY_ICON;2111 sprintf(s, "#%lu", iconid);2112 hwndB = WinCreateWindow(hwndT,2113 WC_DRIVEBUTTONS,2114 s,2115 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON,2116 0,2117 0,2118 28,2119 18,2120 hwndT, HWND_TOP, y + IDM_DRIVEA, NULL, NULL);2121 if (!hwndB)2122 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,2123 IDS_WINCREATEWINDOW);2124 else {2125 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);2126 sprintf(s, "%c:", (CHAR) x + 'A');2127 hwndB = WinCreateWindow(hwndT,2128 WC_STATIC,2129 s,2130 SS_TEXT | DT_LEFT | DT_VCENTER,2131 0,2132 0,2133 10,2134 18,2135 hwndT,2136 HWND_TOP, y + IDM_DRIVEATEXT, NULL, NULL);2137 if (!hwndB)2138 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__,2139 IDS_WINCREATEWINDOW);2140 else {2141 SetPresParams(hwndB,2142 &RGBGREY,2143 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT));2144 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);2145 }2146 y++;2147 }2095 if (x > 1) { 2096 if (driveflags[x] & DRIVE_CDROM) 2097 iconid = CDROM_ICON; 2098 else 2099 iconid = (driveflags[x] & DRIVE_REMOVABLE) ? 2100 REMOVABLE_ICON : 2101 (driveflags[x] & DRIVE_VIRTUAL) ? 2102 VIRTUAL_ICON : 2103 (driveflags[x] & DRIVE_REMOTE) ? 2104 REMOTE_ICON : 2105 (driveflags[x] & DRIVE_RAMDISK) ? 2106 RAMDISK_ICON : 2107 (driveflags[x] & DRIVE_ZIPSTREAM) ? 2108 ZIPSTREAM_ICON :DRIVE_ICON; 2109 } 2110 else 2111 iconid = FLOPPY_ICON; 2112 sprintf(s, "#%lu", iconid); 2113 hwndB = WinCreateWindow(hwndT, 2114 WC_DRIVEBUTTONS, 2115 s, 2116 BS_NOPOINTERFOCUS | BS_BITMAP | BS_PUSHBUTTON, 2117 0, 2118 0, 2119 28, 2120 18, 2121 hwndT, HWND_TOP, y + IDM_DRIVEA, NULL, NULL); 2122 if (!hwndB) 2123 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 2124 IDS_WINCREATEWINDOW); 2125 else { 2126 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); 2127 sprintf(s, "%c:", (CHAR) x + 'A'); 2128 hwndB = WinCreateWindow(hwndT, 2129 WC_STATIC, 2130 s, 2131 SS_TEXT | DT_LEFT | DT_VCENTER, 2132 0, 2133 0, 2134 10, 2135 18, 2136 hwndT, 2137 HWND_TOP, y + IDM_DRIVEATEXT, NULL, NULL); 2138 if (!hwndB) 2139 Win_Error2(hwndT, HWND_DESKTOP, pszSrcFile, __LINE__, 2140 IDS_WINCREATEWINDOW); 2141 else { 2142 SetPresParams(hwndB, 2143 &RGBGREY, 2144 &RGBBLACK, &RGBGREY, GetPString(IDS_6HELVTEXT)); 2145 WinSetWindowPos(hwndB, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER); 2146 } 2147 y++; 2148 } 2148 2149 } 2149 2150 } // for 2150 2151 } // if drivebar 2151 2152 PostMsg(WinQueryWindow(hwndT, QW_PARENT), 2152 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);2153 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 2153 2154 } 2154 2155 … … 2166 2167 WinQueryWindowRect(hwndT, &rcl); 2167 2168 xwidth = rcl.xRight - ((WinQuerySysValue(HWND_DESKTOP, 2168 SV_CYSIZEBORDER) * 2) + 2);2169 SV_CYSIZEBORDER) * 2) + 2); 2169 2170 } 2170 2171 henum = WinBeginEnumWindows(hwndT); … … 2175 2176 ctrlxsize = 28; 2176 2177 WinSetWindowPos(hwndB, 2177 HWND_TOP,2178 ctrlxpos, ctrlypos, ctrlxsize, 18, SWP_MOVE | SWP_SHOW);2178 HWND_TOP, 2179 ctrlxpos, ctrlypos, ctrlxsize, 18, SWP_MOVE | SWP_SHOW); 2179 2180 ctrlxpos += (ctrlxsize + 2); 2180 2181 if (ctrlxsize == 10) { 2181 2182 if (ctrlxpos + (42 + ((fShowTarget && DriveLines == 0) ? 2182 256 : 0)) > xwidth) {2183 ctrlxpos = 2;2184 ctrlypos += 18;2185 DriveLines++;2183 256 : 0)) > xwidth) { 2184 ctrlxpos = 2; 2185 ctrlypos += 18; 2186 DriveLines++; 2186 2187 } 2187 2188 } … … 2202 2203 2203 2204 SetPresParams(hwnd, 2204 &RGBGREY,2205 &RGBBLACK, &RGBGREY, GetPString(IDS_8HELVBOLDTEXT));2205 &RGBGREY, 2206 &RGBBLACK, &RGBGREY, GetPString(IDS_8HELVBOLDTEXT)); 2206 2207 return mr; 2207 2208 } … … 2213 2214 2214 2215 cbRetLen = WinQueryPresParam(hwnd, 2215 (ULONG) mp1,2216 0,2217 &AttrFound,2218 (ULONG) sizeof(AttrValue), &AttrValue, 0);2216 (ULONG) mp1, 2217 0, 2218 &AttrFound, 2219 (ULONG) sizeof(AttrValue), &AttrValue, 0); 2219 2220 if (cbRetLen) { 2220 PostMsg(WinQueryWindow(hwnd, QW_PARENT),2221 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);2221 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 2222 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 2222 2223 } 2223 2224 } … … 2236 2237 WinQueryWindowPos(hwndTree, &swp); 2237 2238 if (!(swp.fl & SWP_MAXIMIZE)) 2238 fl |= SWP_RESTORE;2239 fl |= SWP_RESTORE; 2239 2240 WinSetWindowPos(hwndTree, HWND_TOP, 0, 0, 0, 0, fl); 2240 2241 } … … 2269 2270 2270 2271 if (fOtherHelp) { 2271 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd)2272 && !WinQueryCapture(HWND_DESKTOP)) {2273 switch (id) {2274 case IDM_ATTRS:2275 if (WinQueryWindowTextLength(hwnd))2276 s = GetPString(IDS_ATTRSBUTTONHELP);2277 break;2278 case IDM_INFO:2279 if (WinQueryWindowTextLength(hwnd))2280 s = GetPString(IDS_INFOBUTTONHELP);2281 break;2282 case IDM_RENAME:2283 if (WinQueryWindowTextLength(hwnd))2284 s = GetPString(IDS_NAMEBUTTONHELP);2285 break;2286 case MAIN_STATUS2:2287 if (!hwndE)2288 s = GetPString(IDS_STATUS2HELP);2289 break;2290 default:2291 break;2292 }2293 if (s)2294 MakeBubble(hwnd, FALSE, s);2295 else if (hwndBubble)2296 WinDestroyWindow(hwndBubble);2297 }2272 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 2273 && !WinQueryCapture(HWND_DESKTOP)) { 2274 switch (id) { 2275 case IDM_ATTRS: 2276 if (WinQueryWindowTextLength(hwnd)) 2277 s = GetPString(IDS_ATTRSBUTTONHELP); 2278 break; 2279 case IDM_INFO: 2280 if (WinQueryWindowTextLength(hwnd)) 2281 s = GetPString(IDS_INFOBUTTONHELP); 2282 break; 2283 case IDM_RENAME: 2284 if (WinQueryWindowTextLength(hwnd)) 2285 s = GetPString(IDS_NAMEBUTTONHELP); 2286 break; 2287 case MAIN_STATUS2: 2288 if (!hwndE) 2289 s = GetPString(IDS_STATUS2HELP); 2290 break; 2291 default: 2292 break; 2293 } 2294 if (s) 2295 MakeBubble(hwnd, FALSE, s); 2296 else if (hwndBubble) 2297 WinDestroyWindow(hwndBubble); 2298 } 2298 2299 } 2299 2300 switch (id) { … … 2302 2303 case IDM_RENAME: 2303 2304 case MAIN_STATUS2: 2304 return CommonTextProc(hwnd, msg, mp1, mp2);2305 return CommonTextProc(hwnd, msg, mp1, mp2); 2305 2306 default: 2306 break;2307 break; 2307 2308 } 2308 2309 } … … 2327 2328 case IDM_RENAME: 2328 2329 case MAIN_STATUS2: 2329 return CommonTextButton(hwnd, msg, mp1, mp2);2330 return CommonTextButton(hwnd, msg, mp1, mp2); 2330 2331 default: 2331 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);2332 break;2332 PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID); 2333 break; 2333 2334 } 2334 2335 } … … 2342 2343 id = WinQueryWindowUShort(hwnd, QWS_ID); 2343 2344 if (id == MAIN_STATUS2 && hwndE) 2344 WinSendMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);2345 WinSendMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2345 2346 else 2346 return CommonTextButton(hwnd, msg, mp1, mp2);2347 return CommonTextButton(hwnd, msg, mp1, mp2); 2347 2348 } 2348 2349 break; … … 2354 2355 id = WinQueryWindowUShort(hwnd, QWS_ID); 2355 2356 if (id == MAIN_STATUS) { 2356 if (SHORT2FROMMP(mp2) & KC_CTRL)2357 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),2358 FID_CLIENT),2359 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID);2360 else if (hwndTree)2361 PostMsg(hwndTree, UM_TIMER, MPVOID, MPVOID);2357 if (SHORT2FROMMP(mp2) & KC_CTRL) 2358 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2359 FID_CLIENT), 2360 WM_COMMAND, MPFROM2SHORT(IDM_WINDOWDLG, 0), MPVOID); 2361 else if (hwndTree) 2362 PostMsg(hwndTree, UM_TIMER, MPVOID, MPVOID); 2362 2363 } 2363 2364 } … … 2372 2373 if (id == MAIN_STATUS2 && !hwndE) { 2373 2374 2374 SWP swp;2375 CHAR directory[CCHMAXPATH];2376 PFNWP oldproce;2377 2378 *directory = 0;2379 TopWindowName(hwndMain, (HWND) 0, directory);2380 WinQueryWindowPos(hwnd, &swp);2381 hwndB = WinCreateWindow(hwnd,2382 WC_BUTTON,2383 "+",2384 WS_VISIBLE | BS_PUSHBUTTON |2385 BS_NOPOINTERFOCUS,2386 swp.cx - swp.cy,2387 0,2388 swp.cy,2389 swp.cy,2390 hwnd, HWND_TOP, COMMAND_BUTTON, NULL, NULL);2391 if (!hwndB)2392 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);2393 hwndE = WinCreateWindow(hwnd,2394 WC_ENTRYFIELD,2395 NULL,2396 WS_VISIBLE | ES_AUTOSCROLL,2397 0,2398 0,2399 swp.cx - swp.cy,2400 swp.cy,2401 hwnd, HWND_TOP, COMMAND_LINE, NULL, NULL);2402 if (!hwndE)2403 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);2404 if (!hwndE || !hwndB) {2405 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);2406 return 0;2407 }2408 WinSendMsg(hwndE, EM_SETTEXTLIMIT, MPFROM2SHORT(1024, 0), MPVOID);2409 WinSetWindowText(hwndStatus, directory);2410 if (*lastcmd)2411 WinSetWindowText(hwndE, lastcmd);2412 else2413 WinSetWindowText(hwndE, GetPString(IDS_HELPCMDTEXT));2414 oldproce = WinSubclassWindow(hwndE, (PFNWP) CommandLineProc);2415 if (oldproce)2416 WinSetWindowPtr(hwndE, QWL_USER, (PVOID) oldproce);2417 PostMsg(hwndE, UM_FOCUSME, MPVOID, MPVOID);2418 PostMsg(hwndE, EM_SETSEL, MPFROM2SHORT(0, 1024), MPVOID);2419 return 0;2375 SWP swp; 2376 CHAR directory[CCHMAXPATH]; 2377 PFNWP oldproce; 2378 2379 *directory = 0; 2380 TopWindowName(hwndMain, (HWND) 0, directory); 2381 WinQueryWindowPos(hwnd, &swp); 2382 hwndB = WinCreateWindow(hwnd, 2383 WC_BUTTON, 2384 "+", 2385 WS_VISIBLE | BS_PUSHBUTTON | 2386 BS_NOPOINTERFOCUS, 2387 swp.cx - swp.cy, 2388 0, 2389 swp.cy, 2390 swp.cy, 2391 hwnd, HWND_TOP, COMMAND_BUTTON, NULL, NULL); 2392 if (!hwndB) 2393 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 2394 hwndE = WinCreateWindow(hwnd, 2395 WC_ENTRYFIELD, 2396 NULL, 2397 WS_VISIBLE | ES_AUTOSCROLL, 2398 0, 2399 0, 2400 swp.cx - swp.cy, 2401 swp.cy, 2402 hwnd, HWND_TOP, COMMAND_LINE, NULL, NULL); 2403 if (!hwndE) 2404 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 2405 if (!hwndE || !hwndB) { 2406 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2407 return 0; 2408 } 2409 WinSendMsg(hwndE, EM_SETTEXTLIMIT, MPFROM2SHORT(1024, 0), MPVOID); 2410 WinSetWindowText(hwndStatus, directory); 2411 if (*lastcmd) 2412 WinSetWindowText(hwndE, lastcmd); 2413 else 2414 WinSetWindowText(hwndE, GetPString(IDS_HELPCMDTEXT)); 2415 oldproce = WinSubclassWindow(hwndE, (PFNWP) CommandLineProc); 2416 if (oldproce) 2417 WinSetWindowPtr(hwndE, QWL_USER, (PVOID) oldproce); 2418 PostMsg(hwndE, UM_FOCUSME, MPVOID, MPVOID); 2419 PostMsg(hwndE, EM_SETSEL, MPFROM2SHORT(0, 1024), MPVOID); 2420 return 0; 2420 2421 } 2421 2422 if (msg == UM_CLICKED3 || (SHORT2FROMMP(mp2) & KC_CTRL)) { 2422 switch (id) {2423 case IDM_ATTRS:2424 id = IDM_SORTSIZE;2425 break;2426 case IDM_INFO:2427 id = IDM_SORTLWDATE;2428 break;2429 case IDM_RENAME:2430 id = IDM_SORTFILENAME;2431 break;2432 }2423 switch (id) { 2424 case IDM_ATTRS: 2425 id = IDM_SORTSIZE; 2426 break; 2427 case IDM_INFO: 2428 id = IDM_SORTLWDATE; 2429 break; 2430 case IDM_RENAME: 2431 id = IDM_SORTFILENAME; 2432 break; 2433 } 2433 2434 } 2434 2435 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 2435 WM_COMMAND, MPFROM2SHORT(id, 0), MPVOID);2436 WM_COMMAND, MPFROM2SHORT(id, 0), MPVOID); 2436 2437 } 2437 2438 return 0; … … 2447 2448 case IDM_RENAME: 2448 2449 case MAIN_STATUS2: 2449 PaintRecessedWindow(hwnd, (HPS) 0, TRUE, FALSE);2450 break;2450 PaintRecessedWindow(hwnd, (HPS) 0, TRUE, FALSE); 2451 break; 2451 2452 default: 2452 PaintRecessedWindow(hwnd, (HPS) 0, FALSE, TRUE);2453 break;2453 PaintRecessedWindow(hwnd, (HPS) 0, FALSE, TRUE); 2454 break; 2454 2455 } 2455 2456 if (id == IDM_RENAME) { 2456 2457 2457 HPS hps;2458 2459 hps = WinBeginPaint(hwnd, (HPS) 0, NULL);2460 if (hps) {2461 PaintSTextWindow(hwnd, hps);2462 WinEndPaint(hps);2463 }2464 return 0;2458 HPS hps; 2459 2460 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 2461 if (hps) { 2462 PaintSTextWindow(hwnd, hps); 2463 WinEndPaint(hps); 2464 } 2465 return 0; 2465 2466 } 2466 2467 } … … 2495 2496 case UM_COMMAND: 2496 2497 return WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2497 FID_CLIENT), msg, mp1, mp2);2498 FID_CLIENT), msg, mp1, mp2); 2498 2499 2499 2500 case WM_PAINT: … … 2508 2509 hps = WinBeginPaint(hwnd, (HPS)0, NULL); 2509 2510 if (hps) { 2510 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL);2511 WinQueryPresParam(hwnd, PP_BACKGROUNDCOLOR, 0, NULL,2512 sizeof(lColor), &lColor, 0);2513 WinQueryWindowRect(hwnd, &rcl);2514 WinFillRect(hps, &rcl, lColor);2515 WinEndPaint(hps);2511 GpiCreateLogColorTable(hps, 0, LCOLF_RGB, 0, 0, NULL); 2512 WinQueryPresParam(hwnd, PP_BACKGROUNDCOLOR, 0, NULL, 2513 sizeof(lColor), &lColor, 0); 2514 WinQueryWindowRect(hwnd, &rcl); 2515 WinFillRect(hps, &rcl, lColor); 2516 WinEndPaint(hps); 2516 2517 } 2517 2518 … … 2532 2533 tool = find_tool(id); 2533 2534 if (tool) { 2534 del_tool(tool);2535 WinShowWindow(WinWindowFromID(hwnd, id), FALSE);2536 if (fToolTitles)2537 WinShowWindow(WinWindowFromID(hwnd, id + 25000), FALSE);2538 ResizeTools(hwnd);2535 del_tool(tool); 2536 WinShowWindow(WinWindowFromID(hwnd, id), FALSE); 2537 if (fToolTitles) 2538 WinShowWindow(WinWindowFromID(hwnd, id + 25000), FALSE); 2539 ResizeTools(hwnd); 2539 2540 } 2540 2541 } … … 2546 2547 2547 2548 id = (USHORT) WinDlgBox(HWND_DESKTOP, 2548 hwnd,2549 AddToolProc,2550 FM3ModHandle, ADDBTN_FRAME, MPVOID);2549 hwnd, 2550 AddToolProc, 2551 FM3ModHandle, ADDBTN_FRAME, MPVOID); 2551 2552 if (id && id != (USHORT) - 1) 2552 WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),2553 FID_CLIENT),2554 WM_COMMAND,2555 MPFROM2SHORT(IDM_CREATETOOL, 0), MPFROM2SHORT(id, 0));2553 WinSendMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 2554 FID_CLIENT), 2555 WM_COMMAND, 2556 MPFROM2SHORT(IDM_CREATETOOL, 0), MPFROM2SHORT(id, 0)); 2556 2557 } 2557 2558 break; … … 2559 2560 case WM_CONTEXTMENU: 2560 2561 if (WinDlgBox(HWND_DESKTOP, 2561 hwnd, ToolIODlgProc, FM3ModHandle, SVBTN_FRAME, MPVOID))2562 hwnd, ToolIODlgProc, FM3ModHandle, SVBTN_FRAME, MPVOID)) 2562 2563 BuildTools(hwnd, TRUE); 2563 2564 return MRFROMSHORT(TRUE); … … 2582 2583 if (pswp) { 2583 2584 if (WinQueryWindowPos(hwndTree, &swp) && 2584 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE))) {2585 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE))) { 2585 2586 pswp->x = swp.cx; 2586 2587 pswp->cx -= swp.cx; … … 2589 2590 if (prectl) { 2590 2591 if (WinQueryWindowPos(hwndTree, &swp) && 2591 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE)) &&2592 WinQueryWindowRect(hwndTree, &rectl)) {2592 !(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE)) && 2593 WinQueryWindowRect(hwndTree, &rectl)) { 2593 2594 prectl->xLeft = rectl.xRight; 2594 2595 prectl->xRight -= rectl.xRight; … … 2642 2643 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 2643 2644 if (swp.x < swpT.cx) { 2644 swp.x = swpT.cx;2645 if (swp.x + swp.cx > swpC.cx)2646 swp.cx = swpC.cx - swp.x;2647 if (swp.cx > 24)2648 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy,2649 SWP_SIZE | SWP_MOVE | SWP_SHOW);2645 swp.x = swpT.cx; 2646 if (swp.x + swp.cx > swpC.cx) 2647 swp.cx = swpC.cx - swp.x; 2648 if (swp.cx > 24) 2649 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 2650 SWP_SIZE | SWP_MOVE | SWP_SHOW); 2650 2651 } 2651 2652 } … … 2667 2668 WinSetWindowUShort(hwndChild, QWS_YMINIMIZE, (USHORT) - 1); 2668 2669 WinSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0, 2669 SWP_MOVE | SWP_SHOW | SWP_FOCUSDEACTIVATE);2670 SWP_MOVE | SWP_SHOW | SWP_FOCUSDEACTIVATE); 2670 2671 } 2671 2672 } … … 2689 2690 if (hwndNext) { 2690 2691 if (!WinQueryWindowUShort(hwndNext, QWS_ID)) 2691 continue;2692 continue; 2692 2693 if (next) 2693 break;2694 break; 2694 2695 if (hwndNext == hwndActive) { 2695 if (!previous && hwndPrev) {2696 hwndNext = hwndPrev;2697 break;2698 }2699 else if (previous)2700 next = TRUE;2696 if (!previous && hwndPrev) { 2697 hwndNext = hwndPrev; 2698 break; 2699 } 2700 else if (previous) 2701 next = TRUE; 2701 2702 } 2702 2703 hwndPrev = hwndNext; … … 2704 2705 else { 2705 2706 if ((!next && previous) || once) 2706 break;2707 break; 2707 2708 else if (!previous) { 2708 hwndNext = hwndPrev;2709 break;2709 hwndNext = hwndPrev; 2710 break; 2710 2711 } 2711 2712 else 2712 once = next = TRUE;2713 once = next = TRUE; 2713 2714 } 2714 2715 } … … 2717 2718 if (hwndNext && hwndNext != hwndActive) { 2718 2719 WinSetWindowPos(hwndNext, HWND_TOP, 0, 0, 0, 0, 2719 SWP_ZORDER | SWP_ACTIVATE);2720 SWP_ZORDER | SWP_ACTIVATE); 2720 2721 WinSetWindowPos(hwndActive, ((previous) ? HWND_BOTTOM : hwndNext), 0, 0, 2721 0, 0, SWP_ZORDER);2722 0, 0, SWP_ZORDER); 2722 2723 } 2723 2724 } … … 2734 2735 if (hwndChild != hwndTree) { 2735 2736 WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2736 WM_SAVEAPPLICATION, MPVOID, MPVOID);2737 WM_SAVEAPPLICATION, MPVOID, MPVOID); 2737 2738 if (WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2738 WM_CLOSE, MPVOID, MPVOID)) {2739 ret = TRUE;2740 break;2739 WM_CLOSE, MPVOID, MPVOID)) { 2740 ret = TRUE; 2741 break; 2741 2742 } 2742 2743 } … … 2761 2762 hwndTemp = WinWindowFromID(hwndChild, FID_CLIENT); 2762 2763 if (hwndTemp) { 2763 hwndDir = WinWindowFromID(hwndTemp, DIR_CNR);2764 if (hwndDir) {2765 WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT),2766 WM_CLOSE, MPVOID, MPVOID);2767 ret = TRUE;2768 }2764 hwndDir = WinWindowFromID(hwndTemp, DIR_CNR); 2765 if (hwndDir) { 2766 WinSendMsg(WinWindowFromID(hwndChild, FID_CLIENT), 2767 WM_CLOSE, MPVOID, MPVOID); 2768 ret = TRUE; 2769 } 2769 2770 } 2770 2771 } … … 2814 2815 hwndC = WinWindowFromID(hwndChild, FID_CLIENT); 2815 2816 if (hwndC) { 2816 hwndDir = WinWindowFromID(hwndC, DIR_CNR);2817 if (hwndDir) {2818 WinQueryWindowPos(hwndChild, &swp);2819 *szDir = 0;2820 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(szDir), MPVOID);2821 if (*szDir) {2822 // If saving shutdown state skip no prescan drives2823 if (fIsShutDownState &&2824 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) {2825 continue;2826 }2827 sprintf(szKey, "%sDirCnrPos.%lu", szPrefix, numsaves);2828 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & swp,2829 sizeof(SWP));2830 dcd =2831 WinQueryWindowPtr(WinWindowFromID(hwndC, DIR_CNR), QWL_USER);2832 if (dcd) {2833 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, numsaves);2834 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->sortFlags,2835 sizeof(INT));2836 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, numsaves);2837 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->mask,2838 sizeof(MASK));2839 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, numsaves);2840 flWindowAttr = dcd->flWindowAttr;2841 if (!fLeaveTree && (flWindowAttr & CV_TREE)) {2842 flWindowAttr &= (~(CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT));2843 if (dcd->lastattr) {2844 if (dcd->lastattr & CV_TEXT)2845 flWindowAttr |= CV_TEXT;2846 else if (dcd->lastattr & CV_DETAIL)2847 flWindowAttr |= CV_DETAIL;2848 else if (dcd->lastattr & CV_ICON)2849 flWindowAttr |= CV_ICON;2850 else2851 flWindowAttr |= CV_NAME;2852 }2853 else2854 flWindowAttr |= CV_NAME;2855 }2856 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & flWindowAttr,2857 sizeof(ULONG));2858 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, numsaves);2859 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslongname,2860 sizeof(BOOL));2861 sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, numsaves);2862 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailssubject,2863 sizeof(BOOL));2864 sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, numsaves);2865 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailssize,2866 sizeof(BOOL));2867 sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, numsaves);2868 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailsea,2869 sizeof(BOOL));2870 sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, numsaves);2871 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailsattr,2872 sizeof(BOOL));2873 sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, numsaves);2874 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailsicon,2875 sizeof(BOOL));2876 sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, numsaves);2877 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslwdate,2878 sizeof(BOOL));2879 sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, numsaves);2880 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslwtime,2881 sizeof(BOOL));2882 sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, numsaves);2883 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailsladate,2884 sizeof(BOOL));2885 sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, numsaves);2886 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslatime,2887 sizeof(BOOL));2888 sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, numsaves);2889 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailscrdate,2890 sizeof(BOOL));2891 sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, numsaves);2892 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailscrtime,2893 sizeof(BOOL));2894 sprintf(szKey, "%sDirCnr.%lu", szPrefix, numsaves);2895 SavePresParams(hwndDir, szKey);2896 }2897 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, numsaves++);2898 PrfWriteProfileString(fmprof, FM3Str, szKey, szDir);2899 nSaved++;2900 }2901 }2817 hwndDir = WinWindowFromID(hwndC, DIR_CNR); 2818 if (hwndDir) { 2819 WinQueryWindowPos(hwndChild, &swp); 2820 *szDir = 0; 2821 WinSendMsg(hwndC, UM_CONTAINERDIR, MPFROMP(szDir), MPVOID); 2822 if (*szDir) { 2823 // If saving shutdown state skip no prescan drives 2824 if (fIsShutDownState && 2825 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) { 2826 continue; 2827 } 2828 sprintf(szKey, "%sDirCnrPos.%lu", szPrefix, numsaves); 2829 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & swp, 2830 sizeof(SWP)); 2831 dcd = 2832 WinQueryWindowPtr(WinWindowFromID(hwndC, DIR_CNR), QWL_USER); 2833 if (dcd) { 2834 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, numsaves); 2835 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->sortFlags, 2836 sizeof(INT)); 2837 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, numsaves); 2838 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->mask, 2839 sizeof(MASK)); 2840 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, numsaves); 2841 flWindowAttr = dcd->flWindowAttr; 2842 if (!fLeaveTree && (flWindowAttr & CV_TREE)) { 2843 flWindowAttr &= (~(CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT)); 2844 if (dcd->lastattr) { 2845 if (dcd->lastattr & CV_TEXT) 2846 flWindowAttr |= CV_TEXT; 2847 else if (dcd->lastattr & CV_DETAIL) 2848 flWindowAttr |= CV_DETAIL; 2849 else if (dcd->lastattr & CV_ICON) 2850 flWindowAttr |= CV_ICON; 2851 else 2852 flWindowAttr |= CV_NAME; 2853 } 2854 else 2855 flWindowAttr |= CV_NAME; 2856 } 2857 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & flWindowAttr, 2858 sizeof(ULONG)); 2859 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, numsaves); 2860 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslongname, 2861 sizeof(BOOL)); 2862 sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, numsaves); 2863 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailssubject, 2864 sizeof(BOOL)); 2865 sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, numsaves); 2866 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailssize, 2867 sizeof(BOOL)); 2868 sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, numsaves); 2869 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailsea, 2870 sizeof(BOOL)); 2871 sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, numsaves); 2872 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailsattr, 2873 sizeof(BOOL)); 2874 sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, numsaves); 2875 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailsicon, 2876 sizeof(BOOL)); 2877 sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, numsaves); 2878 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslwdate, 2879 sizeof(BOOL)); 2880 sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, numsaves); 2881 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslwtime, 2882 sizeof(BOOL)); 2883 sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, numsaves); 2884 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailsladate, 2885 sizeof(BOOL)); 2886 sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, numsaves); 2887 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailslatime, 2888 sizeof(BOOL)); 2889 sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, numsaves); 2890 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailscrdate, 2891 sizeof(BOOL)); 2892 sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, numsaves); 2893 PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->detailscrtime, 2894 sizeof(BOOL)); 2895 sprintf(szKey, "%sDirCnr.%lu", szPrefix, numsaves); 2896 SavePresParams(hwndDir, szKey); 2897 } 2898 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, numsaves++); 2899 PrfWriteProfileString(fmprof, FM3Str, szKey, szDir); 2900 nSaved++; 2901 } 2902 } 2902 2903 } 2903 2904 } … … 2945 2946 if (hwnd) { 2946 2947 if (WinQueryWindowPos(hwnd, &swp)) { 2947 if (pswp->x > swp.cx)2948 pswp->x = (swp.cx > 24) ? swp.cx - 24 : swp.cx;2949 if (pswp->y > swp.cy)2950 pswp->y = (swp.cy > 24) ? swp.cy - 24 : swp.cy;2951 if (pswp->x + pswp->cx > swp.cx)2952 pswp->cx = swp.cx - pswp->x;2953 if (pswp->y + pswp->cy > swp.cy)2954 pswp->cy = swp.cy - pswp->y;2948 if (pswp->x > swp.cx) 2949 pswp->x = (swp.cx > 24) ? swp.cx - 24 : swp.cx; 2950 if (pswp->y > swp.cy) 2951 pswp->y = (swp.cy > 24) ? swp.cy - 24 : swp.cy; 2952 if (pswp->x + pswp->cx > swp.cx) 2953 pswp->cx = swp.cx - pswp->x; 2954 if (pswp->y + pswp->cy > swp.cy) 2955 pswp->cy = swp.cy - pswp->y; 2955 2956 } 2956 2957 } … … 2999 3000 sprintf(szKey, "%sMySizeLastTime", szPrefix); 3000 3001 if (!PrfQueryProfileData(fmprof, 3001 FM3Str,3002 szKey,3003 (PVOID) & swpO,3004 &size) ||3002 FM3Str, 3003 szKey, 3004 (PVOID) & swpO, 3005 &size) || 3005 3006 size != sizeof(SWP) || !swp.cx || !swp.cy) 3006 3007 { … … 3030 3031 swp.fl &= (~SWP_ACTIVATE); 3031 3032 WinSetWindowPos(hwndTree, 3032 HWND_TOP,3033 swp.x,3034 swp.y,3035 swp.cx,3036 swp.cy,3037 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER);3033 HWND_TOP, 3034 swp.x, 3035 swp.y, 3036 swp.cx, 3037 swp.cy, 3038 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER); 3038 3039 } 3039 3040 else { 3040 3041 WinSetWindowPos(hwndTree, 3041 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW);3042 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW); 3042 3043 WinSetWindowUShort(hwndTree, QWS_XRESTORE, (USHORT) swp.x); 3043 3044 WinSetWindowUShort(hwndTree, QWS_CXRESTORE, (USHORT) swp.cx); … … 3049 3050 sprintf(szKey, "%sNumDirsLastTime", szPrefix); 3050 3051 if (PrfQueryProfileData(fmprof, 3051 FM3Str, szKey, (PVOID) & numsaves, &size) && numsaves) {3052 FM3Str, szKey, (PVOID) & numsaves, &size) && numsaves) { 3052 3053 if (fDeleteState) 3053 3054 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); … … 3056 3057 size = sizeof(SWP); 3057 3058 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) &swp, &size)) { 3058 if (fDeleteState)3059 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3060 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, x);3061 size = sizeof(szDir);3062 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) szDir, &size)) {3063 // If restoring shutdown state and drive marked no prescan3064 // bypass window restore3065 if (fIsShutDownState &&3066 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) {3067 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3068 continue;3069 }3070 if (fDeleteState)3071 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3072 localdcd.detailslongname = detailslongname; // Set default3073 size = sizeof(BOOL);3074 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, x);3075 if (PrfQueryProfileData(fmprof,3076 FM3Str,3077 szKey,3078 (PVOID)&localdcd.detailslongname,3079 &size) &&3080 size == sizeof(BOOL))3081 {3082 if (fDeleteState)3083 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3084 }3085 localdcd.detailssubject = detailssubject; // Set default3086 size = sizeof(BOOL);3087 sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, x);3088 if (PrfQueryProfileData(fmprof,3089 FM3Str,3090 szKey,3091 (PVOID)&localdcd.detailssubject,3092 &size) &&3093 size == sizeof(BOOL))3094 {3095 if (fDeleteState)3096 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3097 }3098 localdcd.detailsea = detailsea; // Set default3099 size = sizeof(BOOL);3100 sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, x);3101 if (PrfQueryProfileData(fmprof,3102 FM3Str,3103 szKey,3104 (PVOID) & localdcd.detailsea,3105 &size) &&3106 size == sizeof(BOOL))3107 {3108 if (fDeleteState)3109 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3110 }3111 localdcd.detailssize = detailssize; // Set default3112 size = sizeof(BOOL);3113 sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, x);3114 if (PrfQueryProfileData(fmprof,3115 FM3Str,3116 szKey,3117 (PVOID) & localdcd.detailssize,3118 &size) &&3119 size == sizeof(BOOL))3120 {3121 if (fDeleteState)3122 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3123 }3124 localdcd.detailsicon = detailsicon; // Set default3125 size = sizeof(BOOL);3126 sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, x);3127 if (PrfQueryProfileData(fmprof,3128 FM3Str,3129 szKey,3130 (PVOID) & localdcd.detailsicon,3131 &size) &&3132 size == sizeof(BOOL))3133 {3134 if (fDeleteState)3135 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3136 }3137 localdcd.detailsattr = detailsattr; // Set default3138 size = sizeof(BOOL);3139 sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, x);3140 if (PrfQueryProfileData(fmprof,3141 FM3Str,3142 szKey,3143 (PVOID)&localdcd.detailsattr,3144 &size) &&3145 size == sizeof(BOOL))3146 {3147 if (fDeleteState)3148 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3149 }3150 localdcd.detailscrdate = detailscrdate; // Set default3151 size = sizeof(BOOL);3152 sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, x);3153 if (PrfQueryProfileData(fmprof,3154 FM3Str,3155 szKey,3156 (PVOID) & localdcd.detailscrdate,3157 &size) && size == sizeof(BOOL))3158 {3159 if (fDeleteState)3160 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3161 }3162 localdcd.detailscrtime = detailscrtime; // Set default3163 size = sizeof(BOOL);3164 sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, x);3165 if (PrfQueryProfileData(fmprof,3166 FM3Str,3167 szKey,3168 (PVOID)&localdcd.detailscrtime,3169 &size) &&3170 size == sizeof(BOOL))3171 {3172 if (fDeleteState)3173 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3174 }3175 localdcd.detailslwdate = detailslwdate; // Set default3176 size = sizeof(BOOL);3177 sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, x);3178 if (PrfQueryProfileData(fmprof,3179 FM3Str,3180 szKey,3181 (PVOID) & localdcd.detailslwdate,3182 &size) &&3183 size == sizeof(BOOL))3184 {3185 if (fDeleteState)3186 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3187 }3188 localdcd.detailslwtime = detailslwtime; // Set default3189 size = sizeof(BOOL);3190 sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, x);3191 if (PrfQueryProfileData(fmprof,3192 FM3Str,3193 szKey,3194 (PVOID) & localdcd.detailslwtime,3195 &size) &&3196 size == sizeof(BOOL))3197 {3198 if (fDeleteState)3199 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3200 }3201 localdcd.detailsladate = detailsladate; // Set default3202 size = sizeof(BOOL);3203 sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, x);3204 if (PrfQueryProfileData(fmprof,3205 FM3Str,3206 szKey,3207 (PVOID) & localdcd.detailsladate,3208 &size) &&3209 size == sizeof(BOOL))3210 {3211 if (fDeleteState)3212 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3213 }3214 localdcd.detailslatime = detailslatime; // Set default3215 size = sizeof(BOOL);3216 sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, x);3217 if (PrfQueryProfileData(fmprof,3218 FM3Str,3219 szKey,3220 (PVOID) & localdcd.detailslatime,3221 &size) &&3222 size == sizeof(BOOL))3223 {3224 if (fDeleteState)3225 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3226 }3227 hwndDir = (HWND) WinSendMsg(hwndClient,3228 UM_SETDIR,3229 MPFROMP(szDir), MPFROMLONG(1));3230 if (hwndDir) {3231 hwndC = WinWindowFromID(hwndDir, FID_CLIENT);3232 if (hwndC) {3233 HWND hwndCnr = WinWindowFromID(hwndC, DIR_CNR);3234 if (!hwndPPSave) {3059 if (fDeleteState) 3060 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3061 sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, x); 3062 size = sizeof(szDir); 3063 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) szDir, &size)) { 3064 // If restoring shutdown state and drive marked no prescan 3065 // bypass window restore 3066 if (fIsShutDownState && 3067 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) { 3068 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3069 continue; 3070 } 3071 if (fDeleteState) 3072 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3073 localdcd.detailslongname = detailslongname; // Set default 3074 size = sizeof(BOOL); 3075 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, x); 3076 if (PrfQueryProfileData(fmprof, 3077 FM3Str, 3078 szKey, 3079 (PVOID)&localdcd.detailslongname, 3080 &size) && 3081 size == sizeof(BOOL)) 3082 { 3083 if (fDeleteState) 3084 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3085 } 3086 localdcd.detailssubject = detailssubject; // Set default 3087 size = sizeof(BOOL); 3088 sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, x); 3089 if (PrfQueryProfileData(fmprof, 3090 FM3Str, 3091 szKey, 3092 (PVOID)&localdcd.detailssubject, 3093 &size) && 3094 size == sizeof(BOOL)) 3095 { 3096 if (fDeleteState) 3097 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3098 } 3099 localdcd.detailsea = detailsea; // Set default 3100 size = sizeof(BOOL); 3101 sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, x); 3102 if (PrfQueryProfileData(fmprof, 3103 FM3Str, 3104 szKey, 3105 (PVOID) & localdcd.detailsea, 3106 &size) && 3107 size == sizeof(BOOL)) 3108 { 3109 if (fDeleteState) 3110 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3111 } 3112 localdcd.detailssize = detailssize; // Set default 3113 size = sizeof(BOOL); 3114 sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, x); 3115 if (PrfQueryProfileData(fmprof, 3116 FM3Str, 3117 szKey, 3118 (PVOID) & localdcd.detailssize, 3119 &size) && 3120 size == sizeof(BOOL)) 3121 { 3122 if (fDeleteState) 3123 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3124 } 3125 localdcd.detailsicon = detailsicon; // Set default 3126 size = sizeof(BOOL); 3127 sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, x); 3128 if (PrfQueryProfileData(fmprof, 3129 FM3Str, 3130 szKey, 3131 (PVOID) & localdcd.detailsicon, 3132 &size) && 3133 size == sizeof(BOOL)) 3134 { 3135 if (fDeleteState) 3136 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3137 } 3138 localdcd.detailsattr = detailsattr; // Set default 3139 size = sizeof(BOOL); 3140 sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, x); 3141 if (PrfQueryProfileData(fmprof, 3142 FM3Str, 3143 szKey, 3144 (PVOID)&localdcd.detailsattr, 3145 &size) && 3146 size == sizeof(BOOL)) 3147 { 3148 if (fDeleteState) 3149 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3150 } 3151 localdcd.detailscrdate = detailscrdate; // Set default 3152 size = sizeof(BOOL); 3153 sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, x); 3154 if (PrfQueryProfileData(fmprof, 3155 FM3Str, 3156 szKey, 3157 (PVOID) & localdcd.detailscrdate, 3158 &size) && size == sizeof(BOOL)) 3159 { 3160 if (fDeleteState) 3161 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3162 } 3163 localdcd.detailscrtime = detailscrtime; // Set default 3164 size = sizeof(BOOL); 3165 sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, x); 3166 if (PrfQueryProfileData(fmprof, 3167 FM3Str, 3168 szKey, 3169 (PVOID)&localdcd.detailscrtime, 3170 &size) && 3171 size == sizeof(BOOL)) 3172 { 3173 if (fDeleteState) 3174 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3175 } 3176 localdcd.detailslwdate = detailslwdate; // Set default 3177 size = sizeof(BOOL); 3178 sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, x); 3179 if (PrfQueryProfileData(fmprof, 3180 FM3Str, 3181 szKey, 3182 (PVOID) & localdcd.detailslwdate, 3183 &size) && 3184 size == sizeof(BOOL)) 3185 { 3186 if (fDeleteState) 3187 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3188 } 3189 localdcd.detailslwtime = detailslwtime; // Set default 3190 size = sizeof(BOOL); 3191 sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, x); 3192 if (PrfQueryProfileData(fmprof, 3193 FM3Str, 3194 szKey, 3195 (PVOID) & localdcd.detailslwtime, 3196 &size) && 3197 size == sizeof(BOOL)) 3198 { 3199 if (fDeleteState) 3200 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3201 } 3202 localdcd.detailsladate = detailsladate; // Set default 3203 size = sizeof(BOOL); 3204 sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, x); 3205 if (PrfQueryProfileData(fmprof, 3206 FM3Str, 3207 szKey, 3208 (PVOID) & localdcd.detailsladate, 3209 &size) && 3210 size == sizeof(BOOL)) 3211 { 3212 if (fDeleteState) 3213 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3214 } 3215 localdcd.detailslatime = detailslatime; // Set default 3216 size = sizeof(BOOL); 3217 sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, x); 3218 if (PrfQueryProfileData(fmprof, 3219 FM3Str, 3220 szKey, 3221 (PVOID) & localdcd.detailslatime, 3222 &size) && 3223 size == sizeof(BOOL)) 3224 { 3225 if (fDeleteState) 3226 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3227 } 3228 hwndDir = (HWND) WinSendMsg(hwndClient, 3229 UM_SETDIR, 3230 MPFROMP(szDir), MPFROMLONG(1)); 3231 if (hwndDir) { 3232 hwndC = WinWindowFromID(hwndDir, FID_CLIENT); 3233 if (hwndC) { 3234 HWND hwndCnr = WinWindowFromID(hwndC, DIR_CNR); 3235 if (!hwndPPSave) { 3235 3236 hwndPPSave = WinCreateWindow(hwndCnr, // Create a window (used to save default presparams) 3236 WC_CONTAINER,3237 NULL,3238 CCS_AUTOPOSITION | CCS_MINIICONS |3239 CCS_MINIRECORDCORE | ulCnrType |3240 WS_VISIBLE,3241 0,3242 0,3243 0,3244 0,3245 hwndCnr,3246 HWND_TOP, (ULONG) -1, NULL, NULL);3247 CopyPresParams(hwndPPSave, hwndC);3248 RestorePresParams(hwndPPSave, "DirCnr");3249 }3250 sprintf(szKey, "%sDirCnr.%lu", szPrefix, x);3251 RestorePresParams(hwndCnr, szKey);3252 dcd = WinQueryWindowPtr(hwndCnr, QWL_USER);3253 if (dcd) {3254 dcd->detailslongname = localdcd.detailslongname;3255 dcd->detailssubject = localdcd.detailssubject ;3256 dcd->detailsattr = localdcd.detailsattr ;3257 dcd->detailsea = localdcd.detailsea ;3258 dcd->detailssize = localdcd.detailssize ;3259 dcd->detailsicon = localdcd.detailsicon ;3260 dcd->detailscrdate = localdcd.detailscrdate ;3261 dcd->detailscrtime = localdcd.detailscrtime ;3262 dcd->detailsladate = localdcd.detailsladate ;3263 dcd->detailslatime = localdcd.detailslatime ;3264 dcd->detailslwdate = localdcd.detailslwdate ;3265 dcd->detailslwtime = localdcd.detailslwtime ;3266 size = sizeof(INT);3267 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, x);3268 if (PrfQueryProfileData(fmprof,3269 FM3Str,3270 szKey,3271 (PVOID) & dcd->sortFlags,3272 &size) && size == sizeof(INT)) {3273 if (!dcd->sortFlags)3274 dcd->sortFlags = SORT_PATHNAME;3275 }3276 if (fDeleteState)3277 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3278 size = sizeof(MASK);3279 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, x);3280 if (PrfQueryProfileData(fmprof,3281 FM3Str,3282 szKey,3283 (PVOID) & dcd->mask, &size) && size) {3284 if (*dcd->mask.szMask)3285 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR),3286 UM_FILTER, MPFROMP(dcd->mask.szMask), MPVOID);3287 }3288 *(dcd->mask.prompt) = 0;3289 if (fDeleteState)3290 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3291 size = sizeof(ULONG);3292 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, x);3293 if (!noview) {3294 if (PrfQueryProfileData(fmprof,3295 FM3Str,3296 szKey,3297 (PVOID) & dcd->flWindowAttr,3298 &size) && size == sizeof(ULONG)) {3299 3300 CNRINFO cnri;3301 3302 memset(&cnri, 0, sizeof(CNRINFO));3303 cnri.cb = sizeof(CNRINFO);3304 if (WinSendMsg(WinWindowFromID(hwndC, DIR_CNR),3305 CM_QUERYCNRINFO,3306 MPFROMP(&cnri),3307 MPFROMLONG(sizeof(CNRINFO)))) {3308 cnri.flWindowAttr = dcd->flWindowAttr;3309 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR),3310 CM_SETCNRINFO,3311 MPFROMP(&cnri),3312 MPFROMLONG(CMA_FLWINDOWATTR));3313 }3314 }3315 }3316 if (fDeleteState)3317 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3318 if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL))3319 WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL);3320 }3321 }3322 fRestored = TRUE;3323 swp.hwnd = hwndDir;3324 TransformSwp(&swp, xtrans, ytrans);3325 if (!fAutoTile && !(swp.fl & (SWP_HIDE | SWP_MINIMIZE)))3326 WinSetWindowPos(hwndDir,3327 HWND_TOP,3328 swp.x,3329 swp.y,3330 swp.cx,3331 swp.cy,3332 swp.fl | SWP_MOVE |3333 SWP_SIZE | SWP_SHOW | SWP_ZORDER |3334 SWP_ACTIVATE);3335 else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) {3336 WinSetWindowPos(hwndDir,3337 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW);3338 WinSetWindowUShort(hwndDir, QWS_XRESTORE, (USHORT) swp.x);3339 WinSetWindowUShort(hwndDir, QWS_CXRESTORE, (USHORT) swp.cx);3340 WinSetWindowUShort(hwndDir, QWS_YRESTORE, (USHORT) swp.y);3341 WinSetWindowUShort(hwndDir, QWS_CYRESTORE, (USHORT) swp.cy);3342 }3343 else3344 WinSetWindowPos(hwndDir,3345 HWND_BOTTOM,3346 0, 0, 0, 0, SWP_ZORDER | SWP_ACTIVATE);3347 }3348 }3237 WC_CONTAINER, 3238 NULL, 3239 CCS_AUTOPOSITION | CCS_MINIICONS | 3240 CCS_MINIRECORDCORE | ulCnrType | 3241 WS_VISIBLE, 3242 0, 3243 0, 3244 0, 3245 0, 3246 hwndCnr, 3247 HWND_TOP, (ULONG) -1, NULL, NULL); 3248 CopyPresParams(hwndPPSave, hwndC); 3249 RestorePresParams(hwndPPSave, "DirCnr"); 3250 } 3251 sprintf(szKey, "%sDirCnr.%lu", szPrefix, x); 3252 RestorePresParams(hwndCnr, szKey); 3253 dcd = WinQueryWindowPtr(hwndCnr, QWL_USER); 3254 if (dcd) { 3255 dcd->detailslongname = localdcd.detailslongname; 3256 dcd->detailssubject = localdcd.detailssubject ; 3257 dcd->detailsattr = localdcd.detailsattr ; 3258 dcd->detailsea = localdcd.detailsea ; 3259 dcd->detailssize = localdcd.detailssize ; 3260 dcd->detailsicon = localdcd.detailsicon ; 3261 dcd->detailscrdate = localdcd.detailscrdate ; 3262 dcd->detailscrtime = localdcd.detailscrtime ; 3263 dcd->detailsladate = localdcd.detailsladate ; 3264 dcd->detailslatime = localdcd.detailslatime ; 3265 dcd->detailslwdate = localdcd.detailslwdate ; 3266 dcd->detailslwtime = localdcd.detailslwtime ; 3267 size = sizeof(INT); 3268 sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, x); 3269 if (PrfQueryProfileData(fmprof, 3270 FM3Str, 3271 szKey, 3272 (PVOID) & dcd->sortFlags, 3273 &size) && size == sizeof(INT)) { 3274 if (!dcd->sortFlags) 3275 dcd->sortFlags = SORT_PATHNAME; 3276 } 3277 if (fDeleteState) 3278 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3279 size = sizeof(MASK); 3280 sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, x); 3281 if (PrfQueryProfileData(fmprof, 3282 FM3Str, 3283 szKey, 3284 (PVOID) & dcd->mask, &size) && size) { 3285 if (*dcd->mask.szMask) 3286 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3287 UM_FILTER, MPFROMP(dcd->mask.szMask), MPVOID); 3288 } 3289 *(dcd->mask.prompt) = 0; 3290 if (fDeleteState) 3291 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3292 size = sizeof(ULONG); 3293 sprintf(szKey, "%sDirCnrView.%lu", szPrefix, x); 3294 if (!noview) { 3295 if (PrfQueryProfileData(fmprof, 3296 FM3Str, 3297 szKey, 3298 (PVOID) & dcd->flWindowAttr, 3299 &size) && size == sizeof(ULONG)) { 3300 3301 CNRINFO cnri; 3302 3303 memset(&cnri, 0, sizeof(CNRINFO)); 3304 cnri.cb = sizeof(CNRINFO); 3305 if (WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3306 CM_QUERYCNRINFO, 3307 MPFROMP(&cnri), 3308 MPFROMLONG(sizeof(CNRINFO)))) { 3309 cnri.flWindowAttr = dcd->flWindowAttr; 3310 WinSendMsg(WinWindowFromID(hwndC, DIR_CNR), 3311 CM_SETCNRINFO, 3312 MPFROMP(&cnri), 3313 MPFROMLONG(CMA_FLWINDOWATTR)); 3314 } 3315 } 3316 } 3317 if (fDeleteState) 3318 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3319 if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL)) 3320 WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL); 3321 } 3322 } 3323 fRestored = TRUE; 3324 swp.hwnd = hwndDir; 3325 TransformSwp(&swp, xtrans, ytrans); 3326 if (!fAutoTile && !(swp.fl & (SWP_HIDE | SWP_MINIMIZE))) 3327 WinSetWindowPos(hwndDir, 3328 HWND_TOP, 3329 swp.x, 3330 swp.y, 3331 swp.cx, 3332 swp.cy, 3333 swp.fl | SWP_MOVE | 3334 SWP_SIZE | SWP_SHOW | SWP_ZORDER | 3335 SWP_ACTIVATE); 3336 else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) { 3337 WinSetWindowPos(hwndDir, 3338 HWND_TOP, 0, 0, 0, 0, SWP_MINIMIZE | SWP_SHOW); 3339 WinSetWindowUShort(hwndDir, QWS_XRESTORE, (USHORT) swp.x); 3340 WinSetWindowUShort(hwndDir, QWS_CXRESTORE, (USHORT) swp.cx); 3341 WinSetWindowUShort(hwndDir, QWS_YRESTORE, (USHORT) swp.y); 3342 WinSetWindowUShort(hwndDir, QWS_CYRESTORE, (USHORT) swp.cy); 3343 } 3344 else 3345 WinSetWindowPos(hwndDir, 3346 HWND_BOTTOM, 3347 0, 0, 0, 0, SWP_ZORDER | SWP_ACTIVATE); 3348 } 3349 } 3349 3350 } 3350 3351 } // for … … 3375 3376 if (ulNumMinChildren) { 3376 3377 if (WinQueryWindowPos(hwndChild, &swp) && (swp.fl & SWP_MINIMIZE)) 3377 (*ulNumMinChildren)++;3378 (*ulNumMinChildren)++; 3378 3379 } 3379 3380 } … … 3383 3384 3384 3385 VOID GetNextWindowPos(HWND hwndClient, PSWP pswp, ULONG * ulCntR, 3385 ULONG * ulNumMinChildrenR)3386 ULONG * ulNumMinChildrenR) 3386 3387 { 3387 3388 register ULONG ulCnt; … … 3447 3448 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 3448 3449 if (swp.y + swp.cy < Rectl.yTop - Rectl.yBottom) 3449 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y;3450 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3450 3451 if (swp.x != 0) 3451 swp.x = 0;3452 swp.x = 0; 3452 3453 if (swp.y < 0) 3453 swp.y = 0;3454 swp.y = 0; 3454 3455 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3455 swp.cx = Rectl.xRight - Rectl.xLeft;3456 swp.cx = Rectl.xRight - Rectl.xLeft; 3456 3457 WinSetWindowPos(hwndTree, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3457 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE);3458 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3458 3459 } 3459 3460 } … … 3467 3468 GetNextWindowPos(hwndClient, &swp, &ulCnt, &ulNumMinChildren); 3468 3469 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3469 SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_RESTORE |3470 SWP_ZORDER | SWP_ACTIVATE);3470 SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_RESTORE | 3471 SWP_ZORDER | SWP_ACTIVATE); 3471 3472 ulCnt++; 3472 3473 } … … 3521 3522 if (!(swp.fl & (SWP_MAXIMIZE | SWP_HIDE | SWP_MINIMIZE))) { 3522 3523 if (swp.y < 0) 3523 swp.y = 0;3524 swp.y = 0; 3524 3525 if (swp.y + swp.cy < Rectl.yTop - Rectl.yBottom) 3525 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y;3526 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3526 3527 if (swp.x != 0) 3527 swp.x = 0;3528 swp.x = 0; 3528 3529 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3529 swp.cx = Rectl.xRight - Rectl.xLeft;3530 swp.cx = Rectl.xRight - Rectl.xLeft; 3530 3531 WinSetWindowPos(hwndTree, 3531 HWND_TOP,3532 swp.x,3533 swp.y,3534 swp.cx,3535 swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE);3532 HWND_TOP, 3533 swp.x, 3534 swp.y, 3535 swp.cx, 3536 swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3536 3537 WinQueryWindowPos(hwndTree, &swp); 3537 3538 } … … 3558 3559 3559 3560 for (ulCurRow = 0; ulCurRow < ulNumRows; ulCurRow++) { 3560 if ((ulNumRows - ulCurRow) <= ulExtraCols)3561 ulNumCols++;3562 for (ulCurCol = 0; ulCurCol < ulNumCols; ulCurCol++) {3563 ulWidth = Rectl.xRight / ulNumCols;3564 3565 while (hwndChild) {3566 id = WinQueryWindowUShort(hwndChild, QWS_ID);3567 if (id && (id != TREE_FRAME || fFreeTree)) {3568 WinQueryWindowPos(hwndChild, &swp);3569 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE)))3570 break;3571 }3572 hwndChild = WinGetNextWindow(henum);3573 }3574 3575 if (hwndChild) {3576 if (!absolute && (swp.fl & SWP_MAXIMIZE)) {3577 WinGetMaxPosition(hwndChild, &swp);3578 WinSetWindowPos(hwndChild,3579 HWND_TOP,3580 swp.x,3581 swp.y,3582 swp.cx, swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW);3583 WinSetWindowUShort(hwndChild,3584 QWS_XRESTORE,3585 (USHORT) (ulWidth * ulCurCol) + Rectl.xLeft);3586 WinSetWindowUShort(hwndChild,3587 QWS_YRESTORE,3588 (USHORT) (Rectl.yTop -3589 (ulHeight * (ulCurRow + 1))));3590 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, (USHORT) ulWidth);3591 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, (USHORT) ulHeight);3592 }3593 else3594 WinSetWindowPos(hwndChild,3595 HWND_TOP,3596 (ulWidth * ulCurCol) + Rectl.xLeft,3597 Rectl.yTop - (ulHeight * (ulCurRow + 1)),3598 ulWidth,3599 ulHeight,3600 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE);3601 hwndChild = WinGetNextWindow(henum);3602 }3603 }3604 if ((ulNumRows - ulCurRow) <= ulExtraCols) {3605 ulNumCols--;3606 ulExtraCols--;3607 }3561 if ((ulNumRows - ulCurRow) <= ulExtraCols) 3562 ulNumCols++; 3563 for (ulCurCol = 0; ulCurCol < ulNumCols; ulCurCol++) { 3564 ulWidth = Rectl.xRight / ulNumCols; 3565 3566 while (hwndChild) { 3567 id = WinQueryWindowUShort(hwndChild, QWS_ID); 3568 if (id && (id != TREE_FRAME || fFreeTree)) { 3569 WinQueryWindowPos(hwndChild, &swp); 3570 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE))) 3571 break; 3572 } 3573 hwndChild = WinGetNextWindow(henum); 3574 } 3575 3576 if (hwndChild) { 3577 if (!absolute && (swp.fl & SWP_MAXIMIZE)) { 3578 WinGetMaxPosition(hwndChild, &swp); 3579 WinSetWindowPos(hwndChild, 3580 HWND_TOP, 3581 swp.x, 3582 swp.y, 3583 swp.cx, swp.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 3584 WinSetWindowUShort(hwndChild, 3585 QWS_XRESTORE, 3586 (USHORT) (ulWidth * ulCurCol) + Rectl.xLeft); 3587 WinSetWindowUShort(hwndChild, 3588 QWS_YRESTORE, 3589 (USHORT) (Rectl.yTop - 3590 (ulHeight * (ulCurRow + 1)))); 3591 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, (USHORT) ulWidth); 3592 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, (USHORT) ulHeight); 3593 } 3594 else 3595 WinSetWindowPos(hwndChild, 3596 HWND_TOP, 3597 (ulWidth * ulCurCol) + Rectl.xLeft, 3598 Rectl.yTop - (ulHeight * (ulCurRow + 1)), 3599 ulWidth, 3600 ulHeight, 3601 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3602 hwndChild = WinGetNextWindow(henum); 3603 } 3604 } 3605 if ((ulNumRows - ulCurRow) <= ulExtraCols) { 3606 ulNumCols--; 3607 ulExtraCols--; 3608 } 3608 3609 } 3609 3610 } … … 3615 3616 3616 3617 static VOID ResizeChildren(HWND hwndClient, SHORT oldcx, SHORT oldcy, 3617 SHORT newcx, SHORT newcy)3618 SHORT newcx, SHORT newcy) 3618 3619 { 3619 3620 /* … … 3633 3634 while ((hwndChild = WinGetNextWindow(henum)) != NULLHANDLE) { 3634 3635 if (!WinQueryWindowUShort(hwndChild, QWS_ID)) 3635 continue;3636 continue; 3636 3637 if (WinQueryWindowPos(hwndChild, &swp)) { 3637 if (swp.fl & (SWP_MINIMIZE | SWP_HIDE)) {3638 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE);3639 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE);3640 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE);3641 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE);3642 }3643 else if (swp.fl & SWP_MAXIMIZE) {3644 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE);3645 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE);3646 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE);3647 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE);3648 }3649 cx = (swp.cx) ? (LONG) (((double)oldcx * 100.0) / (double)swp.cx) : 0;3650 cy = (swp.cy) ? (LONG) (((double)oldcy * 100.0) / (double)swp.cy) : 0;3651 x = (swp.x) ? (LONG) (((double)oldcx * 100.0) / (double)swp.x) : 0;3652 y = (swp.y) ? (LONG) (((double)oldcy * 100.0) / (double)swp.y) : 0;3653 if (x < 0)3654 x = 0;3655 if (y < 0)3656 y = 0;3657 ux = (x) ? (LONG) (((double)newcx * 100.0) / (double)x) : 0;3658 uy = (y) ? (LONG) (((double)newcy * 100.0) / (double)y) : 0;3659 ucx = (cx) ? (LONG) (((double)newcx * 100.0) / (double)cx) : 0;3660 ucy = (cy) ? (LONG) (((double)newcy * 100.0) / (double)cy) : 0;3661 if (ux + ucx > newcx)3662 ucx = newcx - ux;3663 if (uy + ucy > newcy)3664 ucy = newcy - uy;3665 3666 if (!(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE)))3667 WinSetWindowPos(hwndChild, HWND_TOP, ux, uy, ucx, ucy,3668 SWP_MOVE | SWP_SIZE | SWP_SHOW);3669 else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) {3670 WinSetWindowUShort(hwndChild, QWS_XMINIMIZE, (USHORT) - 1);3671 WinSetWindowUShort(hwndChild, QWS_YMINIMIZE, (USHORT) - 1);3672 WinSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0,3673 SWP_SIZE | SWP_MOVE | SWP_FOCUSDEACTIVATE);3674 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux);3675 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy);3676 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx);3677 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy);3678 }3679 else {3680 WinGetMaxPosition(hwndChild, &swp);3681 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy,3682 SWP_MOVE | SWP_SIZE | SWP_SHOW);3683 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux);3684 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy);3685 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx);3686 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy);3687 }3638 if (swp.fl & (SWP_MINIMIZE | SWP_HIDE)) { 3639 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE); 3640 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE); 3641 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE); 3642 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE); 3643 } 3644 else if (swp.fl & SWP_MAXIMIZE) { 3645 swp.x = WinQueryWindowUShort(hwndChild, QWS_XRESTORE); 3646 swp.y = WinQueryWindowUShort(hwndChild, QWS_YRESTORE); 3647 swp.cx = WinQueryWindowUShort(hwndChild, QWS_CXRESTORE); 3648 swp.cy = WinQueryWindowUShort(hwndChild, QWS_CYRESTORE); 3649 } 3650 cx = (swp.cx) ? (LONG) (((double)oldcx * 100.0) / (double)swp.cx) : 0; 3651 cy = (swp.cy) ? (LONG) (((double)oldcy * 100.0) / (double)swp.cy) : 0; 3652 x = (swp.x) ? (LONG) (((double)oldcx * 100.0) / (double)swp.x) : 0; 3653 y = (swp.y) ? (LONG) (((double)oldcy * 100.0) / (double)swp.y) : 0; 3654 if (x < 0) 3655 x = 0; 3656 if (y < 0) 3657 y = 0; 3658 ux = (x) ? (LONG) (((double)newcx * 100.0) / (double)x) : 0; 3659 uy = (y) ? (LONG) (((double)newcy * 100.0) / (double)y) : 0; 3660 ucx = (cx) ? (LONG) (((double)newcx * 100.0) / (double)cx) : 0; 3661 ucy = (cy) ? (LONG) (((double)newcy * 100.0) / (double)cy) : 0; 3662 if (ux + ucx > newcx) 3663 ucx = newcx - ux; 3664 if (uy + ucy > newcy) 3665 ucy = newcy - uy; 3666 3667 if (!(swp.fl & (SWP_MINIMIZE | SWP_HIDE | SWP_MAXIMIZE))) 3668 WinSetWindowPos(hwndChild, HWND_TOP, ux, uy, ucx, ucy, 3669 SWP_MOVE | SWP_SIZE | SWP_SHOW); 3670 else if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) { 3671 WinSetWindowUShort(hwndChild, QWS_XMINIMIZE, (USHORT) - 1); 3672 WinSetWindowUShort(hwndChild, QWS_YMINIMIZE, (USHORT) - 1); 3673 WinSetWindowPos(hwndChild, HWND_TOP, 0, 0, 0, 0, 3674 SWP_SIZE | SWP_MOVE | SWP_FOCUSDEACTIVATE); 3675 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux); 3676 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy); 3677 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx); 3678 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy); 3679 } 3680 else { 3681 WinGetMaxPosition(hwndChild, &swp); 3682 WinSetWindowPos(hwndChild, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3683 SWP_MOVE | SWP_SIZE | SWP_SHOW); 3684 WinSetWindowUShort(hwndChild, QWS_XRESTORE, ux); 3685 WinSetWindowUShort(hwndChild, QWS_YRESTORE, uy); 3686 WinSetWindowUShort(hwndChild, QWS_CXRESTORE, ucx); 3687 WinSetWindowUShort(hwndChild, QWS_CYRESTORE, ucy); 3688 } 3688 3689 } 3689 3690 } … … 3701 3702 3702 3703 if (!fNoTreeGap) { 3703 INT height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2;3704 if (swp.y < height)3705 swp.y = height;// Force bottom to position3704 INT height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2; 3705 if (swp.y < height) 3706 swp.y = height; // Force bottom to position 3706 3707 } 3707 3708 else 3708 swp.y = 0;// Force bottom to position3709 swp.y = 0; // Force bottom to position 3709 3710 3710 3711 swp.cy = (Rectl.yTop - Rectl.yBottom) - swp.y; 3711 3712 if (swp.cy < 0) 3712 swp.cy = 0;3713 swp.cy = 0; 3713 3714 3714 3715 if (swp.x != 0) 3715 swp.x = 0;// Left align3716 swp.x = 0; // Left align 3716 3717 3717 3718 // AdjustSizeOfClient can return bogus xRight values - fixme someday 3718 3719 if (Rectl.xRight >= Rectl.xLeft) { 3719 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft)3720 swp.cx = Rectl.xRight - Rectl.xLeft;3720 if (swp.x + swp.cx > Rectl.xRight - Rectl.xLeft) 3721 swp.cx = Rectl.xRight - Rectl.xLeft; 3721 3722 } 3722 3723 WinSetWindowPos(hwndTree, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, 3723 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE);3724 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_RESTORE); 3724 3725 } 3725 3726 } … … 3749 3750 3750 3751 static MRESULT EXPENTRY ChildFrameButtonProc(HWND hwnd, 3751 ULONG msg,3752 MPARAM mp1, MPARAM mp2)3752 ULONG msg, 3753 MPARAM mp1, MPARAM mp2) 3753 3754 { 3754 3755 USHORT id; … … 3764 3765 if (fOtherHelp) { 3765 3766 if ((!hwndBubble || WinQueryWindowULong(hwndBubble, QWL_USER) != hwnd) 3766 && !WinQueryCapture(HWND_DESKTOP)) {3767 id = WinQueryWindowUShort(hwnd, QWS_ID);3768 switch (id) {3769 case IDM_OPENWALK:3770 MakeBubble(hwnd, FALSE, GetPString(IDS_WALKBUTTONHELP));3771 break;3772 case IDM_USERLIST:3773 MakeBubble(hwnd, FALSE, GetPString(IDS_QUICKBUTTONHELP));3774 break;3775 }3767 && !WinQueryCapture(HWND_DESKTOP)) { 3768 id = WinQueryWindowUShort(hwnd, QWS_ID); 3769 switch (id) { 3770 case IDM_OPENWALK: 3771 MakeBubble(hwnd, FALSE, GetPString(IDS_WALKBUTTONHELP)); 3772 break; 3773 case IDM_USERLIST: 3774 MakeBubble(hwnd, FALSE, GetPString(IDS_QUICKBUTTONHELP)); 3775 break; 3776 } 3776 3777 } 3777 3778 } … … 3787 3788 switch (id) { 3788 3789 case IDM_OPENWALK: 3789 switch (msg) {3790 case WM_BUTTON2CLICK:3791 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) ==3792 (KC_ALT | KC_SHIFT | KC_CTRL))3793 cmd = IDM_GREP;3794 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL))3795 CascadeChildren(hwndMain);3790 switch (msg) { 3791 case WM_BUTTON2CLICK: 3792 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) == 3793 (KC_ALT | KC_SHIFT | KC_CTRL)) 3794 cmd = IDM_GREP; 3795 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL)) 3796 CascadeChildren(hwndMain); 3796 3797 3797 3798 #ifdef NEVER 3798 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT))3799 cmd = IDM_SYSINFO;3799 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT)) 3800 cmd = IDM_SYSINFO; 3800 3801 #endif 3801 3802 3802 else if (shiftstate & KC_SHIFT)3803 cmd = IDM_WINDOWDLG;3804 else if (shiftstate & KC_CTRL)3805 cmd = IDM_SEEALL;3806 else if (shiftstate & KC_ALT)3807 TileChildren(hwndMain, TRUE);3808 else3809 cmd = IDM_WALKDIR;3810 break;3811 case WM_BUTTON3CLICK:3812 TileChildren(hwndMain, TRUE);3813 break;3814 }3815 break;3803 else if (shiftstate & KC_SHIFT) 3804 cmd = IDM_WINDOWDLG; 3805 else if (shiftstate & KC_CTRL) 3806 cmd = IDM_SEEALL; 3807 else if (shiftstate & KC_ALT) 3808 TileChildren(hwndMain, TRUE); 3809 else 3810 cmd = IDM_WALKDIR; 3811 break; 3812 case WM_BUTTON3CLICK: 3813 TileChildren(hwndMain, TRUE); 3814 break; 3815 } 3816 break; 3816 3817 case IDM_USERLIST: 3817 switch (msg) {3818 case WM_BUTTON2CLICK:3819 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) ==3820 (KC_ALT | KC_SHIFT | KC_CTRL))3821 cmd = IDM_COLORPALETTE;3822 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL))3823 cmd = IDM_HIDEMENU;3824 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT))3825 cmd = IDM_NOTEBOOK;3826 else if (shiftstate & KC_SHIFT)3827 cmd = IDM_TOOLTITLES;3828 else if (shiftstate & KC_CTRL)3829 cmd = IDM_TEXTTOOLS;3830 else if (shiftstate & KC_ALT)3831 cmd = IDM_FONTPALETTE;3832 else3833 cmd = IDM_TOOLBAR;3834 break;3835 case WM_BUTTON3CLICK:3836 cmd = IDM_DRIVEBAR;3837 break;3838 }3839 break;3818 switch (msg) { 3819 case WM_BUTTON2CLICK: 3820 if ((shiftstate & (KC_ALT | KC_SHIFT | KC_CTRL)) == 3821 (KC_ALT | KC_SHIFT | KC_CTRL)) 3822 cmd = IDM_COLORPALETTE; 3823 else if ((shiftstate & (KC_ALT | KC_CTRL)) == (KC_ALT | KC_CTRL)) 3824 cmd = IDM_HIDEMENU; 3825 else if ((shiftstate & (KC_ALT | KC_SHIFT)) == (KC_ALT | KC_SHIFT)) 3826 cmd = IDM_NOTEBOOK; 3827 else if (shiftstate & KC_SHIFT) 3828 cmd = IDM_TOOLTITLES; 3829 else if (shiftstate & KC_CTRL) 3830 cmd = IDM_TEXTTOOLS; 3831 else if (shiftstate & KC_ALT) 3832 cmd = IDM_FONTPALETTE; 3833 else 3834 cmd = IDM_TOOLBAR; 3835 break; 3836 case WM_BUTTON3CLICK: 3837 cmd = IDM_DRIVEBAR; 3838 break; 3839 } 3840 break; 3840 3841 } // switch id 3841 3842 3842 3843 if (cmd) { 3843 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_CLIENT),3844 WM_COMMAND, MPFROM2SHORT(cmd, 0), MPVOID);3844 PostMsg(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_CLIENT), 3845 WM_COMMAND, MPFROM2SHORT(cmd, 0), MPVOID); 3845 3846 } 3846 3847 } … … 3851 3852 if (id == IDM_OPENWALK) { 3852 3853 if (!emphasized) { 3853 emphasized = TRUE;3854 DrawTargetEmphasis(hwnd, emphasized);3854 emphasized = TRUE; 3855 DrawTargetEmphasis(hwnd, emphasized); 3855 3856 } 3856 3857 if (AcceptOneDrop(hwnd, mp1, mp2)) 3857 return MRFROM2SHORT(DOR_DROP, DO_MOVE);3858 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 3858 3859 } 3859 3860 return MRFROM2SHORT(DOR_NEVERDROP, 0); … … 3875 3876 3876 3877 if (emphasized) { 3877 emphasized = FALSE;3878 DrawTargetEmphasis(hwnd, emphasized);3878 emphasized = FALSE; 3879 DrawTargetEmphasis(hwnd, emphasized); 3879 3880 } 3880 3881 if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { 3881 if (MakeValidDir(szFrom) && !FindDirCnrByName(szFrom, TRUE)) {3882 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szFrom);3883 }3882 if (MakeValidDir(szFrom) && !FindDirCnrByName(szFrom, TRUE)) { 3883 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, szFrom); 3884 } 3884 3885 } 3885 3886 } … … 3894 3895 3895 3896 static MRESULT EXPENTRY MainFrameWndProc(HWND hwnd, ULONG msg, MPARAM mp1, 3896 MPARAM mp2)3897 MPARAM mp2) 3897 3898 { 3898 3899 PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER); … … 3906 3907 pswp = (SWP *) mp1; 3907 3908 if (fDataMin && !fAmClosing) { 3908 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE)) {3909 3910 SWP swp;3911 3912 WinQueryWindowPos(hwnd, &swp);3913 PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(swp.fl), MPVOID);3914 HideNote();3915 }3916 else if (pswp->fl & (SWP_SHOW | SWP_RESTORE)) {3917 if (DataHwnd)3918 PostMsg(DataHwnd, WM_CLOSE, MPVOID, MPVOID);3919 }3909 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE)) { 3910 3911 SWP swp; 3912 3913 WinQueryWindowPos(hwnd, &swp); 3914 PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(swp.fl), MPVOID); 3915 HideNote(); 3916 } 3917 else if (pswp->fl & (SWP_SHOW | SWP_RESTORE)) { 3918 if (DataHwnd) 3919 PostMsg(DataHwnd, WM_CLOSE, MPVOID, MPVOID); 3920 } 3920 3921 } 3921 3922 if (!fAmClosing) { 3922 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE))3923 HideNote();3923 if (pswp->fl & (SWP_HIDE | SWP_MINIMIZE)) 3924 HideNote(); 3924 3925 } 3925 3926 } … … 3944 3945 case WM_CONTROL: 3945 3946 return WinSendMsg(WinWindowFromID(hwnd, FID_CLIENT), UM_CONTROL, mp1, 3946 mp2);3947 mp2); 3947 3948 3948 3949 case WM_COMMAND: … … 3964 3965 3965 3966 if (mr && mp2) { 3966 prectl = (PRECTL) mp1;3967 if (prectl->yBottom != prectl->yTop) {3968 {3969 HPS hps;3970 POINTL aptl[TXTBOX_COUNT];3971 3972 hps = WinGetPS(hwndStatus);3973 if (hps) {3974 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl);3975 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6;3976 WinReleasePS(hps);3977 }3978 }3979 prectl->yBottom += (sheight + 4);3980 prectl->yTop -= (sheight + 4);3981 if (fMoreButtons) {3982 3983 HPS hps;3984 POINTL aptl[TXTBOX_COUNT];3985 3986 hps = WinGetPS(hwndName);3987 if (hps) {3988 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl);3989 bheight = aptl[TXTBOX_TOPLEFT].y + 6;3990 WinReleasePS(hps);3991 }3992 prectl->yBottom += (bheight + 4);3993 prectl->yTop -= (bheight + 4);3994 }3995 if (fToolbar) {3996 if (!fTextTools)3997 prectl->yTop -= ((fToolTitles) ? 50 : 40);3998 else3999 prectl->yTop -= 32;4000 }4001 if (fDrivebar) {4002 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES),4003 ((prectl->xRight -4004 (WinQuerySysValue(HWND_DESKTOP,4005 SV_CYSIZEBORDER) * 2)) - 4));4006 prectl->yTop -= (16 * (DriveLines * 18));4007 }4008 if (fUserComboBox) {4009 if (!aheight) {4010 4011 SWP swpTemp;4012 4013 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT),4014 &swpTemp);4015 aheight = swpTemp.cy;4016 }4017 prectl->yTop -= (aheight + 6L);4018 }4019 if (fAutoView) {4020 AutoviewHeight = min(AutoviewHeight,4021 (prectl->yTop - prectl->yBottom) - 116);4022 AutoviewHeight = max(AutoviewHeight, 36);4023 prectl->yBottom += (AutoviewHeight + 6);4024 }4025 }3967 prectl = (PRECTL) mp1; 3968 if (prectl->yBottom != prectl->yTop) { 3969 { 3970 HPS hps; 3971 POINTL aptl[TXTBOX_COUNT]; 3972 3973 hps = WinGetPS(hwndStatus); 3974 if (hps) { 3975 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 3976 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6; 3977 WinReleasePS(hps); 3978 } 3979 } 3980 prectl->yBottom += (sheight + 4); 3981 prectl->yTop -= (sheight + 4); 3982 if (fMoreButtons) { 3983 3984 HPS hps; 3985 POINTL aptl[TXTBOX_COUNT]; 3986 3987 hps = WinGetPS(hwndName); 3988 if (hps) { 3989 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 3990 bheight = aptl[TXTBOX_TOPLEFT].y + 6; 3991 WinReleasePS(hps); 3992 } 3993 prectl->yBottom += (bheight + 4); 3994 prectl->yTop -= (bheight + 4); 3995 } 3996 if (fToolbar) { 3997 if (!fTextTools) 3998 prectl->yTop -= ((fToolTitles) ? 50 : 40); 3999 else 4000 prectl->yTop -= 32; 4001 } 4002 if (fDrivebar) { 4003 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES), 4004 ((prectl->xRight - 4005 (WinQuerySysValue(HWND_DESKTOP, 4006 SV_CYSIZEBORDER) * 2)) - 4)); 4007 prectl->yTop -= (16 * (DriveLines * 18)); 4008 } 4009 if (fUserComboBox) { 4010 if (!aheight) { 4011 4012 SWP swpTemp; 4013 4014 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT), 4015 &swpTemp); 4016 aheight = swpTemp.cy; 4017 } 4018 prectl->yTop -= (aheight + 6L); 4019 } 4020 if (fAutoView) { 4021 AutoviewHeight = min(AutoviewHeight, 4022 (prectl->yTop - prectl->yBottom) - 116); 4023 AutoviewHeight = max(AutoviewHeight, 36); 4024 prectl->yBottom += (AutoviewHeight + 6); 4025 } 4026 } 4026 4027 } 4027 4028 return mr; … … 4047 4048 pswp = (PSWP) mp1; 4048 4049 { 4049 SHORT x;4050 4051 for (x = 0; x < soldCount; x++) {4052 if (WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_CLIENT) {4053 pswpClient = pswp;4054 break;4055 }4056 pswp++;4057 }4050 SHORT x; 4051 4052 for (x = 0; x < soldCount; x++) { 4053 if (WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_CLIENT) { 4054 pswpClient = pswp; 4055 break; 4056 } 4057 pswp++; 4058 } 4058 4059 } 4059 4060 4060 4061 { 4061 HPS hps;4062 POINTL aptl[TXTBOX_COUNT];4063 4064 hps = WinGetPS(hwndStatus);4065 if (hps) {4066 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl);4067 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6;4068 WinReleasePS(hps);4069 }4070 if (fMoreButtons) {4071 hps = WinGetPS(hwndName);4072 if (hps) {4073 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl);4074 bheight = aptl[TXTBOX_TOPLEFT].y + 6;4075 WinReleasePS(hps);4076 }4077 }4062 HPS hps; 4063 POINTL aptl[TXTBOX_COUNT]; 4064 4065 hps = WinGetPS(hwndStatus); 4066 if (hps) { 4067 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 4068 bheight = sheight = aptl[TXTBOX_TOPLEFT].y + 6; 4069 WinReleasePS(hps); 4070 } 4071 if (fMoreButtons) { 4072 hps = WinGetPS(hwndName); 4073 if (hps) { 4074 GpiQueryTextBox(hps, 6, "$`WjgT", TXTBOX_COUNT, aptl); 4075 bheight = aptl[TXTBOX_TOPLEFT].y + 6; 4076 WinReleasePS(hps); 4077 } 4078 } 4078 4079 } 4079 4080 pswpNew = (PSWP) mp1 + soldCount; … … 4085 4086 pswpNew->y = swpClient.y + 2; 4086 4087 if (!fSplitStatus) 4087 width = swpClient.cx - (16 + (sheight * 2) + 4);4088 width = swpClient.cx - (16 + (sheight * 2) + 4); 4088 4089 else 4089 width = (swpClient.cx - (16 + (sheight * 2) + 4)) / 2;4090 width = (swpClient.cx - (16 + (sheight * 2) + 4)) / 2; 4090 4091 width = max(width, 10); 4091 4092 if (fSplitStatus) 4092 pswpNew->cx = width - 6;4093 pswpNew->cx = width - 6; 4093 4094 else 4094 pswpNew->cx = width - 8;4095 pswpNew->cx = width - 8; 4095 4096 pswpNew->cy = sheight; 4096 4097 pswpClient->y = pswpNew->y + pswpNew->cy + 3; … … 4099 4100 4100 4101 if (fSplitStatus) { 4101 pswpNew = (PSWP) mp1 + (soldCount + 1);4102 *pswpNew = *pswpClient;4103 pswpNew->hwnd = hwndStatus2;4104 pswpNew->hwndInsertBehind = HWND_BOTTOM;4105 pswpNew->x = width + 8;4106 pswpNew->y = swpClient.y + 2;4107 pswpNew->cx = width - 6;4108 pswpNew->cy = sheight;4109 sCount++;4102 pswpNew = (PSWP) mp1 + (soldCount + 1); 4103 *pswpNew = *pswpClient; 4104 pswpNew->hwnd = hwndStatus2; 4105 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4106 pswpNew->x = width + 8; 4107 pswpNew->y = swpClient.y + 2; 4108 pswpNew->cx = width - 6; 4109 pswpNew->cy = sheight; 4110 sCount++; 4110 4111 } 4111 4112 else { 4112 WinShowWindow(hwndStatus2, FALSE);4113 WinSetWindowText(hwndStatus2, NullStr);4113 WinShowWindow(hwndStatus2, FALSE); 4114 WinSetWindowText(hwndStatus2, NullStr); 4114 4115 } 4115 4116 4116 4117 if (fToolbar) { 4117 if (fTextTools)4118 theight = 32L;4119 else if (!fToolTitles)4120 theight = 40L;4121 pswpNew = (PSWP) mp1 + (soldCount + 1 + (fSplitStatus != FALSE));4122 *pswpNew = *pswpClient;4123 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_TOOLS);4124 pswpNew->hwndInsertBehind = HWND_BOTTOM;4125 pswpNew->x = swpClient.x + 2;4126 pswpNew->y = (swpClient.y + swpClient.cy) - (theight - 2);4127 pswpNew->cx = swpClient.cx - 4;4128 pswpNew->cy = theight - 4;4129 pswpClient->cy -= theight;4130 sCount++;4118 if (fTextTools) 4119 theight = 32L; 4120 else if (!fToolTitles) 4121 theight = 40L; 4122 pswpNew = (PSWP) mp1 + (soldCount + 1 + (fSplitStatus != FALSE)); 4123 *pswpNew = *pswpClient; 4124 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_TOOLS); 4125 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4126 pswpNew->x = swpClient.x + 2; 4127 pswpNew->y = (swpClient.y + swpClient.cy) - (theight - 2); 4128 pswpNew->cx = swpClient.cx - 4; 4129 pswpNew->cy = theight - 4; 4130 pswpClient->cy -= theight; 4131 sCount++; 4131 4132 } 4132 4133 else 4133 WinShowWindow(WinWindowFromID(hwnd, MAIN_TOOLS), FALSE);4134 WinShowWindow(WinWindowFromID(hwnd, MAIN_TOOLS), FALSE); 4134 4135 4135 4136 if (fDrivebar) { 4136 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES), pswpClient->cx - 4);4137 pswpNew = (PSWP) mp1 + (soldCount + 1 +4138 (fSplitStatus != FALSE) +4139 (fToolbar != FALSE));4140 *pswpNew = *pswpClient;4141 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_DRIVES);4142 pswpNew->hwndInsertBehind = HWND_BOTTOM;4143 pswpNew->x = swpClient.x + 2;4144 dheight += ((dheight - 2) * DriveLines);4145 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight - 2);4146 if (fToolbar)4147 pswpNew->y -= theight;4148 pswpNew->cx = swpClient.cx - 4;4149 pswpNew->cy = dheight - 4;4150 pswpClient->cy -= dheight;4151 sCount++;4137 ResizeDrives(WinWindowFromID(hwnd, MAIN_DRIVES), pswpClient->cx - 4); 4138 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4139 (fSplitStatus != FALSE) + 4140 (fToolbar != FALSE)); 4141 *pswpNew = *pswpClient; 4142 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_DRIVES); 4143 pswpNew->hwndInsertBehind = HWND_BOTTOM; 4144 pswpNew->x = swpClient.x + 2; 4145 dheight += ((dheight - 2) * DriveLines); 4146 pswpNew->y = (swpClient.y + swpClient.cy) - (dheight - 2); 4147 if (fToolbar) 4148 pswpNew->y -= theight; 4149 pswpNew->cx = swpClient.cx - 4; 4150 pswpNew->cy = dheight - 4; 4151 pswpClient->cy -= dheight; 4152 sCount++; 4152 4153 } 4153 4154 else 4154 WinShowWindow(WinWindowFromID(hwnd, MAIN_DRIVES), FALSE);4155 WinShowWindow(WinWindowFromID(hwnd, MAIN_DRIVES), FALSE); 4155 4156 4156 4157 if (fAutoView) { 4157 pswpNew = (PSWP) mp1 + (soldCount + 1 +4158 (fToolbar != FALSE) +4159 (fDrivebar != FALSE) +4160 (fSplitStatus != FALSE));4161 *pswpNew = *pswpClient;4162 pswpNew->hwnd = (fComments) ? hwndAutoMLE : hwndAutoview;4163 pswpNew->x = pswpClient->x + 3;4164 pswpNew->y = pswpClient->y + 3;4165 if (fMoreButtons)4166 pswpNew->y += (bheight + 4);4167 pswpNew->cx = pswpClient->cx - 6;4168 AutoviewHeight = min(AutoviewHeight, pswpClient->cy - 116);4169 AutoviewHeight = max(AutoviewHeight, 36);4170 pswpNew->cy = AutoviewHeight;4171 pswpClient->y += (AutoviewHeight + 6);4172 pswpClient->cy -= (AutoviewHeight + 6);4173 sCount++;4174 WinShowWindow((fComments) ? hwndAutoview : hwndAutoMLE, FALSE);4158 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4159 (fToolbar != FALSE) + 4160 (fDrivebar != FALSE) + 4161 (fSplitStatus != FALSE)); 4162 *pswpNew = *pswpClient; 4163 pswpNew->hwnd = (fComments) ? hwndAutoMLE : hwndAutoview; 4164 pswpNew->x = pswpClient->x + 3; 4165 pswpNew->y = pswpClient->y + 3; 4166 if (fMoreButtons) 4167 pswpNew->y += (bheight + 4); 4168 pswpNew->cx = pswpClient->cx - 6; 4169 AutoviewHeight = min(AutoviewHeight, pswpClient->cy - 116); 4170 AutoviewHeight = max(AutoviewHeight, 36); 4171 pswpNew->cy = AutoviewHeight; 4172 pswpClient->y += (AutoviewHeight + 6); 4173 pswpClient->cy -= (AutoviewHeight + 6); 4174 sCount++; 4175 WinShowWindow((fComments) ? hwndAutoview : hwndAutoMLE, FALSE); 4175 4176 } 4176 4177 else { 4177 WinShowWindow(hwndAutoview, FALSE);4178 WinShowWindow(hwndAutoMLE, FALSE);4178 WinShowWindow(hwndAutoview, FALSE); 4179 WinShowWindow(hwndAutoMLE, FALSE); 4179 4180 } 4180 4181 4181 4182 pswpNew = (PSWP) mp1 + (soldCount + 1 + 4182 (fToolbar != FALSE) +4183 (fDrivebar != FALSE) +4184 (fSplitStatus != FALSE) + (fAutoView != FALSE));4183 (fToolbar != FALSE) + 4184 (fDrivebar != FALSE) + 4185 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4185 4186 *pswpNew = *pswpClient; 4186 4187 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_OPENWALK); … … 4191 4192 sCount++; 4192 4193 pswpNew = (PSWP) mp1 + (soldCount + 2 + 4193 (fToolbar != FALSE) +4194 (fDrivebar != FALSE) +4195 (fSplitStatus != FALSE) + (fAutoView != FALSE));4194 (fToolbar != FALSE) + 4195 (fDrivebar != FALSE) + 4196 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4196 4197 *pswpNew = *pswpClient; 4197 4198 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_USERLIST); … … 4202 4203 sCount++; 4203 4204 pswpNew = (PSWP) mp1 + (soldCount + 3 + 4204 (fToolbar != FALSE) +4205 (fDrivebar != FALSE) +4206 (fSplitStatus != FALSE) + (fAutoView != FALSE));4205 (fToolbar != FALSE) + 4206 (fDrivebar != FALSE) + 4207 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4207 4208 *pswpNew = *pswpClient; 4208 4209 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_LED); … … 4213 4214 sCount++; 4214 4215 pswpNew = (PSWP) mp1 + (soldCount + 4 + 4215 (fToolbar != FALSE) +4216 (fDrivebar != FALSE) +4217 (fSplitStatus != FALSE) + (fAutoView != FALSE));4216 (fToolbar != FALSE) + 4217 (fDrivebar != FALSE) + 4218 (fSplitStatus != FALSE) + (fAutoView != FALSE)); 4218 4219 *pswpNew = *pswpClient; 4219 4220 pswpNew->hwnd = WinWindowFromID(hwnd, MAIN_LEDHDR); … … 4224 4225 sCount++; 4225 4226 if (fUserComboBox) { 4226 if (!aheight) {4227 4228 SWP swpTemp;4229 4230 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT),4231 &swpTemp);4232 aheight = swpTemp.cy;4233 }4234 pswpNew = (PSWP) mp1 + (soldCount + 5 +4235 (fToolbar != FALSE) +4236 (fSplitStatus != FALSE) +4237 (fDrivebar != FALSE) + (fAutoView != FALSE));4238 *pswpNew = *pswpClient;4239 pswpNew->hwnd = hwndDrivelist;4240 pswpNew->x = swpClient.x;4241 pswpNew->cx = 48;4242 pswpClient->cy -= (aheight + 6L);4243 pswpNew->y = pswpClient->y;4244 pswpNew->cy = pswpClient->cy + (aheight + 5L);4245 sCount++;4246 pswpNew = (PSWP) mp1 + (soldCount + 6 +4247 (fToolbar != FALSE) +4248 (fDrivebar != FALSE) +4249 (fSplitStatus != FALSE) +4250 (fAutoView != FALSE));4251 *pswpNew = *pswpClient;4252 pswpNew->hwnd = hwndStatelist;4253 pswpNew->x = swpClient.x + 48;4254 pswpNew->cx = (swpClient.cx - 48) / 7;4255 pswpNew->y = pswpClient->y;4256 pswpNew->cy = pswpClient->cy + (aheight + 5L);4257 sCount++;4258 pswpNew = (PSWP) mp1 + (soldCount + 7 +4259 (fToolbar != FALSE) +4260 (fDrivebar != FALSE) +4261 (fSplitStatus != FALSE) +4262 (fAutoView != FALSE));4263 *pswpNew = *pswpClient;4264 pswpNew->hwnd = hwndCmdlist;4265 pswpNew->x = swpClient.x + 48 + ((swpClient.cx - 48) / 7);4266 pswpNew->cx = (swpClient.cx - 48) / 5 +4267 ((swpClient.cx - 48) / 5) - ((swpClient.cx - 48) / 7);4268 pswpNew->y = pswpClient->y;4269 pswpNew->cy = pswpClient->cy + (aheight + 5L);4270 sCount++;4271 pswpNew = (PSWP) mp1 + (soldCount + 8 +4272 (fToolbar != FALSE) +4273 (fDrivebar != FALSE) +4274 (fSplitStatus != FALSE) +4275 (fAutoView != FALSE));4276 *pswpNew = *pswpClient;4277 pswpNew->hwnd = hwndUserlist;4278 pswpNew->x = swpClient.x + 48 + (((swpClient.cx - 48) / 5) * 2);4279 pswpNew->cx = ((swpClient.x + swpClient.cx) - pswpNew->x) -4280 ((fToolbar) ? ((swpClient.cx - 48) / 7) : 0);4281 pswpNew->y = pswpClient->y;4282 pswpNew->cy = pswpClient->cy + (aheight + 5L);4283 sCount++;4284 if (fToolbar) {4285 pswpNew = (PSWP) mp1 + (soldCount + 9 +4286 (fToolbar != FALSE) +4287 (fDrivebar != FALSE) +4288 (fSplitStatus != FALSE) +4289 (fAutoView != FALSE));4290 *pswpNew = *pswpClient;4291 pswpNew->hwnd = hwndButtonlist;4292 pswpNew->x = swpClient.cx - ((swpClient.cx - 48) / 7) + 4;4293 pswpNew->cx = (swpClient.x + swpClient.cx) - pswpNew->x;4294 pswpNew->y = pswpClient->y;4295 pswpNew->cy = pswpClient->cy + (aheight + 5L);4296 sCount++;4297 }4298 else4299 WinShowWindow(hwndButtonlist, FALSE);4227 if (!aheight) { 4228 4229 SWP swpTemp; 4230 4231 WinQueryWindowPos(WinWindowFromID(hwndDrivelist, CBID_EDIT), 4232 &swpTemp); 4233 aheight = swpTemp.cy; 4234 } 4235 pswpNew = (PSWP) mp1 + (soldCount + 5 + 4236 (fToolbar != FALSE) + 4237 (fSplitStatus != FALSE) + 4238 (fDrivebar != FALSE) + (fAutoView != FALSE)); 4239 *pswpNew = *pswpClient; 4240 pswpNew->hwnd = hwndDrivelist; 4241 pswpNew->x = swpClient.x; 4242 pswpNew->cx = 48; 4243 pswpClient->cy -= (aheight + 6L); 4244 pswpNew->y = pswpClient->y; 4245 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4246 sCount++; 4247 pswpNew = (PSWP) mp1 + (soldCount + 6 + 4248 (fToolbar != FALSE) + 4249 (fDrivebar != FALSE) + 4250 (fSplitStatus != FALSE) + 4251 (fAutoView != FALSE)); 4252 *pswpNew = *pswpClient; 4253 pswpNew->hwnd = hwndStatelist; 4254 pswpNew->x = swpClient.x + 48; 4255 pswpNew->cx = (swpClient.cx - 48) / 7; 4256 pswpNew->y = pswpClient->y; 4257 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4258 sCount++; 4259 pswpNew = (PSWP) mp1 + (soldCount + 7 + 4260 (fToolbar != FALSE) + 4261 (fDrivebar != FALSE) + 4262 (fSplitStatus != FALSE) + 4263 (fAutoView != FALSE)); 4264 *pswpNew = *pswpClient; 4265 pswpNew->hwnd = hwndCmdlist; 4266 pswpNew->x = swpClient.x + 48 + ((swpClient.cx - 48) / 7); 4267 pswpNew->cx = (swpClient.cx - 48) / 5 + 4268 ((swpClient.cx - 48) / 5) - ((swpClient.cx - 48) / 7); 4269 pswpNew->y = pswpClient->y; 4270 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4271 sCount++; 4272 pswpNew = (PSWP) mp1 + (soldCount + 8 + 4273 (fToolbar != FALSE) + 4274 (fDrivebar != FALSE) + 4275 (fSplitStatus != FALSE) + 4276 (fAutoView != FALSE)); 4277 *pswpNew = *pswpClient; 4278 pswpNew->hwnd = hwndUserlist; 4279 pswpNew->x = swpClient.x + 48 + (((swpClient.cx - 48) / 5) * 2); 4280 pswpNew->cx = ((swpClient.x + swpClient.cx) - pswpNew->x) - 4281 ((fToolbar) ? ((swpClient.cx - 48) / 7) : 0); 4282 pswpNew->y = pswpClient->y; 4283 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4284 sCount++; 4285 if (fToolbar) { 4286 pswpNew = (PSWP) mp1 + (soldCount + 9 + 4287 (fToolbar != FALSE) + 4288 (fDrivebar != FALSE) + 4289 (fSplitStatus != FALSE) + 4290 (fAutoView != FALSE)); 4291 *pswpNew = *pswpClient; 4292 pswpNew->hwnd = hwndButtonlist; 4293 pswpNew->x = swpClient.cx - ((swpClient.cx - 48) / 7) + 4; 4294 pswpNew->cx = (swpClient.x + swpClient.cx) - pswpNew->x; 4295 pswpNew->y = pswpClient->y; 4296 pswpNew->cy = pswpClient->cy + (aheight + 5L); 4297 sCount++; 4298 } 4299 else 4300 WinShowWindow(hwndButtonlist, FALSE); 4300 4301 } 4301 4302 else { 4302 WinShowWindow(hwndUserlist, FALSE);4303 WinShowWindow(hwndDrivelist, FALSE);4304 WinShowWindow(hwndStatelist, FALSE);4305 WinShowWindow(hwndButtonlist, FALSE);4306 WinShowWindow(hwndCmdlist, FALSE);4303 WinShowWindow(hwndUserlist, FALSE); 4304 WinShowWindow(hwndDrivelist, FALSE); 4305 WinShowWindow(hwndStatelist, FALSE); 4306 WinShowWindow(hwndButtonlist, FALSE); 4307 WinShowWindow(hwndCmdlist, FALSE); 4307 4308 } 4308 4309 { 4309 PSWP pswpTitlebar = (PSWP) 0, pswpMinbutton = (PSWP) 0;4310 SHORT x;4311 4312 pswpNew = (PSWP) mp1 + (soldCount + 5 +4313 (fToolbar != FALSE) +4314 (fDrivebar != FALSE) +4315 (fSplitStatus != FALSE) +4316 (fAutoView != FALSE) +4317 ((fUserComboBox != FALSE) * 4) +4318 (fUserComboBox != FALSE &&4319 fToolbar != FALSE));4320 pswp = (PSWP) mp1;4321 for (x = 0; x < soldCount; x++) {4322 if (!pswpTitlebar &&4323 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_TITLEBAR)4324 pswpTitlebar = pswp;4325 else if (!pswpMinbutton &&4326 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_MINMAX)4327 pswpMinbutton = pswp;4328 if (pswpTitlebar && pswpMinbutton)4329 break;4330 pswp++;4331 }4332 if (pswpMinbutton && pswpTitlebar) {4333 *pswpNew = *pswpMinbutton;4334 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_IDEALSIZE);4335 pswpNew->cy = pswpMinbutton->cy + 3;4336 pswpNew->cx = min(pswpNew->cy, (pswpMinbutton->cx / 2) + 3);4337 pswpTitlebar->cx -= (pswpNew->cx - 1);4338 pswpNew->x = pswpTitlebar->x + (pswpTitlebar->cx);4339 pswpNew->y = pswpMinbutton->y - 1;4340 sCount++;4341 }4342 else4343 WinShowWindow(WinWindowFromID(hwnd, IDM_IDEALSIZE), FALSE);4310 PSWP pswpTitlebar = (PSWP) 0, pswpMinbutton = (PSWP) 0; 4311 SHORT x; 4312 4313 pswpNew = (PSWP) mp1 + (soldCount + 5 + 4314 (fToolbar != FALSE) + 4315 (fDrivebar != FALSE) + 4316 (fSplitStatus != FALSE) + 4317 (fAutoView != FALSE) + 4318 ((fUserComboBox != FALSE) * 4) + 4319 (fUserComboBox != FALSE && 4320 fToolbar != FALSE)); 4321 pswp = (PSWP) mp1; 4322 for (x = 0; x < soldCount; x++) { 4323 if (!pswpTitlebar && 4324 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_TITLEBAR) 4325 pswpTitlebar = pswp; 4326 else if (!pswpMinbutton && 4327 WinQueryWindowUShort(pswp->hwnd, QWS_ID) == FID_MINMAX) 4328 pswpMinbutton = pswp; 4329 if (pswpTitlebar && pswpMinbutton) 4330 break; 4331 pswp++; 4332 } 4333 if (pswpMinbutton && pswpTitlebar) { 4334 *pswpNew = *pswpMinbutton; 4335 pswpNew->hwnd = WinWindowFromID(hwnd, IDM_IDEALSIZE); 4336 pswpNew->cy = pswpMinbutton->cy + 3; 4337 pswpNew->cx = min(pswpNew->cy, (pswpMinbutton->cx / 2) + 3); 4338 pswpTitlebar->cx -= (pswpNew->cx - 1); 4339 pswpNew->x = pswpTitlebar->x + (pswpTitlebar->cx); 4340 pswpNew->y = pswpMinbutton->y - 1; 4341 sCount++; 4342 } 4343 else 4344 WinShowWindow(WinWindowFromID(hwnd, IDM_IDEALSIZE), FALSE); 4344 4345 } 4345 4346 4346 4347 if (fMoreButtons) { 4347 4348 4348 LONG lastx;4349 4350 pswpNew = (PSWP) mp1 + (soldCount + 6 +4351 (fToolbar != FALSE) +4352 (fDrivebar != FALSE) +4353 (fSplitStatus != FALSE) +4354 (fAutoView != FALSE) +4355 ((fUserComboBox != FALSE) * 4) +4356 (fUserComboBox != FALSE &&4357 fToolbar != FALSE));4358 *pswpNew = *pswpClient;4359 pswpNew->hwnd = hwndName;4360 pswpNew->x = swpClient.x + 3;4361 pswpNew->y = swpClient.y + (sheight + 6);4362 pswpNew->cx = ((swpClient.cx / 2) + (swpClient.cx / 5)) - 3;4363 lastx = pswpNew->x + pswpNew->cx;4364 pswpNew->cy = bheight;4365 pswpClient->y += (bheight + 4);4366 pswpClient->cy -= (bheight + 4);4367 sCount++;4368 pswpNew = (PSWP) mp1 + (soldCount + 7 +4369 (fToolbar != FALSE) +4370 (fDrivebar != FALSE) +4371 (fSplitStatus != FALSE) +4372 (fAutoView != FALSE) +4373 ((fUserComboBox != FALSE) * 4) +4374 (fUserComboBox != FALSE &&4375 fToolbar != FALSE));4376 *pswpNew = *pswpClient;4377 pswpNew->hwnd = hwndDate;4378 pswpNew->x = lastx + 3;4379 pswpNew->y = swpClient.y + (sheight + 6);4380 pswpNew->cx = (swpClient.cx / 6) + (swpClient.cx / 16) - 3;4381 lastx = pswpNew->x + pswpNew->cx;4382 pswpNew->cy = bheight;4383 sCount++;4384 pswpNew = (PSWP) mp1 + (soldCount + 8 +4385 (fToolbar != FALSE) +4386 (fDrivebar != FALSE) +4387 (fSplitStatus != FALSE) +4388 (fAutoView != FALSE) +4389 ((fUserComboBox != FALSE) * 4) +4390 (fUserComboBox != FALSE &&4391 fToolbar != FALSE));4392 *pswpNew = *pswpClient;4393 pswpNew->hwnd = hwndAttr;4394 pswpNew->x = lastx + 3;4395 pswpNew->y = swpClient.y + (sheight + 6);4396 pswpNew->cx = (swpClient.cx - pswpNew->x) - 1;4397 pswpNew->cy = bheight;4398 sCount++;4349 LONG lastx; 4350 4351 pswpNew = (PSWP) mp1 + (soldCount + 6 + 4352 (fToolbar != FALSE) + 4353 (fDrivebar != FALSE) + 4354 (fSplitStatus != FALSE) + 4355 (fAutoView != FALSE) + 4356 ((fUserComboBox != FALSE) * 4) + 4357 (fUserComboBox != FALSE && 4358 fToolbar != FALSE)); 4359 *pswpNew = *pswpClient; 4360 pswpNew->hwnd = hwndName; 4361 pswpNew->x = swpClient.x + 3; 4362 pswpNew->y = swpClient.y + (sheight + 6); 4363 pswpNew->cx = ((swpClient.cx / 2) + (swpClient.cx / 5)) - 3; 4364 lastx = pswpNew->x + pswpNew->cx; 4365 pswpNew->cy = bheight; 4366 pswpClient->y += (bheight + 4); 4367 pswpClient->cy -= (bheight + 4); 4368 sCount++; 4369 pswpNew = (PSWP) mp1 + (soldCount + 7 + 4370 (fToolbar != FALSE) + 4371 (fDrivebar != FALSE) + 4372 (fSplitStatus != FALSE) + 4373 (fAutoView != FALSE) + 4374 ((fUserComboBox != FALSE) * 4) + 4375 (fUserComboBox != FALSE && 4376 fToolbar != FALSE)); 4377 *pswpNew = *pswpClient; 4378 pswpNew->hwnd = hwndDate; 4379 pswpNew->x = lastx + 3; 4380 pswpNew->y = swpClient.y + (sheight + 6); 4381 pswpNew->cx = (swpClient.cx / 6) + (swpClient.cx / 16) - 3; 4382 lastx = pswpNew->x + pswpNew->cx; 4383 pswpNew->cy = bheight; 4384 sCount++; 4385 pswpNew = (PSWP) mp1 + (soldCount + 8 + 4386 (fToolbar != FALSE) + 4387 (fDrivebar != FALSE) + 4388 (fSplitStatus != FALSE) + 4389 (fAutoView != FALSE) + 4390 ((fUserComboBox != FALSE) * 4) + 4391 (fUserComboBox != FALSE && 4392 fToolbar != FALSE)); 4393 *pswpNew = *pswpClient; 4394 pswpNew->hwnd = hwndAttr; 4395 pswpNew->x = lastx + 3; 4396 pswpNew->y = swpClient.y + (sheight + 6); 4397 pswpNew->cx = (swpClient.cx - pswpNew->x) - 1; 4398 pswpNew->cy = bheight; 4399 sCount++; 4399 4400 } 4400 4401 else { 4401 WinShowWindow(hwndAttr, FALSE);4402 WinShowWindow(hwndName, FALSE);4403 WinShowWindow(hwndDate, FALSE);4402 WinShowWindow(hwndAttr, FALSE); 4403 WinShowWindow(hwndName, FALSE); 4404 WinShowWindow(hwndDate, FALSE); 4404 4405 } 4405 4406 return MRFROMSHORT(sCount); … … 4414 4415 sCount += 6; 4415 4416 if (fSplitStatus) 4416 sCount++;4417 sCount++; 4417 4418 if (fToolbar) 4418 sCount++;4419 sCount++; 4419 4420 if (fUserComboBox) { 4420 sCount += 4;4421 if (fToolbar)4422 sCount++;4421 sCount += 4; 4422 if (fToolbar) 4423 sCount++; 4423 4424 } 4424 4425 if (fDrivebar) 4425 sCount++;4426 sCount++; 4426 4427 if (fAutoView) 4427 sCount++;4428 sCount++; 4428 4429 if (fMoreButtons) 4429 sCount += 3;4430 sCount += 3; 4430 4431 return MRFROMSHORT(sCount); 4431 4432 } … … 4448 4449 // DbgMsg(pszSrcFile, __LINE__, "IDM_CONTEXTMENU %x", hwnd); 4449 4450 if (hwnd != NULLHANDLE) { 4450 HWND hwndParent = WinQueryWindow(hwnd, QW_PARENT);4451 USHORT id = WinQueryWindowUShort(hwndParent, QWS_ID);4452 switch (id) {4453 case MAIN_SETUPLIST:4454 case MAIN_USERLIST:4455 case MAIN_CMDLIST:4456 // DbgMsg(pszSrcFile, __LINE__, "WM_CONTEXTMENU");4457 WinPostMsg(hwnd, WM_CONTEXTMENU, 0, 0);4458 }4451 HWND hwndParent = WinQueryWindow(hwnd, QW_PARENT); 4452 USHORT id = WinQueryWindowUShort(hwndParent, QWS_ID); 4453 switch (id) { 4454 case MAIN_SETUPLIST: 4455 case MAIN_USERLIST: 4456 case MAIN_CMDLIST: 4457 // DbgMsg(pszSrcFile, __LINE__, "WM_CONTEXTMENU"); 4458 WinPostMsg(hwnd, WM_CONTEXTMENU, 0, 0); 4459 } 4459 4460 } 4460 4461 } … … 4485 4486 wa.size = sizeof(wa); 4486 4487 pci = 4487 (PCNRITEM)4488 WinSendMsg(WinWindowFromID4489 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR),4490 CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),4491 MPFROMSHORT(CRA_CURSORED));4488 (PCNRITEM) 4489 WinSendMsg(WinWindowFromID 4490 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), 4491 CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST), 4492 MPFROMSHORT(CRA_CURSORED)); 4492 4493 if (pci && (INT) pci != -1) { 4493 strcpy(wa.szCurrentPath1, pci->pszFileName);4494 MakeValidDir(wa.szCurrentPath1);4494 strcpy(wa.szCurrentPath1, pci->pszFileName); 4495 MakeValidDir(wa.szCurrentPath1); 4495 4496 } 4496 4497 else 4497 save_dir2(wa.szCurrentPath1);4498 save_dir2(wa.szCurrentPath1); 4498 4499 TopWindowName(hwndMain, (HWND) 0, wa.szCurrentPath2); 4499 4500 if (!*wa.szCurrentPath2) 4500 strcpy(wa.szCurrentPath2, wa.szCurrentPath1);4501 strcpy(wa.szCurrentPath2, wa.szCurrentPath1); 4501 4502 MakeValidDir(wa.szCurrentPath2); 4502 4503 if (WinDlgBox(HWND_DESKTOP, 4503 hwnd,4504 WalkTwoCmpDlgProc,4505 FM3ModHandle,4506 WALK2_FRAME,4507 MPFROMP(&wa)) &&4508 !IsFile(wa.szCurrentPath1) && !IsFile(wa.szCurrentPath2)) {4509 if (!*dircompare) {4510 4511 COMPARE *cmp;4512 4513 cmp = xmallocz(sizeof(COMPARE), pszSrcFile, __LINE__);4514 if (cmp) {4515 cmp->size = sizeof(COMPARE);4516 strcpy(cmp->leftdir, wa.szCurrentPath1);4517 strcpy(cmp->rightdir, wa.szCurrentPath2);4518 cmp->hwndParent = hwnd;4519 cmp->dcd.hwndParent = hwnd;4520 WinDlgBox(HWND_DESKTOP,4521 HWND_DESKTOP,4522 CompareDlgProc, FM3ModHandle, COMP_FRAME, MPFROMP(cmp));4523 }4524 }4525 else {4526 4527 CHAR szPath1[CCHMAXPATH];4528 CHAR szPath2[CCHMAXPATH];4529 runemf2(SEPARATE,4530 HWND_DESKTOP, pszSrcFile, __LINE__,4531 NULL, NULL,4532 "%s %s %s",4533 dircompare,4534 BldQuotedFileName(szPath1, wa.szCurrentPath1),4535 BldQuotedFileName(szPath2, wa.szCurrentPath2));4536 }4504 hwnd, 4505 WalkTwoCmpDlgProc, 4506 FM3ModHandle, 4507 WALK2_FRAME, 4508 MPFROMP(&wa)) && 4509 !IsFile(wa.szCurrentPath1) && !IsFile(wa.szCurrentPath2)) { 4510 if (!*dircompare) { 4511 4512 COMPARE *cmp; 4513 4514 cmp = xmallocz(sizeof(COMPARE), pszSrcFile, __LINE__); 4515 if (cmp) { 4516 cmp->size = sizeof(COMPARE); 4517 strcpy(cmp->leftdir, wa.szCurrentPath1); 4518 strcpy(cmp->rightdir, wa.szCurrentPath2); 4519 cmp->hwndParent = hwnd; 4520 cmp->dcd.hwndParent = hwnd; 4521 WinDlgBox(HWND_DESKTOP, 4522 HWND_DESKTOP, 4523 CompareDlgProc, FM3ModHandle, COMP_FRAME, MPFROMP(cmp)); 4524 } 4525 } 4526 else { 4527 4528 CHAR szPath1[CCHMAXPATH]; 4529 CHAR szPath2[CCHMAXPATH]; 4530 runemf2(SEPARATE, 4531 HWND_DESKTOP, pszSrcFile, __LINE__, 4532 NULL, NULL, 4533 "%s %s %s", 4534 dircompare, 4535 BldQuotedFileName(szPath1, wa.szCurrentPath1), 4536 BldQuotedFileName(szPath2, wa.szCurrentPath2)); 4537 } 4537 4538 } 4538 4539 } … … 4546 4547 case IDM_CLI: 4547 4548 if (fSplitStatus && 4548 hwndStatus2 &&4549 !WinIsWindow(WinQueryAnchorBlock(hwnd),4550 WinWindowFromID(hwndStatus2, COMMAND_LINE)))4549 hwndStatus2 && 4550 !WinIsWindow(WinQueryAnchorBlock(hwnd), 4551 WinWindowFromID(hwndStatus2, COMMAND_LINE))) 4551 4552 PostMsg(hwndStatus2, UM_CLICKED, MPVOID, MPVOID); 4552 4553 break; … … 4561 4562 bstrip(temp); 4562 4563 if (*temp && 4563 !DosQueryPathInfo(temp, FIL_QUERYFULLNAME, path, sizeof(path))) {4564 if (SHORT1FROMMP(mp1) == IDM_ADDTOUSERLIST) {4565 add_udir(TRUE, path);4566 if (fUdirsChanged)4567 save_udirs();4568 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID);4569 }4570 else {4571 if (!remove_udir(path))4572 Runtime_Error(pszSrcFile, __LINE__, "remove_udir");4573 else {4574 if (fUdirsChanged)4575 save_udirs();4576 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID);4577 }4578 }4564 !DosQueryPathInfo(temp, FIL_QUERYFULLNAME, path, sizeof(path))) { 4565 if (SHORT1FROMMP(mp1) == IDM_ADDTOUSERLIST) { 4566 add_udir(TRUE, path); 4567 if (fUdirsChanged) 4568 save_udirs(); 4569 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 4570 } 4571 else { 4572 if (!remove_udir(path)) 4573 Runtime_Error(pszSrcFile, __LINE__, "remove_udir"); 4574 else { 4575 if (fUdirsChanged) 4576 save_udirs(); 4577 WinSendMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 4578 } 4579 } 4579 4580 } 4580 4581 } … … 4591 4592 // Complain if attempting to use reserved name 4592 4593 if (stricmp(szStateName, GetPString(IDS_STATETEXT)) == 0 || 4593 // stricmp(szStateName, GetPString(IDS_FM2TEMPTEXT)) == 0 || 4594 // stricmp(szStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0) 4595 stricmp(szStateName, GetPString(IDS_FM2TEMPTEXT)) == 0) 4594 stricmp(szStateName, GetPString(IDS_FM2TEMPTEXT)) == 0) 4596 4595 { 4597 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,4598 GetPString(IDS_WARNINGTEXT),4599 "\"%s\" is a reserved state name", szStateName);4596 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4597 GetPString(IDS_WARNINGTEXT), 4598 "\"%s\" is a reserved state name", szStateName); 4600 4599 } 4601 4600 // Ignore request if blank 4602 else if (*szStateName) 4603 { 4604 BOOL fAbortOperation = FALSE; 4605 if (!fNoSaveState && fSaveState && stricmp(szStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0) 4606 { 4607 if (saymsg(MB_YESNO | MB_DEFBUTTON2 | MB_ICONASTERISK, hwnd, 4608 GetPString(IDS_WARNINGTEXT), 4609 "\"%s\" is the state name used by 'Save directory container state'. Any changes to this state will last only until FM/2 closes or this setting is disabled. Proceed with this change?", szStateName) == MBID_NO) 4610 fAbortOperation = TRUE; 4611 } 4612 if (!fAbortOperation) { 4601 else if (*szStateName) { 4602 BOOL fAbortOperation = FALSE; 4603 if (!fNoSaveState && fSaveState && stricmp(szStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0) 4604 { 4605 if (saymsg(MB_YESNO | MB_DEFBUTTON2 | MB_ICONASTERISK, hwnd, 4606 GetPString(IDS_WARNINGTEXT), 4607 "\"%s\" is the state name used by \"Save directory container state\". Any changes to this state will last only until FM/2 closes or this setting is disabled. Proceed with this change?", szStateName) == MBID_NO) 4608 fAbortOperation = TRUE; 4609 } 4610 if (!fAbortOperation) { 4613 4611 if (SHORT1FROMMP(mp1) == IDM_SAVEDIRCNRSTATE) { 4614 4612 // Save … … 4617 4615 INT ret = add_setup(szStateName); 4618 4616 if (ret == 0) { 4619 WinSendMsg(hwndStatelist, LM_INSERTITEM,4620 MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(szStateName));4621 save_setups();4617 WinSendMsg(hwndStatelist, LM_INSERTITEM, 4618 MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(szStateName)); 4619 save_setups(); 4622 4620 } 4623 4621 else if (ret != 1) { 4624 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,4625 GetPString(IDS_WARNINGTEXT),4626 "\"%s\" state name add failed", szStateName); // 15 Apr 07 SHL failed4627 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT));4622 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4623 GetPString(IDS_WARNINGTEXT), 4624 "\"%s\" state name add failed", szStateName); // 15 Apr 07 SHL failed 4625 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4628 4626 } 4629 4627 } 4630 else {4631 saymsg(MB_ENTER | MB_ICONASTERISK,4632 hwnd,4633 GetPString(IDS_WARNINGTEXT),4634 nSaved == 0 ?4635 "Nothing to save" :4636 "State data save failed");4637 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT));4638 }4639 }4640 else {4641 // Delete4642 ULONG numsaves = 0, size, x;4643 CHAR s[STATE_NAME_MAX_BYTES + 80];4644 4645 INT ret = remove_setup(szStateName);4646 if (ret == 1)4647 save_setups();4648 sprintf(s, "%s.NumDirsLastTime", szStateName);4649 size = sizeof(ULONG);4650 if (!PrfQueryProfileData(fmprof,4651 FM3Str,4652 s,4653 (PVOID)&numsaves,4654 &size)) {4655 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,4656 GetPString(IDS_WARNINGTEXT),4657 GetPString(IDS_DOESNTEXISTTEXT), szStateName);4658 }4659 else if (!size)4660 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);4661 else {4662 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0L);4663 for (x = 0; x < numsaves; x++) {4664 sprintf(s, "%s.DirCnrPos.%lu", szStateName, x);4665 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4666 sprintf(s, "%s.DirCnrDir.%lu", szStateName, x);4667 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4668 sprintf(s, "%s.DirCnrSort.%lu", szStateName, x);4669 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4670 sprintf(s, "%s.DirCnrFilter.%lu", szStateName, x);4671 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4672 sprintf(s, "%s.DirCnrView.%lu", szStateName, x);4673 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4674 sprintf(s, "%s.DirCnr.%lu.DetailsLongname", szStateName, x);4675 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4676 sprintf(s, "%s.DirCnr.%lu.DetailsSubject", szStateName, x);4677 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4678 sprintf(s, "%s.DirCnr.%lu.DetailsSize", szStateName, x);4679 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4680 sprintf(s, "%s.DirCnr.%lu.DetailsEA", szStateName, x);4681 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4682 sprintf(s, "%s.DirCnr.%lu.DetailsAttr", szStateName, x);4683 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4684 sprintf(s, "%s.DirCnr.%lu.DetailsIcon", szStateName, x);4685 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4686 sprintf(s, "%s.DirCnr.%lu.DetailsLWDate", szStateName, x);4687 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4688 sprintf(s, "%s.DirCnr.%lu.DetailsLWTime", szStateName, x);4689 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4690 sprintf(s, "%s.DirCnr.%lu.DetailsLADate", szStateName, x);4691 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4692 sprintf(s, "%s.DirCnr.%lu.DetailsLATime", szStateName, x);4693 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4694 sprintf(s, "%s.DirCnr.%lu.DetailsCRDate", szStateName, x);4695 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4696 sprintf(s, "%s.DirCnr.%lu.DetailsCRTime", szStateName, x);4697 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4698 sprintf(s, "%s.DirCnr.%lu.Backgroundcolor", szStateName, x);4699 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4700 sprintf(s, "%s.DirCnr.%lu.Fontnamesize", szStateName, x);4701 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4702 }4703 sprintf(s, "%s.LastTreePos", szStateName);4704 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4705 sprintf(s, "%s.MySizeLastTime", szStateName);4706 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0);4707 }4708 PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID);4709 }4710 }4628 else { 4629 saymsg(MB_ENTER | MB_ICONASTERISK, 4630 hwnd, 4631 GetPString(IDS_WARNINGTEXT), 4632 nSaved == 0 ? 4633 "Nothing to save" : 4634 "State data save failed"); 4635 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4636 } 4637 } 4638 else { 4639 // Delete 4640 ULONG numsaves = 0, size, x; 4641 CHAR s[STATE_NAME_MAX_BYTES + 80]; 4642 4643 INT ret = remove_setup(szStateName); 4644 if (ret == 1) 4645 save_setups(); 4646 sprintf(s, "%s.NumDirsLastTime", szStateName); 4647 size = sizeof(ULONG); 4648 if (!PrfQueryProfileData(fmprof, 4649 FM3Str, 4650 s, 4651 (PVOID)&numsaves, 4652 &size)) { 4653 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4654 GetPString(IDS_WARNINGTEXT), 4655 GetPString(IDS_DOESNTEXISTTEXT), szStateName); 4656 } 4657 else if (!size) 4658 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); 4659 else { 4660 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0L); 4661 for (x = 0; x < numsaves; x++) { 4662 sprintf(s, "%s.DirCnrPos.%lu", szStateName, x); 4663 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4664 sprintf(s, "%s.DirCnrDir.%lu", szStateName, x); 4665 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4666 sprintf(s, "%s.DirCnrSort.%lu", szStateName, x); 4667 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4668 sprintf(s, "%s.DirCnrFilter.%lu", szStateName, x); 4669 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4670 sprintf(s, "%s.DirCnrView.%lu", szStateName, x); 4671 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4672 sprintf(s, "%s.DirCnr.%lu.DetailsLongname", szStateName, x); 4673 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4674 sprintf(s, "%s.DirCnr.%lu.DetailsSubject", szStateName, x); 4675 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4676 sprintf(s, "%s.DirCnr.%lu.DetailsSize", szStateName, x); 4677 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4678 sprintf(s, "%s.DirCnr.%lu.DetailsEA", szStateName, x); 4679 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4680 sprintf(s, "%s.DirCnr.%lu.DetailsAttr", szStateName, x); 4681 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4682 sprintf(s, "%s.DirCnr.%lu.DetailsIcon", szStateName, x); 4683 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4684 sprintf(s, "%s.DirCnr.%lu.DetailsLWDate", szStateName, x); 4685 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4686 sprintf(s, "%s.DirCnr.%lu.DetailsLWTime", szStateName, x); 4687 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4688 sprintf(s, "%s.DirCnr.%lu.DetailsLADate", szStateName, x); 4689 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4690 sprintf(s, "%s.DirCnr.%lu.DetailsLATime", szStateName, x); 4691 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4692 sprintf(s, "%s.DirCnr.%lu.DetailsCRDate", szStateName, x); 4693 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4694 sprintf(s, "%s.DirCnr.%lu.DetailsCRTime", szStateName, x); 4695 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4696 sprintf(s, "%s.DirCnr.%lu.Backgroundcolor", szStateName, x); 4697 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4698 sprintf(s, "%s.DirCnr.%lu.Fontnamesize", szStateName, x); 4699 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4700 } 4701 sprintf(s, "%s.LastTreePos", szStateName); 4702 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4703 sprintf(s, "%s.MySizeLastTime", szStateName); 4704 PrfWriteProfileData(fmprof, FM3Str, s, NULL, 0); 4705 } 4706 PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID); 4707 } 4708 } 4711 4709 } 4712 4710 } … … 4721 4719 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 4722 4720 if (swp.fl & SWP_MAXIMIZE) { 4723 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), WM_SYSCOMMAND,4724 MPFROM2SHORT(SC_RESTORE, 0), MPVOID);4725 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp);4721 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), WM_SYSCOMMAND, 4722 MPFROM2SHORT(SC_RESTORE, 0), MPVOID); 4723 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 4726 4724 } 4727 4725 WinGetMaxPosition(WinQueryWindow(hwnd, QW_PARENT), &swpD); … … 4731 4729 swpD.cy -= (icz + bsz); 4732 4730 if (swp.x == swpD.x && swp.y == swpD.y && 4733 swp.cx == swpD.cx && swp.cy == swpD.cy &&4734 // fixme to be #defined someday4735 WinQueryWindowUShort(hwnd, QWL_USER + 10) &&4736 WinQueryWindowUShort(hwnd, QWL_USER + 14)) {4737 swpD.x = WinQueryWindowUShort(hwnd, QWL_USER + 8);4738 swpD.cx = WinQueryWindowUShort(hwnd, QWL_USER + 10);4739 swpD.y = WinQueryWindowUShort(hwnd, QWL_USER + 12);4740 swpD.cy = WinQueryWindowUShort(hwnd, QWL_USER + 14);4731 swp.cx == swpD.cx && swp.cy == swpD.cy && 4732 // fixme to be #defined someday 4733 WinQueryWindowUShort(hwnd, QWL_USER + 10) && 4734 WinQueryWindowUShort(hwnd, QWL_USER + 14)) { 4735 swpD.x = WinQueryWindowUShort(hwnd, QWL_USER + 8); 4736 swpD.cx = WinQueryWindowUShort(hwnd, QWL_USER + 10); 4737 swpD.y = WinQueryWindowUShort(hwnd, QWL_USER + 12); 4738 swpD.cy = WinQueryWindowUShort(hwnd, QWL_USER + 14); 4741 4739 } 4742 4740 else { 4743 WinSetWindowUShort(hwnd, QWL_USER + 8, (USHORT) swp.x);4744 WinSetWindowUShort(hwnd, QWL_USER + 10, (USHORT) swp.cx);4745 WinSetWindowUShort(hwnd, QWL_USER + 12, (USHORT) swp.y);4746 WinSetWindowUShort(hwnd, QWL_USER + 14, (USHORT) swp.cy);4741 WinSetWindowUShort(hwnd, QWL_USER + 8, (USHORT) swp.x); 4742 WinSetWindowUShort(hwnd, QWL_USER + 10, (USHORT) swp.cx); 4743 WinSetWindowUShort(hwnd, QWL_USER + 12, (USHORT) swp.y); 4744 WinSetWindowUShort(hwnd, QWL_USER + 14, (USHORT) swp.cy); 4747 4745 } 4748 4746 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 4749 swpD.x, swpD.y, swpD.cx, swpD.cy, SWP_MOVE | SWP_SIZE);4747 swpD.x, swpD.y, swpD.cx, swpD.cy, SWP_MOVE | SWP_SIZE); 4750 4748 } 4751 4749 break; … … 4753 4751 case IDM_BLINK: 4754 4752 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0, 4755 SWP_MINIMIZE);4753 SWP_MINIMIZE); 4756 4754 WinSetWindowPos(WinQueryWindow(hwnd, QW_PARENT), HWND_TOP, 0, 0, 0, 0, 4757 SWP_RESTORE | SWP_ZORDER);4755 SWP_RESTORE | SWP_ZORDER); 4758 4756 break; 4759 4757 … … 4763 4761 4764 4762 if (hwndTop) 4765 WinSetFocus(HWND_DESKTOP, hwndTop);4763 WinSetFocus(HWND_DESKTOP, hwndTop); 4766 4764 } 4767 4765 break; … … 4785 4783 case IDM_QUICKSETTINGS: 4786 4784 WinDlgBox(HWND_DESKTOP, 4787 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMLONG(mp1));4785 hwnd, CfgDlgProc, FM3ModHandle, CFG_FRAME, MPFROMLONG(mp1)); 4788 4786 break; 4789 4787 … … 4791 4789 case IDM_VIEWINFS: 4792 4790 WinDlgBox(HWND_DESKTOP, 4793 HWND_DESKTOP,4794 ViewInfProc,4795 FM3ModHandle,4796 VINF_FRAME,4797 ((SHORT1FROMMP(mp1) == IDM_VIEWHELPS) ?4798 MPFROMP(NullStr) : MPVOID));4791 HWND_DESKTOP, 4792 ViewInfProc, 4793 FM3ModHandle, 4794 VINF_FRAME, 4795 ((SHORT1FROMMP(mp1) == IDM_VIEWHELPS) ? 4796 MPFROMP(NullStr) : MPVOID)); 4799 4797 break; 4800 4798 … … 4806 4804 TopWindowName(hwnd, (HWND) 0, newpath); 4807 4805 if (WinDlgBox(HWND_DESKTOP, 4808 hwnd,4809 WalkAllDlgProc,4810 FM3ModHandle, WALK_FRAME, MPFROMP(newpath)) && *newpath)4811 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, newpath);4806 hwnd, 4807 WalkAllDlgProc, 4808 FM3ModHandle, WALK_FRAME, MPFROMP(newpath)) && *newpath) 4809 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, newpath); 4812 4810 } 4813 4811 break; … … 4830 4828 if (SHORT1FROMMP(mp2) == CMDSRC_MENU) { 4831 4829 4832 RECTL rcl;4833 ULONG icz = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2L;4834 4835 WinQueryWindowRect(HWND_DESKTOP, &rcl);4836 rcl.yBottom += icz;4837 rcl.yTop -= icz;4838 rcl.xLeft += icz;4839 rcl.xRight -= icz;4840 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID);4830 RECTL rcl; 4831 ULONG icz = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2L; 4832 4833 WinQueryWindowRect(HWND_DESKTOP, &rcl); 4834 rcl.yBottom += icz; 4835 rcl.yTop -= icz; 4836 rcl.xLeft += icz; 4837 rcl.xRight -= icz; 4838 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID); 4841 4839 } 4842 4840 else { 4843 4841 4844 RECTL rcl;4845 4846 WinQueryWindowRect(HWND_DESKTOP, &rcl);4847 rcl.yBottom += 8;4848 rcl.yTop = (rcl.yTop / 2) + (rcl.yTop / 7);4849 rcl.xLeft = (rcl.xRight / 2) - (rcl.xRight / 7);4850 rcl.xRight -= 8;4851 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID);4842 RECTL rcl; 4843 4844 WinQueryWindowRect(HWND_DESKTOP, &rcl); 4845 rcl.yBottom += 8; 4846 rcl.yTop = (rcl.yTop / 2) + (rcl.yTop / 7); 4847 rcl.xLeft = (rcl.xRight / 2) - (rcl.xRight / 7); 4848 rcl.xRight -= 8; 4849 WinSendMsg(hwndHelp, HM_SET_COVERPAGE_SIZE, MPFROMP(&rcl), MPVOID); 4852 4850 } 4853 4851 switch (SHORT1FROMMP(mp1)) { 4854 4852 case IDM_HELPCONTEXT: 4855 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4856 MPFROM2SHORT(HELP_CONTEXT, 0), MPFROMSHORT(HM_RESOURCEID));4857 break;4853 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4854 MPFROM2SHORT(HELP_CONTEXT, 0), MPFROMSHORT(HM_RESOURCEID)); 4855 break; 4858 4856 4859 4857 case IDM_HELPMOUSE: 4860 if (hwndHelp)4861 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4862 MPFROM2SHORT(HELP_MOUSE, 0), MPFROMSHORT(HM_RESOURCEID));4863 break;4858 if (hwndHelp) 4859 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4860 MPFROM2SHORT(HELP_MOUSE, 0), MPFROMSHORT(HM_RESOURCEID)); 4861 break; 4864 4862 4865 4863 case IDM_HELPPIX: 4866 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4867 MPFROM2SHORT(HELP_BITMAP1, 0), MPFROMSHORT(HM_RESOURCEID));4868 break;4864 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4865 MPFROM2SHORT(HELP_BITMAP1, 0), MPFROMSHORT(HM_RESOURCEID)); 4866 break; 4869 4867 4870 4868 case IDM_HELPTUTOR: 4871 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4872 MPFROM2SHORT(HELP_TUTORIAL, 0),4873 MPFROMSHORT(HM_RESOURCEID));4874 break;4869 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4870 MPFROM2SHORT(HELP_TUTORIAL, 0), 4871 MPFROMSHORT(HM_RESOURCEID)); 4872 break; 4875 4873 4876 4874 case IDM_HELPHINTS: 4877 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4878 MPFROM2SHORT(HELP_HINTS, 0), MPFROMSHORT(HM_RESOURCEID));4879 break;4875 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4876 MPFROM2SHORT(HELP_HINTS, 0), MPFROMSHORT(HM_RESOURCEID)); 4877 break; 4880 4878 4881 4879 case IDM_HELPGENERAL: 4882 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4883 MPFROM2SHORT(HELP_MAIN, 0), MPFROMSHORT(HM_RESOURCEID));4884 break;4880 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4881 MPFROM2SHORT(HELP_MAIN, 0), MPFROMSHORT(HM_RESOURCEID)); 4882 break; 4885 4883 case IDM_HELPKEYS: 4886 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4887 MPFROM2SHORT(HELP_KEYS, 0), MPFROMSHORT(HM_RESOURCEID));4888 break;4884 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4885 MPFROM2SHORT(HELP_KEYS, 0), MPFROMSHORT(HM_RESOURCEID)); 4886 break; 4889 4887 4890 4888 case IDM_HELP: 4891 4889 case IDM_HELPCONTENTS: 4892 WinSendMsg(hwndHelp, HM_HELP_CONTENTS, MPVOID, MPVOID);4893 break;4890 WinSendMsg(hwndHelp, HM_HELP_CONTENTS, MPVOID, MPVOID); 4891 break; 4894 4892 4895 4893 case IDM_HELPUSERLIST: 4896 WinSendMsg(hwndHelp, HM_DISPLAY_HELP,4897 MPFROM2SHORT(HELP_USERLISTS, 0),4898 MPFROMSHORT(HM_RESOURCEID));4899 break;4894 WinSendMsg(hwndHelp, HM_DISPLAY_HELP, 4895 MPFROM2SHORT(HELP_USERLISTS, 0), 4896 MPFROMSHORT(HM_RESOURCEID)); 4897 break; 4900 4898 } 4901 4899 } … … 4908 4906 case IDM_ABOUT: 4909 4907 WinDlgBox(HWND_DESKTOP, hwnd, AboutDlgProc, FM3ModHandle, 4910 ABT_FRAME, MPVOID);4908 ABT_FRAME, MPVOID); 4911 4909 break; 4912 4910 … … 4922 4920 4923 4921 if (!DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_VERSION_MINOR, 4924 (PVOID) & version, (ULONG) sizeof(version))) {4925 if (version[0] > 20L || (version[0] == 20L && version[1] > 29L)) {4926 if (SHORT1FROMMP(mp1) == IDM_HICOLORPALETTE)4927 palette = "<WP_HIRESCLRPAL>";4928 else4929 palette = "<WP_LORESCLRPAL>";4930 }4922 (PVOID) & version, (ULONG) sizeof(version))) { 4923 if (version[0] > 20L || (version[0] == 20L && version[1] > 29L)) { 4924 if (SHORT1FROMMP(mp1) == IDM_HICOLORPALETTE) 4925 palette = "<WP_HIRESCLRPAL>"; 4926 else 4927 palette = "<WP_LORESCLRPAL>"; 4928 } 4931 4929 } 4932 4930 OpenObject(palette, Default, hwnd); … … 4944 4942 hWPSObject = WinQueryObject("<WP_SCHPAL>"); 4945 4943 if (hWPSObject != NULLHANDLE) 4946 WinSetObjectData(hWPSObject, "SCHEMES=Winter:PM_Winter,"4947 "Spring:PM_Spring,Summer:PM_Summer,"4948 "System:PM_System,Windows:PM_Windows;"4949 "OPEN=DEFAULT");4944 WinSetObjectData(hWPSObject, "SCHEMES=Winter:PM_Winter," 4945 "Spring:PM_Spring,Summer:PM_Summer," 4946 "System:PM_System,Windows:PM_Windows;" 4947 "OPEN=DEFAULT"); 4950 4948 } 4951 4949 break; … … 4958 4956 case IDM_SYSINFO: 4959 4957 WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, SysInfoDlgProc, FM3ModHandle, 4960 SYS_FRAME, NULL);4958 SYS_FRAME, NULL); 4961 4959 break; 4962 4960 #endif … … 4968 4966 4969 4967 if (hwndTree) 4970 pci = (PCNRITEM) WinSendMsg(hwndTree, CM_QUERYRECORDEMPHASIS,4971 MPFROMLONG(CMA_FIRST),4972 MPFROMSHORT(CRA_CURSORED));4968 pci = (PCNRITEM) WinSendMsg(hwndTree, CM_QUERYRECORDEMPHASIS, 4969 MPFROMLONG(CMA_FIRST), 4970 MPFROMSHORT(CRA_CURSORED)); 4973 4971 if (pci && (INT) pci != -1) { 4974 strcpy(path, pci->pszFileName);4975 MakeValidDir(path);4972 strcpy(path, pci->pszFileName); 4973 MakeValidDir(path); 4976 4974 } 4977 4975 else 4978 save_dir2(path);4976 save_dir2(path); 4979 4977 WinDlgBox(HWND_DESKTOP, hwnd, InstantDlgProc, FM3ModHandle, 4980 BAT_FRAME, MPFROMP(path));4978 BAT_FRAME, MPFROMP(path)); 4981 4979 } 4982 4980 break; … … 4992 4990 TopWindowName(hwnd, (HWND) 0, path); 4993 4991 if (SHORT1FROMMP(mp1) == IDM_DOSCOMMANDLINE) 4994 env = GetCmdSpec(TRUE);4992 env = GetCmdSpec(TRUE); 4995 4993 else if (SHORT1FROMMP(mp1) != IDM_COMMANDLINE) { 4996 env = "WINOS2.COM";4997 type = SEPARATE | FULLSCREEN;4994 env = "WINOS2.COM"; 4995 type = SEPARATE | FULLSCREEN; 4998 4996 } 4999 4997 runemf2(type, hwnd, pszSrcFile, __LINE__, 5000 path, NULL, "%s", env);4998 path, NULL, "%s", env); 5001 4999 } 5002 5000 break; … … 5004 5002 case IDM_KILLPROC: 5005 5003 WinDlgBox(HWND_DESKTOP, hwnd, KillDlgProc, FM3ModHandle, 5006 KILL_FRAME, NULL);5004 KILL_FRAME, NULL); 5007 5005 break; 5008 5006 … … 5019 5017 case IDM_AUTOVIEW: 5020 5018 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5021 &fAutoView, TRUE, "AutoView");5019 &fAutoView, TRUE, "AutoView"); 5022 5020 AutoChange: 5023 5021 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5024 MPFROMLONG(FCF_SIZEBORDER), MPVOID);5022 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5025 5023 if (fAutoView) { 5026 5024 … … 5031 5029 hwndDir = TopWindowName(hwnd, (HWND) 0, s); 5032 5030 if (hwndDir) { 5033 hwndDir = WinWindowFromID(hwndDir, FID_CLIENT);5034 if (hwndDir) {5035 hwndDir = WinWindowFromID(hwndDir, DIR_CNR);5036 if (hwndDir) {5037 pci = (PCNRITEM) WinSendMsg(hwndDir, CM_QUERYRECORDEMPHASIS,5038 MPFROMLONG(CMA_FIRST),5039 MPFROMSHORT(CRA_CURSORED));5040 if (pci && (INT) pci != -1 &&5041 (!(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_SLOW)))5042 WinSendMsg(hwnd,5043 UM_LOADFILE,5044 MPFROMP(pci->pszFileName),5045 (SHORT1FROMMP(mp1) == IDM_AUTOVIEW) ?5046 MPVOID : MPFROMLONG(1));5047 }5048 }5031 hwndDir = WinWindowFromID(hwndDir, FID_CLIENT); 5032 if (hwndDir) { 5033 hwndDir = WinWindowFromID(hwndDir, DIR_CNR); 5034 if (hwndDir) { 5035 pci = (PCNRITEM) WinSendMsg(hwndDir, CM_QUERYRECORDEMPHASIS, 5036 MPFROMLONG(CMA_FIRST), 5037 MPFROMSHORT(CRA_CURSORED)); 5038 if (pci && (INT) pci != -1 && 5039 (!(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_SLOW))) 5040 WinSendMsg(hwnd, 5041 UM_LOADFILE, 5042 MPFROMP(pci->pszFileName), 5043 (SHORT1FROMMP(mp1) == IDM_AUTOVIEW) ? 5044 MPVOID : MPFROMLONG(1)); 5045 } 5046 } 5049 5047 } 5050 5048 } … … 5053 5051 case IDM_TEXTTOOLS: 5054 5052 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5055 &fTextTools, TRUE, "TextTools");5053 &fTextTools, TRUE, "TextTools"); 5056 5054 BuildTools(hwndToolback, TRUE); 5057 5055 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5058 MPFROMLONG(FCF_SIZEBORDER), MPVOID);5056 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5059 5057 break; 5060 5058 5061 5059 case IDM_TOOLTITLES: 5062 5060 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5063 &fToolTitles, TRUE, "ToolTitles");5061 &fToolTitles, TRUE, "ToolTitles"); 5064 5062 BuildTools(hwndToolback, TRUE); 5065 5063 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5066 MPFROMLONG(FCF_SIZEBORDER), MPVOID);5064 MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5067 5065 break; 5068 5066 … … 5072 5070 MenuInvisible = MenuInvisible ? FALSE : TRUE; 5073 5071 if (MenuInvisible) { 5074 WinSetParent(hwndMenu, HWND_OBJECT, FALSE);5075 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),5076 FID_SYSMENU), IDM_HIDEMENU,5077 GetPString(IDS_UNHIDEMENUTEXT));5072 WinSetParent(hwndMenu, HWND_OBJECT, FALSE); 5073 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5074 FID_SYSMENU), IDM_HIDEMENU, 5075 GetPString(IDS_UNHIDEMENUTEXT)); 5078 5076 } 5079 5077 else { 5080 WinSetParent(hwndMenu, WinQueryWindow(hwnd, QW_PARENT), FALSE);5081 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),5082 FID_SYSMENU), IDM_HIDEMENU,5083 GetPString(IDS_HIDEMENUTEXT));5078 WinSetParent(hwndMenu, WinQueryWindow(hwnd, QW_PARENT), FALSE); 5079 WinSetMenuItemText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5080 FID_SYSMENU), IDM_HIDEMENU, 5081 GetPString(IDS_HIDEMENUTEXT)); 5084 5082 } 5085 5083 PostMsg(WinQueryWindow(hwnd, QW_PARENT), WM_UPDATEFRAME, 5086 MPFROMLONG(FCF_MENU), MPVOID);5084 MPFROMLONG(FCF_MENU), MPVOID); 5087 5085 PrfWriteProfileData(fmprof, FM3Str, "MenuInvisible", 5088 &MenuInvisible, sizeof(BOOL));5086 &MenuInvisible, sizeof(BOOL)); 5089 5087 } 5090 5088 break; … … 5099 5097 5100 5098 if (Collector) 5101 already = TRUE;5099 already = TRUE; 5102 5100 if (!already && !fAutoTile && !fExternalCollector) 5103 GetNextWindowPos(hwnd, &swp, NULL, NULL);5101 GetNextWindowPos(hwnd, &swp, NULL, NULL); 5104 5102 hwndC = StartCollector(fExternalCollector ? HWND_DESKTOP : hwnd, 4); 5105 5103 if (hwndC) { 5106 if (!already && !fAutoTile && !fExternalCollector)5107 WinSetWindowPos(hwndC, HWND_TOP,5108 swp.x, swp.y, swp.cx, swp.cy,5109 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER);5110 else if (fAutoTile && !already)5111 TileChildren(hwnd, TRUE);5112 WinSetWindowPos(hwndC, HWND_TOP, 0, 0, 0, 0, SWP_SHOW | SWP_RESTORE |5113 SWP_ACTIVATE);5114 if (SHORT1FROMMP(mp1) == IDM_GREP)5115 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND,5116 MPFROM2SHORT(IDM_GREP, 0), MPVOID);5117 if (SHORT1FROMMP(mp1) == IDM_SEEALL)5118 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND,5119 MPFROM2SHORT(IDM_SEEALL, 0), MPVOID);5104 if (!already && !fAutoTile && !fExternalCollector) 5105 WinSetWindowPos(hwndC, HWND_TOP, 5106 swp.x, swp.y, swp.cx, swp.cy, 5107 SWP_MOVE | SWP_SIZE | SWP_SHOW | SWP_ZORDER); 5108 else if (fAutoTile && !already) 5109 TileChildren(hwnd, TRUE); 5110 WinSetWindowPos(hwndC, HWND_TOP, 0, 0, 0, 0, SWP_SHOW | SWP_RESTORE | 5111 SWP_ACTIVATE); 5112 if (SHORT1FROMMP(mp1) == IDM_GREP) 5113 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND, 5114 MPFROM2SHORT(IDM_GREP, 0), MPVOID); 5115 if (SHORT1FROMMP(mp1) == IDM_SEEALL) 5116 PostMsg(WinWindowFromID(hwndC, FID_CLIENT), WM_COMMAND, 5117 MPFROM2SHORT(IDM_SEEALL, 0), MPVOID); 5120 5118 } 5121 5119 } … … 5128 5126 5129 5127 if (!toolhead || !toolhead->next) { 5130 firsttool = (toolhead) ? toolhead->id : 0;5131 break;5128 firsttool = (toolhead) ? toolhead->id : 0; 5129 break; 5132 5130 } 5133 5131 tool = find_tool(firsttool); 5134 5132 if (!tool) 5135 tool = toolhead;5133 tool = toolhead; 5136 5134 if (SHORT1FROMMP(mp1) == IDM_TOOLRIGHT) { 5137 tool = prev_tool(tool, TRUE);5138 firsttool = tool->id;5135 tool = prev_tool(tool, TRUE); 5136 firsttool = tool->id; 5139 5137 } 5140 5138 else { 5141 tool = next_tool(tool, TRUE);5142 firsttool = tool->id;5139 tool = next_tool(tool, TRUE); 5140 firsttool = tool->id; 5143 5141 } 5144 5142 ResizeTools(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5145 MAIN_TOOLS));5143 MAIN_TOOLS)); 5146 5144 } 5147 5145 break; … … 5153 5151 case IDM_TOOLBAR: 5154 5152 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5155 IDM_TOOLSUBMENU, &fToolbar, TRUE, "Toolbar");5153 IDM_TOOLSUBMENU, &fToolbar, TRUE, "Toolbar"); 5156 5154 BuildTools(hwndToolback, TRUE); 5157 5155 WinShowWindow(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5158 MAIN_TOOLS), fToolbar);5156 MAIN_TOOLS), fToolbar); 5159 5157 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 5160 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);5158 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5161 5159 if (fDrivebar) 5162 5160 WinInvalidateRect(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5163 MAIN_DRIVES), NULL, TRUE);5161 MAIN_DRIVES), NULL, TRUE); 5164 5162 break; 5165 5163 5166 5164 case IDM_DRIVEBAR: 5167 5165 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5168 IDM_DRIVEBAR, &fDrivebar, TRUE, "Drivebar");5166 IDM_DRIVEBAR, &fDrivebar, TRUE, "Drivebar"); 5169 5167 WinShowWindow(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5170 MAIN_DRIVES), fDrivebar);5168 MAIN_DRIVES), fDrivebar); 5171 5169 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5172 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);5170 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5173 5171 PostMsg(hwnd, UM_BUILDDRIVEBAR, MPVOID, MPVOID); 5174 5172 break; … … 5176 5174 case IDM_USERLIST: 5177 5175 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5178 SHORT1FROMMP(mp1), &fUserComboBox, TRUE, "UserComboBox");5176 SHORT1FROMMP(mp1), &fUserComboBox, TRUE, "UserComboBox"); 5179 5177 WinShowWindow(hwndUserlist, fUserComboBox); 5180 5178 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5181 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);5179 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5182 5180 PostMsg(hwnd, UM_FILLUSERLIST, MPVOID, MPVOID); 5183 5181 PostMsg(hwnd, UM_FILLSETUPLIST, MPVOID, MPVOID); … … 5191 5189 WinSetWindowText(hwndAttr, NullStr); 5192 5190 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5193 SHORT1FROMMP(mp1), &fMoreButtons, TRUE, "MoreButtons");5191 SHORT1FROMMP(mp1), &fMoreButtons, TRUE, "MoreButtons"); 5194 5192 if (fMoreButtons) { 5195 5193 … … 5199 5197 5200 5198 if (hwndTemp) { 5201 WinSetFocus(HWND_DESKTOP, hwnd);5202 WinSetFocus(HWND_DESKTOP, hwndTemp);5199 WinSetFocus(HWND_DESKTOP, hwnd); 5200 WinSetFocus(HWND_DESKTOP, hwndTemp); 5203 5201 } 5204 5202 } 5205 5203 PostMsg(WinQueryWindow(hwnd, QW_PARENT), 5206 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID);5204 WM_UPDATEFRAME, MPFROMLONG(FCF_SIZEBORDER), MPVOID); 5207 5205 break; 5208 5206 5209 5207 case IDM_TOGGLEDRAGDIALOG: 5210 5208 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5211 IDM_TOGGLEDRAGDIALOG,5212 &fDragndropDlg,5213 TRUE,5214 "Drag&DropDlg");5209 IDM_TOGGLEDRAGDIALOG, 5210 &fDragndropDlg, 5211 TRUE, 5212 "Drag&DropDlg"); 5215 5213 break; 5216 5214 5217 5215 case IDM_SYNCUPDATES: 5218 5216 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5219 IDM_SYNCUPDATES,5220 &fSyncUpdates,5221 TRUE,5222 "SyncUpdates");5217 IDM_SYNCUPDATES, 5218 &fSyncUpdates, 5219 TRUE, 5220 "SyncUpdates"); 5223 5221 break; 5224 5222 … … 5230 5228 WinQueryWindowPos(hwnd, &swp); 5231 5229 WinSetWindowPos(hwndTree, HWND_TOP, 0, swp.cy - swpT.cy, 0, 0, 5232 SWP_MOVE);5230 SWP_MOVE); 5233 5231 } 5234 5232 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), SHORT1FROMMP(mp1), 5235 &fFreeTree, TRUE, "FreeTree");5233 &fFreeTree, TRUE, "FreeTree"); 5236 5234 if (fAutoTile) 5237 5235 TileChildren(hwnd, TRUE); … … 5240 5238 case IDM_AUTOTILE: 5241 5239 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5242 SHORT1FROMMP(mp1), &fAutoTile, TRUE, "AutoTile");5240 SHORT1FROMMP(mp1), &fAutoTile, TRUE, "AutoTile"); 5243 5241 if (fAutoTile) 5244 5242 TileChildren(hwnd, TRUE); … … 5247 5245 case IDM_TILEBACKWARDS: 5248 5246 SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER), 5249 SHORT1FROMMP(mp1), &fTileBackwards, TRUE, "TileBackwards");5247 SHORT1FROMMP(mp1), &fTileBackwards, TRUE, "TileBackwards"); 5250 5248 if (fAutoTile) 5251 5249 TileChildren(hwnd, TRUE); … … 5292 5290 default: 5293 5291 if (!SwitchCommand((HWND) WinQueryWindowULong(hwnd, QWL_USER), 5294 SHORT1FROMMP(mp1))) {5292 SHORT1FROMMP(mp1))) { 5295 5293 if (SHORT1FROMMP(mp1) >= IDM_COMMANDSTART && 5296 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART) {5297 5298 INT x;5299 HWND hwndCnr;5300 5301 if (!cmdloaded)5302 load_commands();5303 hwndCnr = TopWindow(hwnd, (HWND) 0);5304 hwndCnr = (HWND) WinSendMsg(WinWindowFromID(hwndCnr, FID_CLIENT),5305 UM_CONTAINERHWND, MPVOID, MPVOID);5306 if (!hwndCnr) {5307 Runtime_Error2(pszSrcFile, __LINE__, IDS_NOWINDOWTEXT);5308 break;5309 }5310 x = SHORT1FROMMP(mp1) - IDM_COMMANDSTART;5311 if (x >= 0) {5312 x++;5313 RunCommand(hwndCnr, x);5314 if (fUnHilite) {5315 5316 PCNRITEM pci;5317 DIRCNRDATA *dcd = NULL;5318 5319 // 12 May 07 SHL fixme to understand? backwards maybe? looking for DIR_CNR?5320 if (WinQueryWindowUShort(hwndCnr, QWS_ID) != TREE_CNR)5321 dcd = INSTDATA(hwndCnr);5322 pci = (PCNRITEM) WinSendMsg(hwndCnr,5323 CM_QUERYRECORDEMPHASIS,5324 MPFROMLONG(CMA_FIRST),5325 MPFROMSHORT(CRA_CURSORED));5326 if (pci && (INT) pci != -1 &&5327 (pci->rc.flRecordAttr & CRA_SELECTED))5328 {5329 UnHilite(hwnd,5330 TRUE,5331 dcd ? &dcd->lastselection : NULL,5332 dcd ? dcd ->ulItemsToUnHilite : 0);5333 }5334 }5335 }5294 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART) { 5295 5296 INT x; 5297 HWND hwndCnr; 5298 5299 if (!cmdloaded) 5300 load_commands(); 5301 hwndCnr = TopWindow(hwnd, (HWND) 0); 5302 hwndCnr = (HWND) WinSendMsg(WinWindowFromID(hwndCnr, FID_CLIENT), 5303 UM_CONTAINERHWND, MPVOID, MPVOID); 5304 if (!hwndCnr) { 5305 Runtime_Error2(pszSrcFile, __LINE__, IDS_NOWINDOWTEXT); 5306 break; 5307 } 5308 x = SHORT1FROMMP(mp1) - IDM_COMMANDSTART; 5309 if (x >= 0) { 5310 x++; 5311 RunCommand(hwndCnr, x); 5312 if (fUnHilite) { 5313 5314 PCNRITEM pci; 5315 DIRCNRDATA *dcd = NULL; 5316 5317 // 12 May 07 SHL fixme to understand? backwards maybe? looking for DIR_CNR? 5318 if (WinQueryWindowUShort(hwndCnr, QWS_ID) != TREE_CNR) 5319 dcd = INSTDATA(hwndCnr); 5320 pci = (PCNRITEM) WinSendMsg(hwndCnr, 5321 CM_QUERYRECORDEMPHASIS, 5322 MPFROMLONG(CMA_FIRST), 5323 MPFROMSHORT(CRA_CURSORED)); 5324 if (pci && (INT) pci != -1 && 5325 (pci->rc.flRecordAttr & CRA_SELECTED)) 5326 { 5327 UnHilite(hwnd, 5328 TRUE, 5329 dcd ? &dcd->lastselection : NULL, 5330 dcd ? dcd ->ulItemsToUnHilite : 0); 5331 } 5332 } 5333 } 5336 5334 } 5337 5335 else if (SHORT1FROMMP(mp1) >= IDM_QUICKTOOLSTART && 5338 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART + 50) {5339 if (!qtloaded)5340 load_quicktools();5341 if (quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]) {5342 if (fToolsChanged)5343 save_tools(NULL);5344 if (!load_tools(quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]))5345 load_tools(NULL);5346 else {5347 strcpy(lasttoolbox,5348 quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]);5349 PrfWriteProfileString(fmprof, FM3Str, "LastToolBox", lasttoolbox);5350 }5351 BuildTools(hwndToolback, TRUE);5352 }5336 SHORT1FROMMP(mp1) < IDM_QUICKTOOLSTART + 50) { 5337 if (!qtloaded) 5338 load_quicktools(); 5339 if (quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]) { 5340 if (fToolsChanged) 5341 save_tools(NULL); 5342 if (!load_tools(quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART])) 5343 load_tools(NULL); 5344 else { 5345 strcpy(lasttoolbox, 5346 quicktool[SHORT1FROMMP(mp1) - IDM_QUICKTOOLSTART]); 5347 PrfWriteProfileString(fmprof, FM3Str, "LastToolBox", lasttoolbox); 5348 } 5349 BuildTools(hwndToolback, TRUE); 5350 } 5353 5351 } 5354 5352 else { 5355 5353 5356 HWND hwndActive;5357 5358 hwndActive = TopWindow(hwnd, (HWND) 0);5359 if (hwndActive)5360 PostMsg(WinWindowFromID(hwndActive, FID_CLIENT),5361 WM_COMMAND, mp1, mp2);5354 HWND hwndActive; 5355 5356 hwndActive = TopWindow(hwnd, (HWND) 0); 5357 if (hwndActive) 5358 PostMsg(WinWindowFromID(hwndActive, FID_CLIENT), 5359 WM_COMMAND, mp1, mp2); 5362 5360 } 5363 5361 } … … 5368 5366 5369 5367 static MRESULT EXPENTRY MainWMOnce(HWND hwnd, ULONG msg, MPARAM mp1, 5370 MPARAM mp2)5368 MPARAM mp2) 5371 5369 { 5372 5370 TID tid; … … 5391 5389 if (_beginthread(MakeMainObjWin, NULL, 245760, MPVOID) == -1) { 5392 5390 Runtime_Error(pszSrcFile, __LINE__, 5393 GetPString(IDS_COULDNTSTARTTHREADTEXT));5391 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 5394 5392 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID); 5395 5393 return 0; … … 5410 5408 5411 5409 if (!WinCreateWindow(hwndFrame, 5412 WC_BUTTON,5413 "I",5414 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS,5415 ((swp.cx -5416 WinQuerySysValue(HWND_DESKTOP,5417 SV_CXMINMAXBUTTON)) -5418 WinQuerySysValue(HWND_DESKTOP,5419 SV_CXMINMAXBUTTON) / 2) -5420 WinQuerySysValue(HWND_DESKTOP,5421 SV_CXSIZEBORDER),5422 (swp.cy - WinQuerySysValue(HWND_DESKTOP,5423 SV_CYMINMAXBUTTON)) -5424 WinQuerySysValue(HWND_DESKTOP,5425 SV_CYSIZEBORDER),5426 WinQuerySysValue(HWND_DESKTOP,5427 SV_CXMINMAXBUTTON) / 2,5428 WinQuerySysValue(HWND_DESKTOP,5429 SV_CYMINMAXBUTTON),5430 hwnd, HWND_TOP, IDM_IDEALSIZE, NULL, NULL)) {5410 WC_BUTTON, 5411 "I", 5412 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS, 5413 ((swp.cx - 5414 WinQuerySysValue(HWND_DESKTOP, 5415 SV_CXMINMAXBUTTON)) - 5416 WinQuerySysValue(HWND_DESKTOP, 5417 SV_CXMINMAXBUTTON) / 2) - 5418 WinQuerySysValue(HWND_DESKTOP, 5419 SV_CXSIZEBORDER), 5420 (swp.cy - WinQuerySysValue(HWND_DESKTOP, 5421 SV_CYMINMAXBUTTON)) - 5422 WinQuerySysValue(HWND_DESKTOP, 5423 SV_CYSIZEBORDER), 5424 WinQuerySysValue(HWND_DESKTOP, 5425 SV_CXMINMAXBUTTON) / 2, 5426 WinQuerySysValue(HWND_DESKTOP, 5427 SV_CYMINMAXBUTTON), 5428 hwnd, HWND_TOP, IDM_IDEALSIZE, NULL, NULL)) { 5431 5429 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5432 5430 } 5433 5431 else { 5434 5432 WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_IDEALSIZE), 5435 IdealButtonProc);5433 IdealButtonProc); 5436 5434 SetPresParams(WinWindowFromID(hwndFrame, 5437 IDM_IDEALSIZE),5438 NULL, NULL, NULL, GetPString(IDS_10SYSTEMVIOTEXT));5435 IDM_IDEALSIZE), 5436 NULL, NULL, NULL, GetPString(IDS_10SYSTEMVIOTEXT)); 5439 5437 } 5440 5438 5441 5439 hwndTmp = WinCreateWindow(hwndFrame, 5442 WC_BUTTON,5443 "#1019",5444 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS |5445 BS_BITMAP,5446 swp.cx - 46,5447 swp.y + 2,5448 24,5449 22, hwnd, HWND_TOP, IDM_OPENWALK, NULL, NULL);5440 WC_BUTTON, 5441 "#1019", 5442 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS | 5443 BS_BITMAP, 5444 swp.cx - 46, 5445 swp.y + 2, 5446 24, 5447 22, hwnd, HWND_TOP, IDM_OPENWALK, NULL, NULL); 5450 5448 if (!hwndTmp) 5451 5449 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5452 5450 5453 5451 hwndTmp = WinCreateWindow(hwndFrame, 5454 WC_BUTTON,5455 "#3062",5456 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS |5457 BS_BITMAP,5458 swp.cx - 22,5459 swp.y + 2,5460 24,5461 22, hwnd, HWND_TOP, IDM_USERLIST, NULL, NULL);5452 WC_BUTTON, 5453 "#3062", 5454 WS_VISIBLE | BS_PUSHBUTTON | BS_NOPOINTERFOCUS | 5455 BS_BITMAP, 5456 swp.cx - 22, 5457 swp.y + 2, 5458 24, 5459 22, hwnd, HWND_TOP, IDM_USERLIST, NULL, NULL); 5462 5460 if (!hwndTmp) 5463 5461 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5464 5462 5465 5463 hwndUserlist = WinCreateWindow(hwndFrame, 5466 WC_COMBOBOX,5467 (PSZ) NULL,5468 WS_VISIBLE | CBS_DROPDOWN |5469 LS_HORZSCROLL,5470 (swp.x +5471 WinQuerySysValue(HWND_DESKTOP,5472 SV_CXSIZEBORDER) + 48L),5473 (swp.cy -5474 WinQuerySysValue(HWND_DESKTOP,5475 SV_CYSIZEBORDER)) - 60,5476 ((swp.cx -5477 (WinQuerySysValue(HWND_DESKTOP,5478 SV_CXSIZEBORDER) *5479 2)) - 64L), 60L, hwndFrame, HWND_TOP,5480 MAIN_USERLIST, NULL, NULL);5464 WC_COMBOBOX, 5465 (PSZ) NULL, 5466 WS_VISIBLE | CBS_DROPDOWN | 5467 LS_HORZSCROLL, 5468 (swp.x + 5469 WinQuerySysValue(HWND_DESKTOP, 5470 SV_CXSIZEBORDER) + 48L), 5471 (swp.cy - 5472 WinQuerySysValue(HWND_DESKTOP, 5473 SV_CYSIZEBORDER)) - 60, 5474 ((swp.cx - 5475 (WinQuerySysValue(HWND_DESKTOP, 5476 SV_CXSIZEBORDER) * 5477 2)) - 64L), 60L, hwndFrame, HWND_TOP, 5478 MAIN_USERLIST, NULL, NULL); 5481 5479 if (!hwndUserlist) 5482 5480 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5483 5481 hwndCmdlist = WinCreateWindow(hwndFrame, 5484 WC_COMBOBOX,5485 (PSZ) NULL,5486 WS_VISIBLE | CBS_DROPDOWN |5487 LS_HORZSCROLL,5488 (swp.x +5489 WinQuerySysValue(HWND_DESKTOP,5490 SV_CXSIZEBORDER) + 48L),5491 (swp.cy -5492 WinQuerySysValue(HWND_DESKTOP,5493 SV_CYSIZEBORDER)) - 60,5494 ((swp.cx -5495 (WinQuerySysValue(HWND_DESKTOP,5496 SV_CXSIZEBORDER) * 2)) -5497 64L), 60L, hwndFrame, HWND_TOP,5498 MAIN_CMDLIST, NULL, NULL);5482 WC_COMBOBOX, 5483 (PSZ) NULL, 5484 WS_VISIBLE | CBS_DROPDOWN | 5485 LS_HORZSCROLL, 5486 (swp.x + 5487 WinQuerySysValue(HWND_DESKTOP, 5488 SV_CXSIZEBORDER) + 48L), 5489 (swp.cy - 5490 WinQuerySysValue(HWND_DESKTOP, 5491 SV_CYSIZEBORDER)) - 60, 5492 ((swp.cx - 5493 (WinQuerySysValue(HWND_DESKTOP, 5494 SV_CXSIZEBORDER) * 2)) - 5495 64L), 60L, hwndFrame, HWND_TOP, 5496 MAIN_CMDLIST, NULL, NULL); 5499 5497 if (!hwndCmdlist) 5500 5498 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5501 5499 WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT)); 5502 5500 hwndStatelist = WinCreateWindow(hwndFrame, 5503 WC_COMBOBOX,5504 (PSZ) NULL,5505 WS_VISIBLE | CBS_DROPDOWN |5506 LS_HORZSCROLL,5507 (swp.x +5508 WinQuerySysValue(HWND_DESKTOP,5509 SV_CXSIZEBORDER) + 48L),5510 (swp.cy -5511 WinQuerySysValue(HWND_DESKTOP,5512 SV_CYSIZEBORDER)) - 60,5513 ((swp.cx -5514 (WinQuerySysValue(HWND_DESKTOP,5515 SV_CXSIZEBORDER) *5516 2)) - 64L), 60L, hwndFrame, HWND_TOP,5517 MAIN_SETUPLIST, NULL, NULL);5501 WC_COMBOBOX, 5502 (PSZ) NULL, 5503 WS_VISIBLE | CBS_DROPDOWN | 5504 LS_HORZSCROLL, 5505 (swp.x + 5506 WinQuerySysValue(HWND_DESKTOP, 5507 SV_CXSIZEBORDER) + 48L), 5508 (swp.cy - 5509 WinQuerySysValue(HWND_DESKTOP, 5510 SV_CYSIZEBORDER)) - 60, 5511 ((swp.cx - 5512 (WinQuerySysValue(HWND_DESKTOP, 5513 SV_CXSIZEBORDER) * 5514 2)) - 64L), 60L, hwndFrame, HWND_TOP, 5515 MAIN_SETUPLIST, NULL, NULL); 5518 5516 if (!hwndStatelist) 5519 5517 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5520 5518 5521 5519 hwndDrivelist = WinCreateWindow(hwndFrame, 5522 WC_COMBOBOX,5523 (PSZ) NULL,5524 WS_VISIBLE | CBS_DROPDOWN,5525 (swp.x +5526 WinQuerySysValue(HWND_DESKTOP,5527 SV_CXSIZEBORDER)),5528 (swp.cy -5529 WinQuerySysValue(HWND_DESKTOP,5530 SV_CYSIZEBORDER)) - 60,5531 48L,5532 60L,5533 hwndFrame,5534 HWND_TOP, MAIN_DRIVELIST, NULL, NULL);5520 WC_COMBOBOX, 5521 (PSZ) NULL, 5522 WS_VISIBLE | CBS_DROPDOWN, 5523 (swp.x + 5524 WinQuerySysValue(HWND_DESKTOP, 5525 SV_CXSIZEBORDER)), 5526 (swp.cy - 5527 WinQuerySysValue(HWND_DESKTOP, 5528 SV_CYSIZEBORDER)) - 60, 5529 48L, 5530 60L, 5531 hwndFrame, 5532 HWND_TOP, MAIN_DRIVELIST, NULL, NULL); 5535 5533 if (!hwndDrivelist) 5536 5534 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5537 5535 SetPresParams(hwndDrivelist, 5538 NULL, NULL, NULL, GetPString(IDS_10SYSTEMMONOTEXT));5536 NULL, NULL, NULL, GetPString(IDS_10SYSTEMMONOTEXT)); 5539 5537 hwndButtonlist = WinCreateWindow(hwndFrame, 5540 WC_COMBOBOX,5541 (PSZ) NULL,5542 WS_VISIBLE | CBS_DROPDOWN |5543 LS_HORZSCROLL,5544 (swp.cx -5545 WinQuerySysValue(HWND_DESKTOP,5546 SV_CXSIZEBORDER)) -5547 164L,5548 (swp.cy -5549 WinQuerySysValue(HWND_DESKTOP,5550 SV_CYSIZEBORDER)) - 60,5551 164L, 60L, hwndFrame, HWND_TOP,5552 MAIN_BUTTONLIST, NULL, NULL);5538 WC_COMBOBOX, 5539 (PSZ) NULL, 5540 WS_VISIBLE | CBS_DROPDOWN | 5541 LS_HORZSCROLL, 5542 (swp.cx - 5543 WinQuerySysValue(HWND_DESKTOP, 5544 SV_CXSIZEBORDER)) - 5545 164L, 5546 (swp.cy - 5547 WinQuerySysValue(HWND_DESKTOP, 5548 SV_CYSIZEBORDER)) - 60, 5549 164L, 60L, hwndFrame, HWND_TOP, 5550 MAIN_BUTTONLIST, NULL, NULL); 5553 5551 if (!hwndButtonlist) 5554 5552 Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW); 5555 5553 WinSendMsg(WinWindowFromID(hwndUserlist, CBID_EDIT), 5556 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);5554 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); 5557 5555 WinSendMsg(WinWindowFromID(hwndStatelist, CBID_EDIT), 5558 EM_SETTEXTLIMIT, MPFROM2SHORT(STATE_NAME_MAX_BYTES, 0), MPVOID);5556 EM_SETTEXTLIMIT, MPFROM2SHORT(STATE_NAME_MAX_BYTES, 0), MPVOID); 5559 5557 WinSendMsg(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5560 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID);5558 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5561 5559 WinSendMsg(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5562 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID);5560 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5563 5561 WinSendMsg(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5564 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID);5562 EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); 5565 5563 5566 5564 oldproc = WinSubclassWindow(WinWindowFromID(hwndUserlist, CBID_EDIT), 5567 DropDownListProc);5565 DropDownListProc); 5568 5566 WinSetWindowPtr(WinWindowFromID(hwndUserlist, CBID_EDIT), 5569 QWL_USER, (PVOID) oldproc);5567 QWL_USER, (PVOID) oldproc); 5570 5568 oldproc = WinSubclassWindow(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5571 DropDownListProc);5569 DropDownListProc); 5572 5570 WinSetWindowPtr(WinWindowFromID(hwndCmdlist, CBID_EDIT), 5573 QWL_USER, (PVOID) oldproc);5571 QWL_USER, (PVOID) oldproc); 5574 5572 oldproc = WinSubclassWindow(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5575 DropDownListProc);5573 DropDownListProc); 5576 5574 WinSetWindowPtr(WinWindowFromID(hwndButtonlist, CBID_EDIT), 5577 QWL_USER, (PVOID) oldproc);5575 QWL_USER, (PVOID) oldproc); 5578 5576 oldproc = WinSubclassWindow(WinWindowFromID(hwndStatelist, CBID_EDIT), 5579 DropDownListProc);5577 DropDownListProc); 5580 5578 WinSetWindowPtr(WinWindowFromID(hwndStatelist, CBID_EDIT), 5581 QWL_USER, (PVOID) oldproc);5579 QWL_USER, (PVOID) oldproc); 5582 5580 oldproc = WinSubclassWindow(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5583 DropDownListProc);5581 DropDownListProc); 5584 5582 WinSetWindowPtr(WinWindowFromID(hwndDrivelist, CBID_EDIT), 5585 QWL_USER, (PVOID) oldproc);5583 QWL_USER, (PVOID) oldproc); 5586 5584 oldproc = WinSubclassWindow(hwndUserlist, DropDownListProc); 5587 5585 WinSetWindowPtr(hwndUserlist, QWL_USER, (PVOID) oldproc); … … 5595 5593 WinSetWindowPtr(hwndButtonlist, QWL_USER, (PVOID) oldproc); 5596 5594 oldproc = WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_USERLIST), 5597 ChildFrameButtonProc);5595 ChildFrameButtonProc); 5598 5596 WinSetWindowPtr(WinWindowFromID(hwndFrame, IDM_USERLIST), 5599 QWL_USER, (PVOID) oldproc);5597 QWL_USER, (PVOID) oldproc); 5600 5598 oldproc = WinSubclassWindow(WinWindowFromID(hwndFrame, IDM_OPENWALK), 5601 ChildFrameButtonProc);5599 ChildFrameButtonProc); 5602 5600 WinSetWindowPtr(WinWindowFromID(hwndFrame, IDM_OPENWALK), 5603 QWL_USER, (PVOID) oldproc);5601 QWL_USER, (PVOID) oldproc); 5604 5602 hwndMenu = WinWindowFromID(hwndFrame, FID_MENU); 5605 5603 WinSendMsg(hwnd, UM_ADDTOMENU, MPVOID, MPVOID); 5606 5604 SetToggleChecks(hwndMenu); 5607 CfgMenuInit(hwndMenu, FALSE); // 14 Feb 08 SHL5605 CfgMenuInit(hwndMenu, FALSE); // 14 Feb 08 SHL 5608 5606 SetConditionalCascade(hwndMenu, IDM_COMMANDLINESUBMENU, IDM_COMMANDLINE); 5609 5607 SetConditionalCascade(hwndMenu, IDM_TOOLSUBMENU, IDM_TOOLBAR); … … 5615 5613 hwndSysMenu = WinWindowFromID(hwndFrame, FID_SYSMENU); 5616 5614 idSysMenu = SHORT1FROMMR(WinSendMsg(hwndSysMenu, 5617 MM_ITEMIDFROMPOSITION,5618 MPVOID, MPVOID));5615 MM_ITEMIDFROMPOSITION, 5616 MPVOID, MPVOID)); 5619 5617 WinSendMsg(hwndSysMenu, 5620 MM_QUERYITEM, MPFROM2SHORT(idSysMenu, 0), MPFROMP(&mit));5618 MM_QUERYITEM, MPFROM2SHORT(idSysMenu, 0), MPFROMP(&mit)); 5621 5619 hwndSysSubMenu = mit.hwndSubMenu; 5622 5620 mi.iPosition = MIT_END; … … 5627 5625 mi.id = IDM_IDEALSIZE; 5628 5626 WinSendMsg(hwndSysSubMenu, 5629 MM_INSERTITEM,5630 MPFROMP(&mi), MPFROMP(GetPString(IDS_IDEALMENUTEXT)));5627 MM_INSERTITEM, 5628 MPFROMP(&mi), MPFROMP(GetPString(IDS_IDEALMENUTEXT))); 5631 5629 mi.afStyle = MIS_TEXT; 5632 5630 mi.id = IDM_HIDEMENU; 5633 5631 WinSendMsg(hwndSysSubMenu, 5634 MM_INSERTITEM,5635 MPFROMP(&mi), MPFROMP(GetPString(IDS_HIDEMENUTEXT)));5632 MM_INSERTITEM, 5633 MPFROMP(&mi), MPFROMP(GetPString(IDS_HIDEMENUTEXT))); 5636 5634 SetSysMenu(hwndSysMenu); 5637 5635 5638 5636 size = sizeof(BOOL); 5639 5637 if (PrfQueryProfileData(fmprof, 5640 FM3Str,5641 "MenuInvisible", &temp, &size) && size && temp)5638 FM3Str, 5639 "MenuInvisible", &temp, &size) && size && temp) 5642 5640 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_HIDEMENU, 0), MPVOID); 5643 5641 size = sizeof(BOOL); 5644 5642 if (PrfQueryProfileData(fmprof, 5645 FM3Str, "FreeTree", &temp, &size) && size && temp)5643 FM3Str, "FreeTree", &temp, &size) && size && temp) 5646 5644 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_FREETREE, 0), MPVOID); 5647 5645 size = sizeof(BOOL); 5648 5646 if (PrfQueryProfileData(fmprof, 5649 FM3Str,5650 "AutoTile", &temp, &size) && size && !temp)5647 FM3Str, 5648 "AutoTile", &temp, &size) && size && !temp) 5651 5649 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_AUTOTILE, 0), MPVOID); 5652 5650 size = sizeof(BOOL); 5653 5651 if (PrfQueryProfileData(fmprof, 5654 FM3Str, "Toolbar", &temp, &size) && size && !temp)5652 FM3Str, "Toolbar", &temp, &size) && size && !temp) 5655 5653 WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID); 5656 5654 … … 5677 5675 hwndTree = StartTreeCnr(hwnd, 4); 5678 5676 if (!hwndTree) 5679 WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT));5677 WinDestroyWindow(WinQueryWindow(hwnd, QW_PARENT)); 5680 5678 else { 5681 if (!fSaveState ||5682 !PrfQueryProfileData(fmprof,5683 FM3Str,5684 "LastTreePos",5685 &swp, &size) || size != sizeof(SWP)) {5686 5687 INT ratio, height = 0;5688 5689 if (!fNoTreeGap)5690 height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2;5691 size = sizeof(ratio);5692 if (!PrfQueryProfileData(fmprof,5693 FM3Str,5694 "TreeWindowRatio",5695 (PVOID) & ratio,5696 &size) || size < sizeof(ratio))5697 ratio = 400;5698 WinSetWindowPos(hwndTree,5699 HWND_TOP,5700 0,5701 height,5702 (swp.cx * 100) / ratio,5703 swp.cy - height,5704 SWP_SHOW | SWP_SIZE | SWP_MOVE |5705 SWP_ACTIVATE | SWP_ZORDER);5706 }5707 else5708 WinSetWindowPos(hwndTree,5709 HWND_TOP,5710 swp.x,5711 swp.y,5712 swp.cx,5713 swp.cy,5714 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW |5715 SWP_ZORDER | SWP_ACTIVATE);5679 if (!fSaveState || 5680 !PrfQueryProfileData(fmprof, 5681 FM3Str, 5682 "LastTreePos", 5683 &swp, &size) || size != sizeof(SWP)) { 5684 5685 INT ratio, height = 0; 5686 5687 if (!fNoTreeGap) 5688 height = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 2; 5689 size = sizeof(ratio); 5690 if (!PrfQueryProfileData(fmprof, 5691 FM3Str, 5692 "TreeWindowRatio", 5693 (PVOID) & ratio, 5694 &size) || size < sizeof(ratio)) 5695 ratio = 400; 5696 WinSetWindowPos(hwndTree, 5697 HWND_TOP, 5698 0, 5699 height, 5700 (swp.cx * 100) / ratio, 5701 swp.cy - height, 5702 SWP_SHOW | SWP_SIZE | SWP_MOVE | 5703 SWP_ACTIVATE | SWP_ZORDER); 5704 } 5705 else 5706 WinSetWindowPos(hwndTree, 5707 HWND_TOP, 5708 swp.x, 5709 swp.y, 5710 swp.cx, 5711 swp.cy, 5712 swp.fl | SWP_MOVE | SWP_SIZE | SWP_SHOW | 5713 SWP_ZORDER | SWP_ACTIVATE); 5716 5714 } 5717 5715 ResizeTools(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5718 MAIN_TOOLS));5716 MAIN_TOOLS)); 5719 5717 } 5720 5718 PostMsg(MainObjectHwnd, UM_SETUP3, mp1, mp2); … … 5727 5725 PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pStatename), MPVOID); 5728 5726 if (!add_setup(pStatename)) 5729 save_setups();5727 save_setups(); 5730 5728 } 5731 5729 PostMsg(MainObjectHwnd, UM_SETUP4, mp1, mp2); … … 5738 5736 5739 5737 for (x = 1; x < argc; x++) { 5740 if (*argv[x] == '/' || *argv[x] == ';')5741 continue;5742 if (!IsFile(argv[x]) && !FindDirCnrByName(argv[x], FALSE))5743 OpenDirCnr((HWND) 0, hwndMain, hwndTree, TRUE, argv[x]);5738 if (*argv[x] == '/' || *argv[x] == ';') 5739 continue; 5740 if (!IsFile(argv[x]) && !FindDirCnrByName(argv[x], FALSE)) 5741 OpenDirCnr((HWND) 0, hwndMain, hwndTree, TRUE, argv[x]); 5744 5742 } 5745 5743 } … … 5759 5757 hwndActive = TopWindow(hwnd, hwndTree); 5760 5758 if (hwndActive) 5761 WinSetWindowPos(hwndActive, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE);5759 WinSetWindowPos(hwndActive, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE); 5762 5760 } 5763 5761 if (fStartMinimized || fReminimize) … … 5792 5790 case WM_CONTROLPOINTER: 5793 5791 if (!fNoFinger && 5794 (SHORT1FROMMP(mp1) == IDM_OPENWALK ||5795 SHORT1FROMMP(mp1) == IDM_USERLIST))5792 (SHORT1FROMMP(mp1) == IDM_OPENWALK || 5793 SHORT1FROMMP(mp1) == IDM_USERLIST)) 5796 5794 return MRFROMLONG(hptrFinger); 5797 5795 break; … … 5833 5831 if (mp1) { 5834 5832 if (fUserComboBox) 5835 WinSetWindowText(WinWindowFromID(hwndUserlist, CBID_EDIT),5836 (CHAR *)mp1);5833 WinSetWindowText(WinWindowFromID(hwndUserlist, CBID_EDIT), 5834 (CHAR *)mp1); 5837 5835 if (add_udir(FALSE, (CHAR *)mp1)) { 5838 if (fUserComboBox && fAutoAddDirs) {5839 WinSendMsg(hwndUserlist, LM_INSERTITEM,5840 MPFROM2SHORT(LIT_SORTASCENDING, 0),5841 MPFROMP((CHAR *)mp1));5842 }5836 if (fUserComboBox && fAutoAddDirs) { 5837 WinSendMsg(hwndUserlist, LM_INSERTITEM, 5838 MPFROM2SHORT(LIT_SORTASCENDING, 0), 5839 MPFROMP((CHAR *)mp1)); 5840 } 5843 5841 } 5844 5842 } … … 5872 5870 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); 5873 5871 if (!(swp.fl & (SWP_HIDE | SWP_MINIMIZE))) { 5874 WinStoreWindowPos(FM2Str,5875 "MainWindowPos", WinQueryWindow(hwnd, QW_PARENT));5876 if (!fNoSaveState && fSaveState)5877 SaveDirCnrState(hwnd, GetPString(IDS_SHUTDOWNSTATE));5872 WinStoreWindowPos(FM2Str, 5873 "MainWindowPos", WinQueryWindow(hwnd, QW_PARENT)); 5874 if (!fNoSaveState && fSaveState) 5875 SaveDirCnrState(hwnd, GetPString(IDS_SHUTDOWNSTATE)); 5878 5876 } 5879 5877 } … … 5885 5883 case 1: 5886 5884 { 5887 HWND hwndCurrent;5888 ULONG wmsg;5889 5890 wmsg = (SHORT1FROMMP(mp1) == 0) ? UM_FILESMENU : UM_VIEWSMENU;5891 hwndCurrent = TopWindow(hwnd, (HWND) 0);5892 PortholeInit((HWND) WinSendMsg(WinWindowFromID(hwndCurrent,5893 FID_CLIENT), wmsg,5894 MPVOID, MPVOID), mp1, mp2);5885 HWND hwndCurrent; 5886 ULONG wmsg; 5887 5888 wmsg = (SHORT1FROMMP(mp1) == 0) ? UM_FILESMENU : UM_VIEWSMENU; 5889 hwndCurrent = TopWindow(hwnd, (HWND) 0); 5890 PortholeInit((HWND) WinSendMsg(WinWindowFromID(hwndCurrent, 5891 FID_CLIENT), wmsg, 5892 MPVOID, MPVOID), mp1, mp2); 5895 5893 } 5896 5894 break; … … 5910 5908 */ 5911 5909 { 5912 HWND hwndMenu, hwndSubMenu;5913 MENUITEM mi;5914 5915 hwndMenu = WinQueryWindowULong(hwnd, QWL_USER);5916 memset(&mi, 0, sizeof(mi));5917 mi.iPosition = MIT_END;5918 mi.afStyle = MIS_TEXT;5919 if (!WinSendMsg(hwndMenu, MM_QUERYITEM,5920 MPFROM2SHORT(IDM_WINDOWSMENU, TRUE), MPFROMP(&mi)))5921 break;5922 hwndSubMenu = mi.hwndSubMenu;5923 SetupWinList(hwndSubMenu, hwnd, WinQueryWindow(hwnd, QW_PARENT));5910 HWND hwndMenu, hwndSubMenu; 5911 MENUITEM mi; 5912 5913 hwndMenu = WinQueryWindowULong(hwnd, QWL_USER); 5914 memset(&mi, 0, sizeof(mi)); 5915 mi.iPosition = MIT_END; 5916 mi.afStyle = MIS_TEXT; 5917 if (!WinSendMsg(hwndMenu, MM_QUERYITEM, 5918 MPFROM2SHORT(IDM_WINDOWSMENU, TRUE), MPFROMP(&mi))) 5919 break; 5920 hwndSubMenu = mi.hwndSubMenu; 5921 SetupWinList(hwndSubMenu, hwnd, WinQueryWindow(hwnd, QW_PARENT)); 5924 5922 } 5925 5923 break; … … 5927 5925 default: 5928 5926 { 5929 HWND hwndCurrent;5930 5931 hwndCurrent = TopWindow(hwnd, (HWND) 0);5932 if (hwndCurrent)5933 WinSendMsg(hwndCurrent, UM_INITMENU, mp1, mp2);5927 HWND hwndCurrent; 5928 5929 hwndCurrent = TopWindow(hwnd, (HWND) 0); 5930 if (hwndCurrent) 5931 WinSendMsg(hwndCurrent, UM_INITMENU, mp1, mp2); 5934 5932 } 5935 5933 break; … … 5939 5937 case UM_ADDTOMENU: 5940 5938 AddToMenu((CHAR *)mp1, WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 5941 FID_MENU));5939 FID_MENU)); 5942 5940 return 0; 5943 5941 … … 5952 5950 info = cmdhead; 5953 5951 while (info) { 5954 WinSendMsg(hwndCmdlist, LM_INSERTITEM,5955 MPFROM2SHORT(LIT_END, 0), MPFROMP(info->title));5956 info = info->next;5952 WinSendMsg(hwndCmdlist, LM_INSERTITEM, 5953 MPFROM2SHORT(LIT_END, 0), MPFROMP(info->title)); 5954 info = info->next; 5957 5955 } 5958 5956 } … … 5978 5976 ulSearchCount = 1; 5979 5977 if (!DosFindFirst("*.TLS", &hDir, FILE_READONLY | FILE_ARCHIVED, 5980 &findbuf, sizeof(FILEFINDBUF3),5981 &ulSearchCount, FIL_STANDARD)) {5982 do {5983 priority_bumped();5984 if (!foundit) {5985 thisone = FALSE;5986 p = strrchr(lasttoolbox, '\\');5987 if (!p)5988 p = lasttoolbox;5989 else5990 p++;5991 if (!stricmp(findbuf.achName, p))5992 thisone = TRUE;5993 }5994 p = strrchr(findbuf.achName, '.');5995 if (p)5996 *p = 0;5997 sSelect = (SHORT) WinSendMsg(hwndButtonlist, LM_INSERTITEM,5998 MPFROM2SHORT(LIT_SORTASCENDING, 0),5999 MPFROMP(findbuf.achName));6000 if (!foundit && thisone && sSelect >= 0) {6001 WinSendMsg(hwndButtonlist, LM_SELECTITEM,6002 MPFROM2SHORT(sSelect, 0), MPFROMLONG(TRUE));6003 foundit = TRUE;6004 }6005 }6006 while (!DosFindNext(hDir, &findbuf, sizeof(FILEFINDBUF3),6007 &ulSearchCount));6008 DosFindClose(hDir);6009 priority_bumped();5978 &findbuf, sizeof(FILEFINDBUF3), 5979 &ulSearchCount, FIL_STANDARD)) { 5980 do { 5981 priority_bumped(); 5982 if (!foundit) { 5983 thisone = FALSE; 5984 p = strrchr(lasttoolbox, '\\'); 5985 if (!p) 5986 p = lasttoolbox; 5987 else 5988 p++; 5989 if (!stricmp(findbuf.achName, p)) 5990 thisone = TRUE; 5991 } 5992 p = strrchr(findbuf.achName, '.'); 5993 if (p) 5994 *p = 0; 5995 sSelect = (SHORT) WinSendMsg(hwndButtonlist, LM_INSERTITEM, 5996 MPFROM2SHORT(LIT_SORTASCENDING, 0), 5997 MPFROMP(findbuf.achName)); 5998 if (!foundit && thisone && sSelect >= 0) { 5999 WinSendMsg(hwndButtonlist, LM_SELECTITEM, 6000 MPFROM2SHORT(sSelect, 0), MPFROMLONG(TRUE)); 6001 foundit = TRUE; 6002 } 6003 } 6004 while (!DosFindNext(hDir, &findbuf, sizeof(FILEFINDBUF3), 6005 &ulSearchCount)); 6006 DosFindClose(hDir); 6007 priority_bumped(); 6010 6008 } 6011 6009 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBOXTEXT)); … … 6026 6024 6027 6025 if (!loadedudirs) 6028 load_udirs();6026 load_udirs(); 6029 6027 DosError(FERR_DISABLEHARDERR); 6030 6028 DosQCurDisk(&ulDriveNum, &ulDriveMap); 6031 6029 info = udirhead; 6032 6030 while (info) { 6033 if (IsFullName(info->path) &&6034 !(driveflags[toupper(*info->path) - 'A'] &6035 (DRIVE_IGNORE | DRIVE_INVALID))) {6036 DosError(FERR_DISABLEHARDERR);6037 hDir = HDIR_CREATE;6038 ulSearchCount = 1;6039 if (!IsRoot(info->path))6040 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY |6041 MUST_HAVE_DIRECTORY | FILE_READONLY |6042 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,6043 &findbuf, sizeof(FILEFINDBUF3),6044 &ulSearchCount, FIL_STANDARD);6045 else {6046 rc = 0;6047 findbuf.attrFile = FILE_DIRECTORY;6048 }6049 priority_bumped();6050 if (!rc) {6051 if (!IsRoot(info->path))6052 DosFindClose(hDir);6053 if (findbuf.attrFile & FILE_DIRECTORY)6054 WinSendMsg(hwndUserlist, LM_INSERTITEM,6055 MPFROM2SHORT(LIT_SORTASCENDING, 0),6056 MPFROMP(info->path));6057 else {6058 temp = info->next;6059 remove_udir(info->path);6060 info = temp;6061 continue;6062 }6063 }6064 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) {6065 temp = info->next;6066 remove_udir(info->path);6067 info = temp;6068 continue;6069 }6070 }6071 info = info->next;6031 if (IsFullName(info->path) && 6032 !(driveflags[toupper(*info->path) - 'A'] & 6033 (DRIVE_IGNORE | DRIVE_INVALID))) { 6034 DosError(FERR_DISABLEHARDERR); 6035 hDir = HDIR_CREATE; 6036 ulSearchCount = 1; 6037 if (!IsRoot(info->path)) 6038 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY | 6039 MUST_HAVE_DIRECTORY | FILE_READONLY | 6040 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN, 6041 &findbuf, sizeof(FILEFINDBUF3), 6042 &ulSearchCount, FIL_STANDARD); 6043 else { 6044 rc = 0; 6045 findbuf.attrFile = FILE_DIRECTORY; 6046 } 6047 priority_bumped(); 6048 if (!rc) { 6049 if (!IsRoot(info->path)) 6050 DosFindClose(hDir); 6051 if (findbuf.attrFile & FILE_DIRECTORY) 6052 WinSendMsg(hwndUserlist, LM_INSERTITEM, 6053 MPFROM2SHORT(LIT_SORTASCENDING, 0), 6054 MPFROMP(info->path)); 6055 else { 6056 temp = info->next; 6057 remove_udir(info->path); 6058 info = temp; 6059 continue; 6060 } 6061 } 6062 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) { 6063 temp = info->next; 6064 remove_udir(info->path); 6065 info = temp; 6066 continue; 6067 } 6068 } 6069 info = info->next; 6072 6070 } 6073 6071 info = ldirhead; 6074 6072 while (info) { 6075 if (IsFullName(info->path) &&6076 !(driveflags[toupper(*info->path) - 'A'] &6077 (DRIVE_IGNORE | DRIVE_INVALID))) {6078 DosError(FERR_DISABLEHARDERR);6079 hDir = HDIR_CREATE;6080 ulSearchCount = 1;6081 if (!IsRoot(info->path))6082 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY |6083 MUST_HAVE_DIRECTORY | FILE_READONLY |6084 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN,6085 &findbuf, sizeof(FILEFINDBUF3),6086 &ulSearchCount, FIL_STANDARD);6087 else {6088 rc = 0;6089 findbuf.attrFile = FILE_DIRECTORY;6090 }6091 priority_bumped();6092 if (!rc) {6093 if (!IsRoot(info->path))6094 DosFindClose(hDir);6095 if (findbuf.attrFile & FILE_DIRECTORY)6096 WinSendMsg(hwndUserlist, LM_INSERTITEM,6097 MPFROM2SHORT(LIT_SORTASCENDING, 0),6098 MPFROMP(info->path));6099 else {6100 temp = info->next;6101 remove_udir(info->path);6102 info = temp;6103 continue;6104 }6105 }6106 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) {6107 temp = info->next;6108 remove_udir(info->path);6109 info = temp;6110 continue;6111 }6112 }6113 info = info->next;6073 if (IsFullName(info->path) && 6074 !(driveflags[toupper(*info->path) - 'A'] & 6075 (DRIVE_IGNORE | DRIVE_INVALID))) { 6076 DosError(FERR_DISABLEHARDERR); 6077 hDir = HDIR_CREATE; 6078 ulSearchCount = 1; 6079 if (!IsRoot(info->path)) 6080 rc = DosFindFirst(info->path, &hDir, FILE_DIRECTORY | 6081 MUST_HAVE_DIRECTORY | FILE_READONLY | 6082 FILE_ARCHIVED | FILE_SYSTEM | FILE_HIDDEN, 6083 &findbuf, sizeof(FILEFINDBUF3), 6084 &ulSearchCount, FIL_STANDARD); 6085 else { 6086 rc = 0; 6087 findbuf.attrFile = FILE_DIRECTORY; 6088 } 6089 priority_bumped(); 6090 if (!rc) { 6091 if (!IsRoot(info->path)) 6092 DosFindClose(hDir); 6093 if (findbuf.attrFile & FILE_DIRECTORY) 6094 WinSendMsg(hwndUserlist, LM_INSERTITEM, 6095 MPFROM2SHORT(LIT_SORTASCENDING, 0), 6096 MPFROMP(info->path)); 6097 else { 6098 temp = info->next; 6099 remove_udir(info->path); 6100 info = temp; 6101 continue; 6102 } 6103 } 6104 else if (!(ulDriveMap & (1 << (toupper(*info->path) - 'A')))) { 6105 temp = info->next; 6106 remove_udir(info->path); 6107 info = temp; 6108 continue; 6109 } 6110 } 6111 info = info->next; 6114 6112 } 6115 6113 WinSendMsg(hwndUserlist, LM_INSERTITEM, 6116 MPFROM2SHORT(0, 0),6117 MPFROMP(GetPString(IDS_NEWDIRECTORYTEXT)));6114 MPFROM2SHORT(0, 0), 6115 MPFROMP(GetPString(IDS_NEWDIRECTORYTEXT))); 6118 6116 WinSetWindowText(hwndUserlist, GetPString(IDS_COMMONDIRTEXT)); 6119 6117 } … … 6129 6127 case WM_SIZE: 6130 6128 ResizeChildren(hwnd, SHORT1FROMMP(mp1), SHORT2FROMMP(mp1), 6131 SHORT1FROMMP(mp2), SHORT2FROMMP(mp2));6129 SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)); 6132 6130 break; 6133 6131 … … 6143 6141 hps = WinBeginPaint(hwnd, (HPS) 0, NULL); 6144 6142 if (hps) { 6145 WinQueryWindowRect(hwnd, &rcl);6146 WinFillRect(hps, &rcl, CLR_PALEGRAY);6147 WinEndPaint(hps);6143 WinQueryWindowRect(hwnd, &rcl); 6144 WinFillRect(hps, &rcl, CLR_PALEGRAY); 6145 WinEndPaint(hps); 6148 6146 } 6149 6147 } … … 6159 6157 switch (SHORT2FROMMP(mp1)) { 6160 6158 case CBN_ENTER: 6161 {6162 HWND hwndUL = WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),6163 SHORT1FROMMP(mp1));6164 CHAR path[CCHMAXPATH];6165 ULONG ul;6166 6167 switch (SHORT1FROMMP(mp1)) {6168 case MAIN_USERLIST:6169 ul = CCHMAXPATH;6170 break;6171 case MAIN_SETUPLIST:6172 ul = STATE_NAME_MAX_BYTES;6173 break;6174 default:6175 ul = 13; // fixme to not be hardcoded6176 }6177 6178 SetShiftState();6179 WinQueryWindowText(WinWindowFromID(hwndUL, CBID_EDIT), ul, path);6180 bstrip(path);6181 if (*path) {6182 if (SHORT1FROMMP(mp1) == MAIN_USERLIST) {6183 if (!strcmp(path, GetPString(IDS_NEWDIRECTORYTEXT))) {6184 if (!LastDir ||6185 !WinSendMsg(WinQueryWindow(LastDir, QW_PARENT),6186 UM_CONTAINERDIR, MPFROMP(path), MPVOID))6187 save_dir2(path);6188 if (!PMMkDir(hwnd, path, TRUE)) {6189 WinSetWindowText(hwndUL, GetPString(IDS_COMMONDIRTEXT));6190 break;6191 }6192 }6193 if (!IsFile(path) && !FindDirCnrByName(path, TRUE)) {6194 6195 HWND hwndDir;6196 6197 if ((fUserListSwitches &&6198 !(shiftstate & KC_SHIFT)) ||6199 (!fUserListSwitches && (shiftstate & KC_SHIFT))) {6200 hwndDir = FindDirCnr(hwnd);6201 if (hwndDir) {6202 WinSendMsg(LastDir, UM_SETDIR, MPFROMP(path), MPVOID);6203 break;6204 }6205 }6206 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, path);6207 }6208 }6209 else if (SHORT1FROMMP(mp1) == MAIN_DRIVELIST) {6210 ShowTreeRec(WinWindowFromID(WinWindowFromID(hwndTree,6211 FID_CLIENT),6212 TREE_CNR), path, FALSE, TRUE);6213 WinSetFocus(HWND_DESKTOP, hwndTree);6214 }6215 else if (SHORT1FROMMP(mp1) == MAIN_BUTTONLIST) {6216 strcat(path, ".TLS");6217 load_tools(path);6218 PrfWriteProfileString(fmprof,6219 FM3Str, "LastToolBox", lasttoolbox);6220 BuildTools(hwndToolback, TRUE);6221 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBOXTEXT));6222 }6223 else if (SHORT1FROMMP(mp1) == MAIN_SETUPLIST) {6224 CHAR szKey[80];6225 ULONG size, numsaves = 0;6226 6227 SetShiftState();6228 size = sizeof(ULONG);6229 sprintf(szKey, "%s.NumDirsLastTime", path); // path is state name6230 if (!PrfQueryProfileData(fmprof,6231 FM3Str,6232 szKey,6233 (PVOID)&numsaves,6234 &size))6235 {6236 if ((WinGetLastError(WinQueryAnchorBlock(hwnd)) & 0xffff) == PMERR_NOT_IN_IDX) {6237 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd,6238 GetPString(IDS_WARNINGTEXT),6239 GetPString(IDS_DOESNTEXISTTEXT), path);6240 }6241 else {6242 Win_Error2(hwnd, hwnd, __FILE__, __LINE__,6243 IDS_PRFQUERYPROFILEDATA);6244 }6245 }6246 else if (!numsaves)6247 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);6248 else {6249 char *pszStateName;6250 if ((shiftstate & KC_SHIFT) == 0)6251 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2));6252 pszStateName = xstrdup(path, pszSrcFile, __LINE__);6253 if (!pszStateName) {6254 // Fall back if out of memory - already complained6255 if ((shiftstate & KC_SHIFT) != 0 || fAutoTile) {6256 // Autotile requested or forced6257 PostMsg(MainObjectHwnd,6258 UM_RESTORE,6259 MPVOID,6260 MPFROMLONG(1));// Autotile6261 }6262 }6263 else if (!PostMsg(MainObjectHwnd,6264 UM_RESTORE,6265 MPFROMP(pszStateName),6266 MPVOID)) {6267 xfree(pszStateName, pszSrcFile, __LINE__);6268 }6269 }6270 }6271 else if (SHORT1FROMMP(mp1) == MAIN_CMDLIST) {6272 6273 SHORT sSelect;6274 6275 sSelect = (SHORT) WinSendMsg(hwndCmdlist,6276 LM_QUERYSELECTION,6277 MPFROMSHORT(LIT_FIRST), MPVOID);6278 if (sSelect >= 0)6279 WinPostMsg(hwnd,6280 WM_COMMAND,6281 MPFROM2SHORT(IDM_COMMANDSTART + sSelect, 0),6282 MPVOID);6283 WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT));6284 }6285 }6286 }6287 break;6159 { 6160 HWND hwndUL = WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), 6161 SHORT1FROMMP(mp1)); 6162 CHAR path[CCHMAXPATH]; 6163 ULONG ul; 6164 6165 switch (SHORT1FROMMP(mp1)) { 6166 case MAIN_USERLIST: 6167 ul = CCHMAXPATH; 6168 break; 6169 case MAIN_SETUPLIST: 6170 ul = STATE_NAME_MAX_BYTES; 6171 break; 6172 default: 6173 ul = 13; // fixme to not be hardcoded 6174 } 6175 6176 SetShiftState(); 6177 WinQueryWindowText(WinWindowFromID(hwndUL, CBID_EDIT), ul, path); 6178 bstrip(path); 6179 if (*path) { 6180 if (SHORT1FROMMP(mp1) == MAIN_USERLIST) { 6181 if (!strcmp(path, GetPString(IDS_NEWDIRECTORYTEXT))) { 6182 if (!LastDir || 6183 !WinSendMsg(WinQueryWindow(LastDir, QW_PARENT), 6184 UM_CONTAINERDIR, MPFROMP(path), MPVOID)) 6185 save_dir2(path); 6186 if (!PMMkDir(hwnd, path, TRUE)) { 6187 WinSetWindowText(hwndUL, GetPString(IDS_COMMONDIRTEXT)); 6188 break; 6189 } 6190 } 6191 if (!IsFile(path) && !FindDirCnrByName(path, TRUE)) { 6192 6193 HWND hwndDir; 6194 6195 if ((fUserListSwitches && 6196 !(shiftstate & KC_SHIFT)) || 6197 (!fUserListSwitches && (shiftstate & KC_SHIFT))) { 6198 hwndDir = FindDirCnr(hwnd); 6199 if (hwndDir) { 6200 WinSendMsg(LastDir, UM_SETDIR, MPFROMP(path), MPVOID); 6201 break; 6202 } 6203 } 6204 OpenDirCnr((HWND) 0, hwndMain, hwndTree, FALSE, path); 6205 } 6206 } 6207 else if (SHORT1FROMMP(mp1) == MAIN_DRIVELIST) { 6208 ShowTreeRec(WinWindowFromID(WinWindowFromID(hwndTree, 6209 FID_CLIENT), 6210 TREE_CNR), path, FALSE, TRUE); 6211 WinSetFocus(HWND_DESKTOP, hwndTree); 6212 } 6213 else if (SHORT1FROMMP(mp1) == MAIN_BUTTONLIST) { 6214 strcat(path, ".TLS"); 6215 load_tools(path); 6216 PrfWriteProfileString(fmprof, 6217 FM3Str, "LastToolBox", lasttoolbox); 6218 BuildTools(hwndToolback, TRUE); 6219 WinSetWindowText(hwndButtonlist, GetPString(IDS_TOOLBOXTEXT)); 6220 } 6221 else if (SHORT1FROMMP(mp1) == MAIN_SETUPLIST) { 6222 CHAR szKey[80]; 6223 ULONG size, numsaves = 0; 6224 6225 SetShiftState(); 6226 size = sizeof(ULONG); 6227 sprintf(szKey, "%s.NumDirsLastTime", path); // path is state name 6228 if (!PrfQueryProfileData(fmprof, 6229 FM3Str, 6230 szKey, 6231 (PVOID)&numsaves, 6232 &size)) 6233 { 6234 if ((WinGetLastError(WinQueryAnchorBlock(hwnd)) & 0xffff) == PMERR_NOT_IN_IDX) { 6235 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 6236 GetPString(IDS_WARNINGTEXT), 6237 GetPString(IDS_DOESNTEXISTTEXT), path); 6238 } 6239 else { 6240 Win_Error2(hwnd, hwnd, __FILE__, __LINE__, 6241 IDS_PRFQUERYPROFILEDATA); 6242 } 6243 } 6244 else if (!numsaves) 6245 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); 6246 else { 6247 char *pszStateName; 6248 if ((shiftstate & KC_SHIFT) == 0) 6249 PostMsg(MainObjectHwnd, UM_RESTORE, MPVOID, MPFROMLONG(2)); 6250 pszStateName = xstrdup(path, pszSrcFile, __LINE__); 6251 if (!pszStateName) { 6252 // Fall back if out of memory - already complained 6253 if ((shiftstate & KC_SHIFT) != 0 || fAutoTile) { 6254 // Autotile requested or forced 6255 PostMsg(MainObjectHwnd, 6256 UM_RESTORE, 6257 MPVOID, 6258 MPFROMLONG(1)); // Autotile 6259 } 6260 } 6261 else if (!PostMsg(MainObjectHwnd, 6262 UM_RESTORE, 6263 MPFROMP(pszStateName), 6264 MPVOID)) { 6265 xfree(pszStateName, pszSrcFile, __LINE__); 6266 } 6267 } 6268 } 6269 else if (SHORT1FROMMP(mp1) == MAIN_CMDLIST) { 6270 6271 SHORT sSelect; 6272 6273 sSelect = (SHORT) WinSendMsg(hwndCmdlist, 6274 LM_QUERYSELECTION, 6275 MPFROMSHORT(LIT_FIRST), MPVOID); 6276 if (sSelect >= 0) 6277 WinPostMsg(hwnd, 6278 WM_COMMAND, 6279 MPFROM2SHORT(IDM_COMMANDSTART + sSelect, 0), 6280 MPVOID); 6281 WinSetWindowText(hwndCmdlist, GetPString(IDS_COMMANDSTEXT)); 6282 } 6283 } 6284 } 6285 break; 6288 6286 6289 6287 default: 6290 break;6288 break; 6291 6289 } 6292 6290 break; … … 6308 6306 case WM_CLOSE: 6309 6307 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 6310 WM_SYSCOMMAND, MPFROM2SHORT(SC_RESTORE, 0), MPVOID);6308 WM_SYSCOMMAND, MPFROM2SHORT(SC_RESTORE, 0), MPVOID); 6311 6309 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID); 6312 6310 fAmClosing = TRUE; 6313 6311 WinSendMsg(WinQueryWindow(hwnd, QW_PARENT), 6314 WM_SYSCOMMAND, MPFROM2SHORT(SC_MINIMIZE, 0), MPVOID);6312 WM_SYSCOMMAND, MPFROM2SHORT(SC_MINIMIZE, 0), MPVOID); 6315 6313 if (CloseChildren(hwnd)) { 6316 6314 fAmClosing = FALSE; 6317 6315 if (fAutoTile) 6318 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TILE, 0), MPVOID);6316 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TILE, 0), MPVOID); 6319 6317 return 0; 6320 6318 } 6321 6319 if (hwndTree) { 6322 6320 if (!PostMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID)) 6323 WinSendMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID);6321 WinSendMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID); 6324 6322 } 6325 6323 DosSleep(1); … … 6335 6333 // Try to restore saved shutdown state 6336 6334 char *pszDefaultStateName = xstrdup(GetPString(IDS_SHUTDOWNSTATE), 6337 pszSrcFile, __LINE__);6335 pszSrcFile, __LINE__); 6338 6336 if (pszDefaultStateName) { 6339 if (!PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszDefaultStateName), MPVOID))6340 // 05 Feb 08 SHL fixme to complain?6341 xfree(pszDefaultStateName, pszSrcFile, __LINE__);6337 if (!PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszDefaultStateName), MPVOID)) 6338 // 05 Feb 08 SHL fixme to complain? 6339 xfree(pszDefaultStateName, pszSrcFile, __LINE__); 6342 6340 } 6343 6341 } … … 6348 6346 if (mp1) 6349 6347 return MRFROMLONG(OpenDirCnr((HWND) 0, 6350 hwndMain,6351 hwndTree, (BOOL) mp2, (char *)mp1));6348 hwndMain, 6349 hwndTree, (BOOL) mp2, (char *)mp1)); 6352 6350 return 0; 6353 6351 -
trunk/dll/walkem.c
r1025 r1027 27 27 29 Feb 08 GKY Use xfree where appropriate 28 28 29 Feb 08 GKY Refactor global command line variables to notebook.h 29 19 Jun 08 JBS Ticket 227: Allow temporary saving/deleting of the shutdown state of directory containers 29 30 30 31 ***********************************************************************/ … … 93 94 MPFROMP(pld->path)); 94 95 } 95 // if (fSaveState) {96 // WinSendMsg(hwndStatelist,97 // LM_INSERTITEM,98 // MPFROM2SHORT(LIT_SORTASCENDING, 0),99 // MPFROMP(GetPString(IDS_SHUTDOWNSTATE)));100 // }101 96 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 102 97 }
Note:
See TracChangeset
for help on using the changeset viewer.
