Changeset 1891 for trunk/dll/comp.c
- Timestamp:
- Jan 31, 2020, 3:47:37 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/comp.c
r1878 r1891 6 6 Compare directories 7 7 8 Copyright (c) 1993- 02 M. Kimes9 Copyright (c) 2003 , 2013Steven H. Levine8 Copyright (c) 1993-2002 M. Kimes 9 Copyright (c) 2003-2020 Steven H. Levine 10 10 11 11 16 Oct 02 MK Baseline … … 89 89 09 Mar 13 SHL SetButtonEnables: correct enable support for newish buttons 90 90 10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options 91 91 Added saymsg2 for this purpose 92 92 10 Mar 13 GKY Fixes to snapshot file. 93 93 14 Jun 15 GKY Changes to prvenet access violations when cmp is freed 94 28 Jan 20 SHL ActionCnrThread: report CM_INVALIDATERECORD failures 94 95 95 96 ***********************************************************************/ … … 150 151 #include "excputil.h" // xbeginthread 151 152 #include "info.h" // driveflags 152 #include "worker.h" 153 #include "rename.h" 153 #include "worker.h" // MOVEIT 154 #include "rename.h" // RenameProc 154 155 155 156 typedef struct … … 177 178 HDIR hdir = HDIR_CREATE; 178 179 ULONG ulFindCnt; 179 // CHAR szDate[DATE_BUF_BYTES];180 181 // 13 Aug 07 SHL fixmeto use FileToGet180 // CHAR szDate[DATE_BUF_BYTES]; 181 182 // 13 Aug 07 SHL FIXME to use FileToGet 182 183 pffb = xmalloc(sizeof(FILEFINDBUF4L), pszSrcFile, __LINE__); 183 184 if (pffb) { … … 188 189 enddir++; 189 190 ulFindCnt = 1; 190 // 13 Aug 07 SHL fixmeto report errors191 // 13 Aug 07 SHL FIXME to report errors 191 192 if (!xDosFindFirst(mask, 192 193 &hdir, … … 198 199 strcpy(enddir, pffb->achName); 199 200 if (!(pffb->attrFile & FILE_DIRECTORY)) { 200 // FDateFormat(szDate, pffb->fdateLastWrite);201 // FDateFormat(szDate, pffb->fdateLastWrite); 201 202 fprintf(fp, 202 203 "\"%s\",%u,%llu,%lu/%lu/%lu,%02u:%02u:%02u,%lu,%lu,N\n", 203 204 mask, 204 205 enddir - mask, 205 206 207 208 206 pffb->cbFile, 207 pffb->fdateLastWrite.year + 1980, 208 pffb->fdateLastWrite.month, 209 pffb->fdateLastWrite.day, 209 210 pffb->ftimeLastWrite.hours, 210 211 pffb->ftimeLastWrite.minutes, … … 572 573 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 573 574 pciD = WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPVOID, 574 575 fConfirmAction = 575 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 576 fConfirmAction = WinQueryButtonCheckstate(cmp->hwnd, COMP_CONFIRMACTION); 576 577 InitITimer(&itdSleep, 500); // Sleep every 500 mSec 577 578 … … 595 596 case IDM_DELETE: 596 597 597 if (fConfirmAction && !dontask) { 598 rc = saymsg2(NULL, 0, cmp->hwnd, GetPString(IDS_CONFIRMDELETE), GetPString(IDS_DOYOUWISHTODELETE), 599 pciS->pszFileName); 600 if (rc == 3 || rc == 4) { 601 if (rc == 4) 602 enddelete = TRUE; 603 break; 604 } 605 else if (rc == 2) 606 dontask = TRUE; 607 } 598 if (fConfirmAction && !dontask) { 599 rc = saymsg2(NULL, 0, cmp->hwnd, GetPString(IDS_CONFIRMDELETE), GetPString(IDS_DOYOUWISHTODELETE), 600 pciS->pszFileName); 601 if (rc == 3 || rc == 4) { 602 if (rc == 4) 603 enddelete = TRUE; 604 break; 605 } 606 else if (rc == 2) 607 dontask = TRUE; 608 } 609 608 610 if (!unlinkf(pciS->pszFileName)) { 609 611 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciS), … … 612 614 if (!*pciD->pszFileName) { 613 615 // Other side is blank - remove from both sides 616 617 # ifdef PMPRINTF 618 PmPrintf_Report(pszSrcFile, __LINE__, "ActionCnrThread RemoveCnrItems pciS %p", pciS); 619 # endif 620 614 621 RemoveCnrItems(hwndCnrS, pciS, 1, CMA_FREE | CMA_INVALIDATE); 615 622 if (pciD->rc.flRecordAttr & CRA_SELECTED) 616 623 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciD), 617 624 MPFROM2SHORT(FALSE, CRA_SELECTED)); 625 626 # ifdef PMPRINTF 627 PmPrintf_Report(pszSrcFile, __LINE__, "ActionCnrThread RemoveCnrItems pciD %p", pciD); 628 # endif 629 618 630 RemoveCnrItems(hwndCnrD, pciD, 1, CMA_FREE | CMA_INVALIDATE); 619 631 } 620 632 else { 621 633 // Other side is not blank - blank just this side 634 635 # ifdef PMPRINTF 636 PmPrintf_Report(pszSrcFile, __LINE__, "ActionCnrThread FreeCnrItemData pciS %p", pciS); 637 # endif 638 622 639 FreeCnrItemData(pciS); 623 640 // 29 Aug 08 SHL Point pci fields at NullStr to sync with FreeCnrItemData mods … … 626 643 pciS->rc.pszIcon = pciS->pszFileName; 627 644 pciS->flags = 0; // Just on one side 628 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS), 629 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED)); 630 pciD->flags = 0; // Just on one side 631 if (pciD->pszSubject != NullStr) { 632 xfree(pciD->pszSubject, pszSrcFile, __LINE__); 633 pciD->pszSubject = NullStr; 634 } 635 } 645 if (!WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS), 646 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED))) { 647 Win_Error(hwndCnrS, cmp->hwnd, pszSrcFile, __LINE__, "CM_INVALIDATERECORD"); 648 } 649 650 pciD->flags = 0; // Just on one side 651 if (pciD->pszSubject != NullStr) { 652 xfree(pciD->pszSubject, pszSrcFile, __LINE__); 653 pciD->pszSubject = NullStr; 654 } 655 } 656 636 657 if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_LEFTDIR)) 637 658 cmp->cmp->totalleft--; … … 639 660 cmp->cmp->totalright--; 640 661 } 641 break; 662 break; // IDM_DELETE 642 663 643 664 case IDM_MOVE: … … 702 723 pciD->attrFile = pciS->attrFile; 703 724 pciD->pszDispAttr = pciS->pszDispAttr; 704 pciD->flags = 0; 725 pciD->flags = 0; // Just on one side 705 726 pciD->date = pciS->date; 706 727 pciD->time = pciS->time; … … 727 748 pciS->pszSubject = NullStr; 728 749 } 729 pciS->flags = 0; // Just on one side 730 731 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS), 732 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED)); 733 734 WinSendMsg(hwndCnrD, CM_INVALIDATERECORD, MPFROMP(&pciD), 735 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED)); 750 pciS->flags = 0; // Just on one side 751 752 if (!WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS), 753 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED))) { 754 Win_Error(hwndCnrS, cmp->hwnd, pszSrcFile, __LINE__, "CM_INVALIDATERECORD"); 755 } 756 757 if (!WinSendMsg(hwndCnrD, CM_INVALIDATERECORD, MPFROMP(&pciD), 758 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED))) { 759 Win_Error(hwndCnrD, cmp->hwnd, pszSrcFile, __LINE__, "CM_INVALIDATERECORD"); 760 } 736 761 737 762 if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_LEFTDIR)) … … 868 893 SleepIfNeeded(&itdSleep, 0); 869 894 } // while 895 870 896 WinPostMsg(cmp->hwnd, WM_TIMER, MPFROMLONG(ID_COMP_TIMER), 0); // Force update 871 897 Abort: … … 1077 1103 1078 1104 if (numD != x) { 1079 // Something out of sync - fixmeto document why slow logic needed1105 // Something out of sync - FIXME to document why slow logic needed 1080 1106 if (!slow) { 1081 1107 slow = TRUE; … … 1202 1228 else if (memcmp(buf1, buf2, numread1)) 1203 1229 break; 1204 } 1230 } // while 1205 1231 } // same len 1206 1232 } // if open ok … … 1315 1341 pciD = pciDa[x]; 1316 1342 CompSelectSetSelects(pciS, 1317 1318 1319 1320 1343 pciD, 1344 pciS->flags & CNRITEM_EASDIFFER, 1345 pciD->flags & CNRITEM_EASDIFFER, 1346 wantAnd); 1321 1347 } 1322 1348 SleepIfNeeded(&itdSleep, 0); … … 1596 1622 1597 1623 # ifdef FORTIFY 1598 // 10 May 08 SHL fixmeto suppress W1111624 // 10 May 08 SHL FIXME to suppress W111 1599 1625 Fortify_EnterScope(); 1600 1626 # endif … … 1603 1629 Runtime_Error(pszSrcFile, __LINE__, NULL); 1604 1630 # ifdef FORTIFY 1605 // 10 May 08 SHL fixmeto suppress W1111631 // 10 May 08 SHL FIXME to suppress W111 1606 1632 Fortify_LeaveScope(); 1607 1633 # endif … … 1648 1674 lenr++; 1649 1675 priority_normal(); 1650 // Clear containers 1676 // Clear containers in case restarting 1651 1677 RemoveCnrItems(hwndRight, NULL, 0, CMA_FREE | CMA_INVALIDATE); 1652 1678 RemoveCnrItems(hwndLeft, NULL, 0, CMA_FREE | CMA_INVALIDATE); … … 1678 1704 CHAR str[CCHMAXPATH * 2], *p; 1679 1705 CHAR *moder = "r"; 1680 1706 BOOL fFixedSnap = TRUE; 1681 1707 1682 1708 memset(&fb4, 0, sizeof(fb4)); … … 1744 1770 p = strchr(p, ','); 1745 1771 if (p) { 1746 1747 1748 1749 1750 1751 1752 1753 i =(strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 3 - p;1754 1755 for (q = szTemp;q = strchr(szTemp, ',');) {1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 p = strchr(p, '/') ?strchr(p, '/') : strchr(p, DateSeparator[0]);1777 1778 1779 1780 1781 1782 1783 p = strchr(p, '/') ? 1784 1785 1786 1787 1788 1789 1790 1791 1772 p++; 1773 if (((strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - strchr(p, ',')) > 5) { 1774 CHAR szTemp[30]; 1775 CHAR *q; 1776 int i; 1777 1778 memset(szTemp, 0, sizeof(szTemp)); 1779 i = (strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 3 - p; 1780 strncpy(&szTemp, p, i); 1781 for (q = szTemp; q = strchr(szTemp, ',');) { 1782 strcpy(q, q + 1); 1783 } 1784 fb4.cbFile = atoll(szTemp); 1785 fFixedSnap = FALSE; 1786 1787 } 1788 else 1789 fb4.cbFile = atoll(p); 1790 if (!strchr(p, '/')) 1791 fFixedSnap = FALSE; 1792 p = (strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 6; 1793 p = strchr(p, ','); 1794 if (p) { 1795 p++; 1796 if (ulDateFmt == 2 || ulDateFmt == 3 || fFixedSnap) 1797 fb4.fdateLastWrite.year = atol(p) - 1980; 1798 else if (ulDateFmt == 1) 1799 fb4.fdateLastWrite.day = atol(p); 1800 else 1801 fb4.fdateLastWrite.month = atol(p); 1802 p = strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0]); 1803 if (p) { 1804 p++; 1805 if (ulDateFmt == 2 || ulDateFmt == 1 || fFixedSnap) 1806 fb4.fdateLastWrite.month = atol(p); 1807 else 1808 fb4.fdateLastWrite.day = atol(p); 1809 p = strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0]); 1810 if (p) { 1811 p++; 1812 if (ulDateFmt == 2 || fFixedSnap) 1813 fb4.fdateLastWrite.day = atol(p); 1814 else if (ulDateFmt == 3) 1815 fb4.fdateLastWrite.month = atol(p); 1816 else 1817 fb4.fdateLastWrite.year = atol(p) - 1980; 1792 1818 p = strchr(p, ','); 1793 1819 if (p) { 1794 1820 p++; 1795 1821 fb4.ftimeLastWrite.hours = atol(p); 1796 p = strchr(p, ':') ?strchr(p, ':') : strchr(p, TimeSeparator[0]);1797 1822 p = strchr(p, ':') ? strchr(p, ':') : strchr(p, TimeSeparator[0]); 1823 if (p) { 1798 1824 p++; 1799 1825 fb4.ftimeLastWrite.minutes = atol(p); 1800 p = strchr(p, ':') ?strchr(p, ':') : strchr(p, TimeSeparator[0]);1801 1826 p = strchr(p, ':') ? strchr(p, ':') : strchr(p, TimeSeparator[0]); 1827 if (p) { 1802 1828 p++; 1803 1829 fb4.ftimeLastWrite.twosecs = atol(p); 1804 1830 p = strchr(p, ','); 1805 1831 if (p) { 1806 1832 p++; 1807 1833 fb4.attrFile = atol(p); 1808 1834 p = strchr(p, ','); 1809 1835 if (p) { 1810 1836 p++; 1811 1837 fb4.cbList = atol(p) * 2; … … 1813 1839 strupr(str + 1); 1814 1840 else if (fForceLower) 1815 1841 strlwr(str + 1); 1816 1842 if (AddToFileList((str + 1) + lenr, 1817 1843 &fb4, … … 1835 1861 } // while 1836 1862 } // if have rightdir 1837 1838 1839 1863 fclose(fp); 1864 if (!filesr) 1865 saymsg(MB_OK | MB_ICONASTERISK, HWND_DESKTOP, 1840 1866 GetPString(IDS_WARNINGTEXT), 1841 1867 GetPString(IDS_SNAPSHOTFILEBADFORMAT)); 1842 1843 1844 1845 1846 1868 } 1869 else 1870 saymsg(MB_OK | MB_ICONASTERISK, HWND_DESKTOP, 1871 GetPString(IDS_WARNINGTEXT), 1872 GetPString(IDS_SNAPSHOTFILELOADFAILED), cmp->rightlist); 1847 1873 } // if snapshot file 1848 1874 … … 1905 1931 while ((filesl && filesl[l]) || (filesr && filesr[r])) { 1906 1932 1907 ULONG ulRecsToInsert; // limited to USHRT_MAX1933 ULONG ulRecsToInsert; // limited to USHRT_MAX 1908 1934 1909 1935 if (cmp->stop) … … 1971 1997 pcil->pszDispAttr = FileAttrToString(pcil->attrFile); 1972 1998 pcil->cbFile = filesl[l]->cbFile; 1973 // 12 Jan 08 SHL fixmeto use cached size here too1999 // 12 Jan 08 SHL FIXME to use cached size here too 1974 2000 CommaFmtULL(szBuf, sizeof(szBuf), pcil->cbFile, ' '); 1975 2001 pcil->pszFmtFileSize = xstrdup(szBuf, pszSrcFile, __LINE__); … … 1992 2018 pcil->crtime.seconds = filesl[l]->crtime.twosecs * 2; 1993 2019 pcil->crtime.minutes = filesl[l]->crtime.minutes; 1994 1995 2020 pcil->crtime.hours = filesl[l]->crtime.hours; 2021 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 1996 2022 if (cmp && *cmp->dcd.mask.szMask) { 1997 2023 if (!Filter((PMINIRECORDCORE)pcil, (PVOID)&cmp->dcd.mask)) { 1998 2024 pcil->rc.flRecordAttr |= CRA_FILTERED; 1999 2025 pcir->rc.flRecordAttr |= CRA_FILTERED; 2000 2001 2002 2026 } 2027 } 2028 DosReleaseMutexSem(hmtxFiltering); 2003 2029 } // if on left 2004 2030 … … 2013 2039 pcir->pszDispAttr = FileAttrToString(pcir->attrFile); 2014 2040 pcir->cbFile = filesr[r]->cbFile; 2015 // 12 Jan 08 SHL fixmeto used cached size here too2041 // 12 Jan 08 SHL FIXME to used cached size here too 2016 2042 CommaFmtULL(szBuf, sizeof(szBuf), pcir->cbFile, ' '); 2017 2043 pcir->pszFmtFileSize = xstrdup(szBuf, pszSrcFile, __LINE__); … … 2035 2061 pcir->crtime.minutes = filesr[r]->crtime.minutes; 2036 2062 pcir->crtime.hours = filesr[r]->crtime.hours; 2037 2038 2063 // Bypass check if already filtered on left side 2064 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 2039 2065 if (cmp && ~pcir->rc.flRecordAttr & CRA_FILTERED && 2040 2066 *cmp->dcd.mask.szMask) { … … 2042 2068 pcil->rc.flRecordAttr |= CRA_FILTERED; 2043 2069 pcir->rc.flRecordAttr |= CRA_FILTERED; 2044 2045 2046 2070 } 2071 } 2072 DosReleaseMutexSem(hmtxFiltering); 2047 2073 } // if on right 2048 2074 … … 2181 2207 MPFROMP(pcirFirst), MPFROMP(&ri))) { 2182 2208 Win_Error(hwndRight, cmp->hwnd, pszSrcFile, __LINE__, "CM_INSERTRECORD"); 2183 // 2011-05-29 SHL fixme?2209 // 2011-05-29 SHL FIXME? 2184 2210 RemoveCnrItems(hwndLeft, NULL, 0, CMA_FREE | CMA_INVALIDATE); 2185 2211 FreeCnrItemList(hwndRight, pcirFirst); … … 2318 2344 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTONE), fEnable); 2319 2345 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTNEWER), fEnable); 2320 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTEAS), fEnable); 2346 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTEAS), fEnable); // 2013-03-09 SHL 2321 2347 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTOLDER), fEnable); 2322 2348 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTBIGGER), fEnable); … … 2325 2351 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTONE), fEnable); 2326 2352 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTNEWER), fEnable); 2327 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTEAS), fEnable); 2353 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTEAS), fEnable); // 2013-03-09 SHL 2328 2354 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTOLDER), fEnable); 2329 2355 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTBIGGER), fEnable); … … 2346 2372 WinEnableWindow(WinWindowFromID(hwnd, COMP_INCLUDESUBDIRS), fEnable); 2347 2373 WinEnableWindow(WinWindowFromID(hwnd, COMP_HIDENOTSELECTED), fEnable); 2348 WinEnableWindow(WinWindowFromID(hwnd, COMP_CONFIRMACTION), fEnable); 2374 WinEnableWindow(WinWindowFromID(hwnd, COMP_CONFIRMACTION), fEnable); // 2013-03-09 SHL 2349 2375 } 2350 2376 … … 2404 2430 { 2405 2431 USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT, 2406 2407 2408 2409 2410 2411 2432 COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT, 2433 COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU, 2434 COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT, 2435 COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT, 2436 COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR, 2437 COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0}; 2412 2438 UINT x; 2413 2439 CHAR s[24]; … … 2569 2595 pci = (PCNRITEM)pcown->pRecord; 2570 2596 // 01 Aug 07 SHL if field null or blank, we draw 2571 // fixmeto document why - probably to optimize and bypass draw?2597 // FIXME to document why - probably to optimize and bypass draw? 2572 2598 if (pci && (INT)pci != -1 && !*pci->pszFileName && pci->pszFileName != NullStr) 2573 2599 return MRFROMLONG(TRUE); … … 2728 2754 if (cmp) { 2729 2755 PCNRITEM pci = (PCNRITEM)mp2; 2730 USHORT id = COMP_CNRMENU; 2756 USHORT id = COMP_CNRMENU; // Assume container menu 2731 2757 2732 2758 if (cmp->dcd.hwndLastMenu) … … 2779 2805 case CN_BEGINEDIT: 2780 2806 case CN_REALLOCPSZ: 2781 // fixmeto be gone - field edits not allowed?2807 // FIXME to be gone - field edits not allowed? 2782 2808 Runtime_Error(pszSrcFile, __LINE__, 2783 2809 "CN_BEGINEDIT/CN_REALLOCPSZ unexpected"); … … 2871 2897 CA_DETAILSVIEWTITLES | CA_OWNERDRAW; 2872 2898 WinSendDlgItemMsg(hwnd, COMP_LEFTDIR, CM_SETCNRINFO, MPFROMP(&cnri), 2873 2899 MPFROMLONG(CMA_CNRTITLE | CMA_FLWINDOWATTR)); 2874 2900 WinSetDlgItemText(hwnd, COMP_LISTLOADED, ""); 2875 2901 cnri.pszCnrTitle = cmp->rightdir; … … 2999 3025 3000 3026 case WM_COMMAND: 3001 // 29 Apr 09 SHL fixmeto support more context menu items - IDM_VIEW, IDM_EDIT etc.3027 // 29 Apr 09 SHL FIXME to support more context menu items - IDM_VIEW, IDM_EDIT etc. 3002 3028 switch (SHORT1FROMMP(mp1)) { 3003 3029 case IDM_COMPARE: … … 3325 3351 ULONG size = sizeof(SWP); 3326 3352 USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT, 3327 3328 3329 3330 3331 3332 3353 COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT, 3354 COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU, 3355 COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT, 3356 COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT, 3357 COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR, 3358 COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0}; 3333 3359 UINT x; 3334 3360 CHAR s[24]; 3335 3361 WinQueryWindowPos(hwnd, &swp); 3336 3362 PrfWriteProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp, 3337 3363 size); 3338 3364 for (x = 0; ids[x]; x++) { 3339 3365 sprintf(s, "CompDir%i", ids[x]); … … 3348 3374 Runtime_Error(pszSrcFile, __LINE__, NULL); 3349 3375 else { 3350 cmp->stop = TRUE; 3376 cmp->stop = TRUE; // In case thread running 3351 3377 if (cmp->filling) 3352 break; 3378 break; // UM_CONTAINER_FILLED will dismiss 3353 3379 } 3354 3380 { … … 3387 3413 case IDM_SELECTSAME: // Name and size 3388 3414 case IDM_INVERT: 3389 3390 3391 3415 cmp = INSTDATA(hwnd); 3392 3416 if (!cmp) … … 3533 3557 cmp = INSTDATA(hwnd); 3534 3558 if (cmp) { 3535 // 17 Jan 08 SHL fixmeto know if stop really needed?3559 // 17 Jan 08 SHL FIXME to know if stop really needed? 3536 3560 WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_COMP_TIMER); 3537 3561 if (cmp->dcd.hwndLastMenu) … … 3547 3571 DosReleaseMutexSem(hmtxFiltering); 3548 3572 } 3573 3574 # ifdef PMPRINTF 3575 PmPrintf_Report(pszSrcFile, __LINE__, "CompareDlgProc EmptyCnr Left"); 3576 # endif 3549 3577 EmptyCnr(GetHwndLeft(hwnd)); 3578 3579 # ifdef PMPRINTF 3580 PmPrintf_Report(pszSrcFile, __LINE__, "CompareDlgProc EmptyCnr Right"); 3581 # endif 3550 3582 EmptyCnr(GetHwndRight(hwnd)); 3583 3551 3584 DosPostEventSem(CompactSem); 3552 3585 break;
Note:
See TracChangeset
for help on using the changeset viewer.