Changeset 1455 for trunk/dll/worker.c


Ignore:
Timestamp:
Sep 15, 2009, 4:43:55 AM (16 years ago)
Author:
Steven Levine
Message:

Blink thread LEDs while worker threads are working
Drop expermental code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/worker.c

    r1449 r1455  
    6161// #define INCL_WINWORKPLACE            // 13 Jul 09 SHL dropped
    6262#define INCL_WINSHELLDATA               // PrfQueryProfileData
    63 #define INCL_WINTIMER                   // WinStarTimer
    64 #define INCL_WININPUT                   // WinQueryFocus
    6563
    6664#include "fm3dll.h"
     
    106104#include "avl.h"                        // SBoxDlgProc
    107105#include "subj.h"                       // Subject
    108 #include "grep.h"                       // hwndStatus
    109106#include "stristr.h"                    // stristr
    110107#include "wrappers.h"                   // xfopen
     
    199196  INT plen = 0;
    200197  CHAR *p, *pp;
    201   ULONG idTimerStarted = 0;
    202   BOOL fActionPosted = FALSE;
    203   HAB habForActions;
    204   HWND hwndForActions;
    205198  CHAR szQuotedDirName[CCHMAXPATH];
    206199  CHAR szQuotedFileName[CCHMAXPATH];
     
    333326          // Process each list item
    334327          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 container
    338               // 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_ACTIONSTATE
    340               HWND hwndFocus = WinQueryFocus(HWND_DESKTOP);
    341               DbgMsg(pszSrcFile, __LINE__, "hwndFocus %lx", hwndFocus); // 13 Jul 09 SHL fixme debug
    342               DbgMsg(pszSrcFile, __LINE__, "hwndCnr %lx", wk->hwndCnr); // 13 Jul 09 SHL fixme debug
    343               // DbgMsg(pszSrcFile, __LINE__, "hwndS %lx", wk->li->hwndS);      // 13 Jul 09 SHL fixme debug
    344               DbgMsg(pszSrcFile, __LINE__, "hwnd %lx", wk->li->hwnd);   // 13 Jul 09 SHL fixme debug
    345               // DbgMsg(pszSrcFile, __LINE__, "hwndParent %lx", wk->hwndParent);        // 13 Jul 09 SHL fixme debug
    346               // DbgMsg(pszSrcFile, __LINE__, "hwndClient %lx", wk->hwndClient);        // 13 Jul 09 SHL fixme debug
    347               // DbgMsg(pszSrcFile, __LINE__, "hwndFrame %lx", wk->hwndFrame);  // 13 Jul 09 SHL fixme debug
    348               // hwndForActions = wk->li->hwnd == hwndFocus ? hwndFocus : wk->hwndCnr;
    349               hwndForActions = WinQueryFocus(HWND_DESKTOP);
    350 #if 0 // 14 Jul 09 SHL fixme
    351               hwndForActions = WinQueryFocus(HWND_DESKTOP);
    352               if (WinQueryClassName(hwndForActions, sizeof(ucClassname), ucClassname)) {
    353                 // If not a container fall back to worker
    354                 if (strcmp(ucClassname, "#25"));
    355               }
    356 #endif
    357               habForActions = WinQueryAnchorBlock(hwndForActions);
    358               DbgMsg(pszSrcFile, __LINE__, "habForActions %lx hwndForActions %lx", habForActions, hwndForActions);      // 13 Jul 09 SHL fixme debug
    359               // Ask container window to update status line every 5 seconds in case action is time intensive
    360               idTimerStarted = WinStartTimer(habForActions, hwndForActions, ID_ACTION_TIMER, 2000);     // 13 Jul 09 SHL fixme 5 sec
    361             }
    362328            for (x = 0; wk->li->list[x]; x++) {
    363329              switch (wk->li->type) {
     
    746712                      GetPString(IDS_MOVEDTEXT) : GetPString(IDS_COPIEDTEXT);
    747713                    if (*wk->li->targetpath) {
    748                       strcpy(newname, wk->li->targetpath);
    749                       AddBackslashToPath(newname);
     714                      strcpy(newname, wk->li->targetpath);
     715                      AddBackslashToPath(newname);
    750716                      //if (newname[strlen(newname) - 1] != '\\')
    751717                      //  strcat(newname, "\\");
     
    1026992            } // for list
    1027993
    1028             // Do actio specific post-processing
     994            // Do action specific post-processing
    1029995            switch (wk->li->type) {
    1030996            case IDM_MOVE:
     
    10691035              break;
    10701036            }
    1071             if (idTimerStarted)
    1072               WinStopTimer(habForActions, hwndForActions, ID_ACTION_TIMER);     // 13 Jul 09 SHL
    10731037          } // if have non-empty list
    10741038
     
    10931057    }
    10941058
    1095     if (fActionPosted)
    1096       DosSleep(2000);                   // Alloc container time to process queued UM_ACTIONSTATE messages 13 Jul 09 SHL
    10971059    if (wk->li)
    10981060      FreeListInfo(wk->li);
     
    12581220              if (wk->li->type == IDM_MCIPLAY)
    12591221                break;
    1260               strcpy(szBuffer, wk->li->targetpath);
    1261               AddBackslashToPath(wk->li->targetpath);
     1222              strcpy(szBuffer, wk->li->targetpath);
     1223              AddBackslashToPath(wk->li->targetpath);
    12621224              //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != '\\')
    12631225              //  strcat(szBuffer, "\\");
     
    13201282              }
    13211283              else {
    1322                 if (*wk->li->targetpath && !IsFile(wk->li->targetpath))
    1323                   AddBackslashToPath(wk->li->targetpath);
     1284                if (*wk->li->targetpath && !IsFile(wk->li->targetpath))
     1285                  AddBackslashToPath(wk->li->targetpath);
    13241286                  //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] !=
    13251287                  //    '\\')
     
    13491311                break;
    13501312              if (!*wk->li->targetpath && *wk->directory) {
    1351                 strcpy(ad.arcname, wk->directory);
    1352                 AddBackslashToPath(ad.arcname);
     1313                strcpy(ad.arcname, wk->directory);
     1314                AddBackslashToPath(ad.arcname);
    13531315                //if (ad.arcname[strlen(ad.arcname) - 1] != '\\')
    13541316                //  strcat(ad.arcname, "\\");
     
    18111773}
    18121774
    1813 // We can use static buffer for all in progress actions because we have only 1 status line
    1814 static WORKER *pCachedActionWorker;     // Sent from Action thread via UM_ACTIONSTATE
    1815 static PSZ pszCachedActionListItem;     // Sent from Action thread via UM_ACTIONSTATE
    1816 
    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 debug
    1821     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 fixme
    1829       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 debug
    1839   if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd)
    1840     WinPostMsg(hwnd, WM_SETFOCUS, MPFROMLONG(hwnd), MPFROMLONG(TRUE));  // 14 Jul 09 SHL Force status line update
    1841   return 0;
    1842 }
    1843 
    18441775#pragma alloc_text(MASSACTION,MassAction)
    18451776#pragma alloc_text(ACTION,Action)
Note: See TracChangeset for help on using the changeset viewer.