Changeset 1455 for trunk/dll/worker.c
- Timestamp:
- Sep 15, 2009, 4:43:55 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/worker.c
r1449 r1455 61 61 // #define INCL_WINWORKPLACE // 13 Jul 09 SHL dropped 62 62 #define INCL_WINSHELLDATA // PrfQueryProfileData 63 #define INCL_WINTIMER // WinStarTimer64 #define INCL_WININPUT // WinQueryFocus65 63 66 64 #include "fm3dll.h" … … 106 104 #include "avl.h" // SBoxDlgProc 107 105 #include "subj.h" // Subject 108 #include "grep.h" // hwndStatus109 106 #include "stristr.h" // stristr 110 107 #include "wrappers.h" // xfopen … … 199 196 INT plen = 0; 200 197 CHAR *p, *pp; 201 ULONG idTimerStarted = 0;202 BOOL fActionPosted = FALSE;203 HAB habForActions;204 HWND hwndForActions;205 198 CHAR szQuotedDirName[CCHMAXPATH]; 206 199 CHAR szQuotedFileName[CCHMAXPATH]; … … 333 326 // Process each list item 334 327 if (wk->li && wk->li->list && wk->li->list[0]) { 335 // char ucClassname[8];336 if (hwndStatus) {337 // Send update request to source window or container338 // 13 Jul 09 SHL fixme to be sure we pick window that understand UM_ACTIONSTATE wk->dcd->hwndCnr?339 // 13 Jul 09 SHL fixme to ensure focus window is one that understands UM_ACTIONSTATE340 HWND hwndFocus = WinQueryFocus(HWND_DESKTOP);341 DbgMsg(pszSrcFile, __LINE__, "hwndFocus %lx", hwndFocus); // 13 Jul 09 SHL fixme debug342 DbgMsg(pszSrcFile, __LINE__, "hwndCnr %lx", wk->hwndCnr); // 13 Jul 09 SHL fixme debug343 // DbgMsg(pszSrcFile, __LINE__, "hwndS %lx", wk->li->hwndS); // 13 Jul 09 SHL fixme debug344 DbgMsg(pszSrcFile, __LINE__, "hwnd %lx", wk->li->hwnd); // 13 Jul 09 SHL fixme debug345 // DbgMsg(pszSrcFile, __LINE__, "hwndParent %lx", wk->hwndParent); // 13 Jul 09 SHL fixme debug346 // DbgMsg(pszSrcFile, __LINE__, "hwndClient %lx", wk->hwndClient); // 13 Jul 09 SHL fixme debug347 // DbgMsg(pszSrcFile, __LINE__, "hwndFrame %lx", wk->hwndFrame); // 13 Jul 09 SHL fixme debug348 // hwndForActions = wk->li->hwnd == hwndFocus ? hwndFocus : wk->hwndCnr;349 hwndForActions = WinQueryFocus(HWND_DESKTOP);350 #if 0 // 14 Jul 09 SHL fixme351 hwndForActions = WinQueryFocus(HWND_DESKTOP);352 if (WinQueryClassName(hwndForActions, sizeof(ucClassname), ucClassname)) {353 // If not a container fall back to worker354 if (strcmp(ucClassname, "#25"));355 }356 #endif357 habForActions = WinQueryAnchorBlock(hwndForActions);358 DbgMsg(pszSrcFile, __LINE__, "habForActions %lx hwndForActions %lx", habForActions, hwndForActions); // 13 Jul 09 SHL fixme debug359 // Ask container window to update status line every 5 seconds in case action is time intensive360 idTimerStarted = WinStartTimer(habForActions, hwndForActions, ID_ACTION_TIMER, 2000); // 13 Jul 09 SHL fixme 5 sec361 }362 328 for (x = 0; wk->li->list[x]; x++) { 363 329 switch (wk->li->type) { … … 746 712 GetPString(IDS_MOVEDTEXT) : GetPString(IDS_COPIEDTEXT); 747 713 if (*wk->li->targetpath) { 748 749 714 strcpy(newname, wk->li->targetpath); 715 AddBackslashToPath(newname); 750 716 //if (newname[strlen(newname) - 1] != '\\') 751 717 // strcat(newname, "\\"); … … 1026 992 } // for list 1027 993 1028 // Do actio specific post-processing994 // Do action specific post-processing 1029 995 switch (wk->li->type) { 1030 996 case IDM_MOVE: … … 1069 1035 break; 1070 1036 } 1071 if (idTimerStarted)1072 WinStopTimer(habForActions, hwndForActions, ID_ACTION_TIMER); // 13 Jul 09 SHL1073 1037 } // if have non-empty list 1074 1038 … … 1093 1057 } 1094 1058 1095 if (fActionPosted)1096 DosSleep(2000); // Alloc container time to process queued UM_ACTIONSTATE messages 13 Jul 09 SHL1097 1059 if (wk->li) 1098 1060 FreeListInfo(wk->li); … … 1258 1220 if (wk->li->type == IDM_MCIPLAY) 1259 1221 break; 1260 1261 1222 strcpy(szBuffer, wk->li->targetpath); 1223 AddBackslashToPath(wk->li->targetpath); 1262 1224 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != '\\') 1263 1225 // strcat(szBuffer, "\\"); … … 1320 1282 } 1321 1283 else { 1322 1323 1284 if (*wk->li->targetpath && !IsFile(wk->li->targetpath)) 1285 AddBackslashToPath(wk->li->targetpath); 1324 1286 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != 1325 1287 // '\\') … … 1349 1311 break; 1350 1312 if (!*wk->li->targetpath && *wk->directory) { 1351 1352 1313 strcpy(ad.arcname, wk->directory); 1314 AddBackslashToPath(ad.arcname); 1353 1315 //if (ad.arcname[strlen(ad.arcname) - 1] != '\\') 1354 1316 // strcat(ad.arcname, "\\"); … … 1811 1773 } 1812 1774 1813 // We can use static buffer for all in progress actions because we have only 1 status line1814 static WORKER *pCachedActionWorker; // Sent from Action thread via UM_ACTIONSTATE1815 static PSZ pszCachedActionListItem; // Sent from Action thread via UM_ACTIONSTATE1816 1817 MRESULT EXPENTRY ActionWMTimer(HWND hwnd, MPARAM mp1, MPARAM mp2)1818 {1819 if (pCachedActionWorker != NULL && pszCachedActionListItem != NULL) {1820 DbgMsg(pszSrcFile, __LINE__, "Using hWndStatus %lx pCachedActionWorker %p pszCachedActionListItem %s", hwndStatus, pCachedActionWorker, pszCachedActionListItem); // 13 Jul 09 SHL fixme debug1821 if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd) {1822 CHAR s[CCHMAXPATH + 64];1823 sprintf(s, "%s %s",1824 pCachedActionWorker->li->type == IDM_MOVE ?1825 GetPString(IDS_MOVINGTEXT) :1826 GetPString(IDS_COPYINGTEXT),1827 pszCachedActionListItem);1828 // sprintf(s, "Moving/copying %s", pszCachedActionListItem); // 14 Jul 09 SHL fixme1829 WinSetWindowText(hwndStatus, s);1830 }1831 }1832 return 0;1833 }1834 1835 MRESULT EXPENTRY ActionUMWorkerState(HWND hwnd, MPARAM mp1, MPARAM mp2) {1836 pCachedActionWorker = PVOIDFROMMP(mp1);1837 pszCachedActionListItem = PVOIDFROMMP(mp2);1838 DbgMsg(pszSrcFile, __LINE__, "Setting pCachedActionWorker %p pszCachedActionListItem %s", pCachedActionWorker, pszCachedActionListItem); // 13 Jul 09 SHL fixme debug1839 if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd)1840 WinPostMsg(hwnd, WM_SETFOCUS, MPFROMLONG(hwnd), MPFROMLONG(TRUE)); // 14 Jul 09 SHL Force status line update1841 return 0;1842 }1843 1844 1775 #pragma alloc_text(MASSACTION,MassAction) 1845 1776 #pragma alloc_text(ACTION,Action)
Note:
See TracChangeset
for help on using the changeset viewer.