Changeset 1444 for trunk/dll/worker.c
- Timestamp:
- Jul 23, 2009, 1:24:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/worker.c
r1438 r1444 54 54 #define INCL_DOS 55 55 #define INCL_DOSERRORS 56 #define INCL_WINPROGRAMLIST 57 #define INCL_WINHELP 56 // #define INCL_WINPROGRAMLIST // 13 Jul 09 SHL dropped 57 // #define INCL_WINHELP // 13 Jul 09 SHL dropped 58 58 #define INCL_LONGLONG 59 #define INCL_WINPOINTERS 60 #define INCL_WINWORKPLACE 61 #define INCL_WINSHELLDATA 59 #define INCL_WINPOINTERS // WinSetFileIcon 60 // #define INCL_WINWORKPLACE // 13 Jul 09 SHL dropped 61 #define INCL_WINSHELLDATA // PrfQueryProfileData 62 #define INCL_WINTIMER // WinStarTimer 63 #define INCL_WININPUT // WinQueryFocus 62 64 63 65 #include "fm3dll.h" … … 103 105 #include "avl.h" // SBoxDlgProc 104 106 #include "subj.h" // Subject 107 #include "grep.h" // hwndStatus 105 108 #include "stristr.h" // stristr 106 109 #include "wrappers.h" // xfopen … … 195 198 INT plen = 0; 196 199 CHAR *p, *pp; 200 ULONG idTimerStarted = 0; 201 BOOL fActionPosted = FALSE; 202 HAB habForActions; 203 HWND hwndForActions; 197 204 CHAR szQuotedDirName[CCHMAXPATH]; 198 205 CHAR szQuotedFileName[CCHMAXPATH]; … … 216 223 IncrThreadUsage(); 217 224 *wildname = 0; 225 // Do action specific preprocessing 218 226 switch (wk->li->type) { 219 227 case IDM_MERGE: … … 322 330 break; 323 331 } 332 // Process each list item 324 333 if (wk->li && wk->li->list && wk->li->list[0]) { 334 // char ucClassname[8]; 335 if (hwndStatus) { 336 // Send update request to source window or container 337 // 13 Jul 09 SHL fixme to be sure we pick window that understand UM_ACTIONSTATE wk->dcd->hwndCnr? 338 // 13 Jul 09 SHL fixme to ensure focus window is one that understands UM_ACTIONSTATE 339 HWND hwndFocus = WinQueryFocus(HWND_DESKTOP); 340 DbgMsg(pszSrcFile, __LINE__, "hwndFocus %lx", hwndFocus); // 13 Jul 09 SHL fixme debug 341 DbgMsg(pszSrcFile, __LINE__, "hwndCnr %lx", wk->hwndCnr); // 13 Jul 09 SHL fixme debug 342 // DbgMsg(pszSrcFile, __LINE__, "hwndS %lx", wk->li->hwndS); // 13 Jul 09 SHL fixme debug 343 DbgMsg(pszSrcFile, __LINE__, "hwnd %lx", wk->li->hwnd); // 13 Jul 09 SHL fixme debug 344 // DbgMsg(pszSrcFile, __LINE__, "hwndParent %lx", wk->hwndParent); // 13 Jul 09 SHL fixme debug 345 // DbgMsg(pszSrcFile, __LINE__, "hwndClient %lx", wk->hwndClient); // 13 Jul 09 SHL fixme debug 346 // DbgMsg(pszSrcFile, __LINE__, "hwndFrame %lx", wk->hwndFrame); // 13 Jul 09 SHL fixme debug 347 // hwndForActions = wk->li->hwnd == hwndFocus ? hwndFocus : wk->hwndCnr; 348 hwndForActions = WinQueryFocus(HWND_DESKTOP); 349 #if 0 // 14 Jul 09 SHL fixme 350 hwndForActions = WinQueryFocus(HWND_DESKTOP); 351 if (WinQueryClassName(hwndForActions, sizeof(ucClassname), ucClassname)) { 352 // If not a container fall back to worker 353 if (strcmp(ucClassname, "#25")); 354 } 355 #endif 356 habForActions = WinQueryAnchorBlock(hwndForActions); 357 DbgMsg(pszSrcFile, __LINE__, "habForActions %lx hwndForActions %lx", habForActions, hwndForActions); // 13 Jul 09 SHL fixme debug 358 // Ask container window to update status line every 5 seconds in case action is time intensive 359 idTimerStarted = WinStartTimer(habForActions, hwndForActions, ID_ACTION_TIMER, 2000); // 13 Jul 09 SHL fixme 5 sec 360 } 325 361 for (x = 0; wk->li->list[x]; x++) { 326 362 switch (wk->li->type) { … … 829 865 if (fRealIdle) 830 866 priority_idle(); 867 831 868 rc = docopyf(type, wk->li->list[x], newname); 832 869 if (fResetVerify) { … … 892 929 } 893 930 else { 894 if (LogFileHandle) 931 if (LogFileHandle) { 895 932 fprintf(LogFileHandle, 896 933 GetPString(IDS_LOGTOFAILEDTEXT), 897 934 move, wk->li->list[x], newname, rc); 935 } 898 936 rc = Dos_Error(MB_ENTERCANCEL, 899 937 rc, … … 912 950 } 913 951 else { 914 if (LogFileHandle) 952 if (LogFileHandle) { 915 953 fprintf(LogFileHandle, 916 954 "%s \"%s\" %s\"%s\"\n", … … 918 956 wk->li->list[x], 919 957 GetPString(IDS_TOTEXT), newname); 958 } 920 959 if ((driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) && 921 960 AddToList(wk->li->list[x], … … 984 1023 } // for list 985 1024 1025 // Do actio specific post-processing 986 1026 switch (wk->li->type) { 987 1027 case IDM_MOVE: … … 1026 1066 break; 1027 1067 } 1028 } 1068 if (idTimerStarted) 1069 WinStopTimer(habForActions, hwndForActions, ID_ACTION_TIMER); // 13 Jul 09 SHL 1070 } // if have non-empty list 1029 1071 1030 1072 Abort: … … 1048 1090 } 1049 1091 1092 if (fActionPosted) 1093 DosSleep(2000); // Alloc container time to process queued UM_ACTIONSTATE messages 13 Jul 09 SHL 1050 1094 if (wk->li) 1051 1095 FreeListInfo(wk->li); … … 1763 1807 } 1764 1808 } 1809 1810 // We can use static buffer for all in progress actions because we have only 1 status line 1811 static WORKER *pCachedActionWorker; // Sent from Action thread via UM_ACTIONSTATE 1812 static PSZ pszCachedActionListItem; // Sent from Action thread via UM_ACTIONSTATE 1813 1814 MRESULT EXPENTRY ActionWMTimer(HWND hwnd, MPARAM mp1, MPARAM mp2) 1815 { 1816 if (pCachedActionWorker != NULL && pszCachedActionListItem != NULL) { 1817 DbgMsg(pszSrcFile, __LINE__, "Using hWndStatus %lx pCachedActionWorker %p pszCachedActionListItem %s", hwndStatus, pCachedActionWorker, pszCachedActionListItem); // 13 Jul 09 SHL fixme debug 1818 if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd) { 1819 CHAR s[CCHMAXPATH + 64]; 1820 sprintf(s, "%s %s", 1821 pCachedActionWorker->li->type == IDM_MOVE ? 1822 GetPString(IDS_MOVINGTEXT) : 1823 GetPString(IDS_COPYINGTEXT), 1824 pszCachedActionListItem); 1825 // sprintf(s, "Moving/copying %s", pszCachedActionListItem); // 14 Jul 09 SHL fixme 1826 WinSetWindowText(hwndStatus, s); 1827 } 1828 } 1829 return 0; 1830 } 1831 1832 MRESULT EXPENTRY ActionUMWorkerState(HWND hwnd, MPARAM mp1, MPARAM mp2) { 1833 pCachedActionWorker = PVOIDFROMMP(mp1); 1834 pszCachedActionListItem = PVOIDFROMMP(mp2); 1835 DbgMsg(pszSrcFile, __LINE__, "Setting pCachedActionWorker %p pszCachedActionListItem %s", pCachedActionWorker, pszCachedActionListItem); // 13 Jul 09 SHL fixme debug 1836 if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd) 1837 WinPostMsg(hwnd, WM_SETFOCUS, MPFROMLONG(hwnd), MPFROMLONG(TRUE)); // 14 Jul 09 SHL Force status line update 1838 return 0; 1839 } 1840 1765 1841 #pragma alloc_text(MASSACTION,MassAction) 1766 1842 #pragma alloc_text(ACTION,Action)
Note:
See TracChangeset
for help on using the changeset viewer.