diff --git a/base/applications/taskmgr/applpage.c b/base/applications/taskmgr/applpage.c index d8ddab69333..1d67f890dc2 100644 --- a/base/applications/taskmgr/applpage.c +++ b/base/applications/taskmgr/applpage.c @@ -17,9 +17,9 @@ typedef struct HWND hApplicationPage; /* Application List Property Page */ HWND hApplicationPageListCtrl; /* Application ListCtrl Window */ -HWND hApplicationPageEndTaskButton; /* Application End Task button */ -HWND hApplicationPageSwitchToButton; /* Application Switch To button */ -HWND hApplicationPageNewTaskButton; /* Application New Task button */ +HWND hApplicationPageEndTaskButton; +HWND hApplicationPageSwitchToButton; +HWND hApplicationPageNewTaskButton; static int nApplicationPageWidth; static int nApplicationPageHeight; static BOOL bSortAscending = TRUE; @@ -82,7 +82,6 @@ void AppPageCleanup(void) } } - INT_PTR CALLBACK ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { @@ -133,10 +132,8 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) #ifdef RUN_APPS_PAGE hApplicationThread = CreateThread(NULL, 0, ApplicationPageRefreshThread, NULL, 0, &dwApplicationThread); #endif - /* Refresh page */ ApplicationPageUpdate(); - return TRUE; case WM_DESTROY: @@ -161,7 +158,6 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) SendMessageW(hMainWnd, WM_COMMAND, MAKEWPARAM(ID_FILE_NEW, 0), 0); break; } - break; case WM_SIZE: @@ -202,7 +198,6 @@ ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) cy = rc.top + nYDifference; SetWindowPos(hApplicationPageNewTaskButton, NULL, cx, cy, 0, 0, SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER); InvalidateRect(hApplicationPageNewTaskButton, NULL, TRUE); - break; case WM_NOTIFY: @@ -252,9 +247,9 @@ DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter) HIMAGELIST hImageListSmall; /* If we couldn't create the event then exit the thread */ - while (1) + for (;;) { - /* Wait for an the event or application close */ + // Wait for an the event or application close if (GetMessage(&msg, NULL, 0, 0) <= 0) return 0; @@ -352,14 +347,13 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) /* Get the icon for this window */ hIcon = NULL; - SendMessageTimeoutW(hWnd, WM_GETICON, bLargeIcon ? ICON_BIG : ICON_SMALL, 0, 0, 1000, (PDWORD_PTR)&hIcon); + SendMessageTimeoutW(hWnd, WM_GETICON, bLargeIcon ? ICON_BIG : ICON_SMALL, 0, 0, 100, (PDWORD_PTR)&hIcon); if (!hIcon) { /* We failed, try to retrieve other icons... */ hIcon = (HICON)(LONG_PTR)GetClassLongPtrW(hWnd, bLargeIcon ? GCL_HICON : GCL_HICONSM); if (!hIcon) hIcon = (HICON)(LONG_PTR)GetClassLongPtrW(hWnd, bLargeIcon ? GCL_HICONSM : GCL_HICON); - if (!hIcon) SendMessageTimeoutW(hWnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (PDWORD_PTR)&hIcon); - if (!hIcon) SendMessageTimeoutW(hWnd, WM_GETICON, bLargeIcon ? ICON_SMALL : ICON_BIG, 0, 0, 1000, (PDWORD_PTR)&hIcon); + if (!hIcon) SendMessageTimeoutW(hWnd, WM_GETICON, bLargeIcon ? ICON_SMALL : ICON_BIG, 0, 0, 100, (PDWORD_PTR)&hIcon); /* If we still do not have any icon, load the default one */ if (!hIcon) hIcon = LoadIconW(hInst, bLargeIcon ? MAKEINTRESOURCEW(IDI_WINDOW) : MAKEINTRESOURCEW(IDI_WINDOWSM)); @@ -427,7 +421,6 @@ void AddOrUpdateHwnd(HWND hWnd, WCHAR *szTitle, HICON hIcon, BOOL bHung) /* Update the list view */ (void)ListView_RedrawItems(hApplicationPageListCtrl, 0, ListView_GetItemCount(hApplicationPageListCtrl)); - /* UpdateWindow(hApplicationPageListCtrl); */ InvalidateRect(hApplicationPageListCtrl, NULL, 0); } } @@ -526,15 +519,11 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam) case LVN_ITEMCHANGED: ApplicationPageUpdate(); break; - case LVN_GETDISPINFO: pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)pnmdi->item.lParam; - /* Update the item text */ if (pnmdi->item.iSubItem == 0) wcsncpy(pnmdi->item.pszText, pAPLI->szTitle, pnmdi->item.cchTextMax); - - /* Update the item status */ else if (pnmdi->item.iSubItem == 1) { if (pAPLI->bHung) @@ -543,20 +532,16 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam) LoadStringW(GetModuleHandleW(NULL), IDS_RUNNING, (LPWSTR) szMsg, _countof(szMsg)); wcsncpy(pnmdi->item.pszText, szMsg, pnmdi->item.cchTextMax); } - break; - case NM_RCLICK: if (ListView_GetSelectedCount(hApplicationPageListCtrl) < 1) ApplicationPageShowContextMenu1(); else ApplicationPageShowContextMenu2(); break; - case NM_DBLCLK: ApplicationPage_OnSwitchTo(); break; - case LVN_KEYDOWN: if (((LPNMLVKEYDOWN)lParam)->wVKey == VK_DELETE) ApplicationPage_OnEndTask(); @@ -573,7 +558,6 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam) else ApplicationPageShowContextMenu2(); break; - case HDN_ITEMCLICK: (void)ListView_SortItems(hApplicationPageListCtrl, ApplicationPageCompareFunc, 0); bSortAscending = !bSortAscending; @@ -708,9 +692,8 @@ void ApplicationPage_OnWindowsMinimize(void) (void)ListView_GetItem(hApplicationPageListCtrl, &item); if (item.state & LVIS_SELECTED) { pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam; - if (pAPLI) { - ShowWindow(pAPLI->hWnd, SW_MINIMIZE); - } + if (pAPLI) + ShowWindowAsync(pAPLI->hWnd, SW_MINIMIZE); } } } @@ -729,9 +712,8 @@ void ApplicationPage_OnWindowsMaximize(void) (void)ListView_GetItem(hApplicationPageListCtrl, &item); if (item.state & LVIS_SELECTED) { pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam; - if (pAPLI) { - ShowWindow(pAPLI->hWnd, SW_MAXIMIZE); - } + if (pAPLI) + ShowWindowAsync(pAPLI->hWnd, SW_MAXIMIZE); } } } @@ -782,11 +764,8 @@ void ApplicationPage_OnWindowsBringToFront(void) break; } } - if (pAPLI) { - if (IsIconic(pAPLI->hWnd)) - ShowWindow(pAPLI->hWnd, SW_RESTORE); - BringWindowToTop(pAPLI->hWnd); - } + if (pAPLI) + SwitchToThisWindow(pAPLI->hWnd, TRUE); } void ApplicationPage_OnSwitchTo(void) @@ -808,21 +787,9 @@ void ApplicationPage_OnSwitchTo(void) } } if (pAPLI) { - typedef void (WINAPI *PROCSWITCHTOTHISWINDOW) (HWND, BOOL); - PROCSWITCHTOTHISWINDOW SwitchToThisWindow; - - HMODULE hUser32 = GetModuleHandleW(L"USER32"); - SwitchToThisWindow = (PROCSWITCHTOTHISWINDOW)GetProcAddress(hUser32, "SwitchToThisWindow"); - if (SwitchToThisWindow) { - SwitchToThisWindow(pAPLI->hWnd, TRUE); - } else { - if (IsIconic(pAPLI->hWnd)) - ShowWindow(pAPLI->hWnd, SW_RESTORE); - BringWindowToTop(pAPLI->hWnd); - SetForegroundWindow(pAPLI->hWnd); - } + SwitchToThisWindow(pAPLI->hWnd, TRUE); if (TaskManagerSettings.MinimizeOnUse) - ShowWindow(hMainWnd, SW_MINIMIZE); + ShowWindowAsync(hMainWnd, SW_MINIMIZE); } } @@ -843,9 +810,8 @@ void ApplicationPage_OnEndTask(void) (void)ListView_GetItem(hApplicationPageListCtrl, &item); if (item.state & LVIS_SELECTED) { pAPLI = (LPAPPLICATION_PAGE_LIST_ITEM)item.lParam; - if (pAPLI) { + if (pAPLI) EndTask(pAPLI->hWnd, 0, ForceEndTask); - } } } } diff --git a/base/applications/taskmgr/applpage.h b/base/applications/taskmgr/applpage.h index 886cc5094d7..0f7d47e8f85 100644 --- a/base/applications/taskmgr/applpage.h +++ b/base/applications/taskmgr/applpage.h @@ -8,14 +8,13 @@ extern HWND hApplicationPage; /* Application List Property Page */ extern HWND hApplicationPageListCtrl; /* Application ListCtrl Window */ -extern HWND hApplicationPageEndTaskButton; /* Application End Task button */ -extern HWND hApplicationPageSwitchToButton; /* Application Switch To button */ -extern HWND hApplicationPageNewTaskButton; /* Application New Task button */ +extern HWND hApplicationPageEndTaskButton; +extern HWND hApplicationPageSwitchToButton; +extern HWND hApplicationPageNewTaskButton; INT_PTR CALLBACK ApplicationPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); void RefreshApplicationPage(void); void UpdateApplicationListControlViewSetting(void); - void ApplicationPage_OnView(DWORD); void ApplicationPage_OnWindowsTile(DWORD); void ApplicationPage_OnWindowsMinimize(void); diff --git a/base/applications/taskmgr/debug.c b/base/applications/taskmgr/debug.c index 665bbc79000..d2c79d98f42 100644 --- a/base/applications/taskmgr/debug.c +++ b/base/applications/taskmgr/debug.c @@ -68,8 +68,8 @@ void ProcessPage_OnDebug(void) wsprintfW(strDebugPath, strDebugger, dwProcessId, hDebugEvent); - ZeroMemory(&pi, sizeof(pi)); - ZeroMemory(&si, sizeof(si)); + memset(&pi, 0, sizeof(pi)); + memset(&si, 0, sizeof(si)); si.cb = sizeof(si); if (!CreateProcessW(NULL, strDebugPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { diff --git a/base/applications/taskmgr/graph.h b/base/applications/taskmgr/graph.h index 40e581601a1..094e1379c72 100644 --- a/base/applications/taskmgr/graph.h +++ b/base/applications/taskmgr/graph.h @@ -6,11 +6,6 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - - #define BRIGHT_GREEN RGB(0, 255, 0) #define MEDIUM_GREEN RGB(0, 190, 0) #define DARK_GREEN RGB(0, 130, 0) @@ -19,8 +14,3 @@ extern "C" { extern WNDPROC OldGraphWndProc; INT_PTR CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - - -#ifdef __cplusplus -}; -#endif diff --git a/base/applications/taskmgr/graphctl.c b/base/applications/taskmgr/graphctl.c index b4cacb61fef..a1490be5c64 100644 --- a/base/applications/taskmgr/graphctl.c +++ b/base/applications/taskmgr/graphctl.c @@ -6,311 +6,252 @@ #include "precomp.h" -#include - WNDPROC OldGraphCtrlWndProc; -static void GraphCtrl_Init(TGraphCtrl* this) +void GraphCtrl_Create(PTGraphCtrl inst, HWND hWnd, HWND hParentWnd, PTFormat fmt) { - int i; + HDC hdc, hdcg; + HBITMAP hbmOld; + UINT Size; + INT p; + RECT rc; - this->m_hWnd = 0; - this->m_hParentWnd = 0; - this->m_dcGrid = 0; - this->m_dcPlot = 0; - this->m_bitmapOldGrid = 0; - this->m_bitmapOldPlot = 0; - this->m_bitmapGrid = 0; - this->m_bitmapPlot = 0; - this->m_brushBack = 0; + inst->hParentWnd = hParentWnd; + inst->hWnd = hWnd; - this->m_penPlot[0] = 0; - this->m_penPlot[1] = 0; - this->m_penPlot[2] = 0; - this->m_penPlot[3] = 0; + Size = GetSystemMetrics(SM_CXSCREEN); + inst->BitmapWidth = Size; + Size /= PLOT_SHIFT; + inst->PointBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Size * NUM_PLOTS); + if (!inst->PointBuffer) + goto fail; - this->m_dPreviousPosition[0] = 0.0; - this->m_dPreviousPosition[1] = 0.0; - this->m_dPreviousPosition[2] = 0.0; - this->m_dPreviousPosition[3] = 0.0; + inst->NumberOfPoints = Size; + inst->CurrIndex = 0; - this->m_nYDecimals = 3; + inst->hPenGrid = CreatePen(PS_SOLID, 0, fmt->clrGrid); + inst->hPen0 = CreatePen(PS_SOLID, 0, fmt->clrPlot0); + inst->hPen1 = CreatePen(PS_SOLID, 0, fmt->clrPlot1); + inst->hBrushBack = CreateSolidBrush(fmt->clrBack); - this->m_dLowerLimit = 0.0; - this->m_dUpperLimit = 100.0; - this->m_dRange = this->m_dUpperLimit - this->m_dLowerLimit; + if (!inst->hPenGrid || !inst->hPen0 || !inst->hPen1 || !inst->hBrushBack) + goto fail; - this->m_nShiftPixels = 4; - this->m_nHalfShiftPixels = this->m_nShiftPixels/2; - this->m_nPlotShiftPixels = this->m_nShiftPixels + this->m_nHalfShiftPixels; + if (fmt->GridCellWidth >= PLOT_SHIFT << 2) + inst->GridCellWidth = fmt->GridCellWidth; + else + inst->GridCellWidth = PLOT_SHIFT << 2; + if (fmt->GridCellHeight >= PLOT_SHIFT << 2) + inst->GridCellHeight = fmt->GridCellHeight; + else + inst->GridCellHeight = PLOT_SHIFT << 2; - this->m_crBackColor = RGB( 0, 0, 0); - this->m_crGridColor = RGB( 0, 128, 64); - this->m_crPlotColor[0] = RGB(255, 255, 255); - this->m_crPlotColor[1] = RGB(100, 255, 255); - this->m_crPlotColor[2] = RGB(255, 100, 255); - this->m_crPlotColor[3] = RGB(255, 255, 100); + inst->DrawSecondaryPlot = fmt->DrawSecondaryPlot; - for (i = 0; i < MAX_PLOTS; i++) - this->m_penPlot[i] = CreatePen(PS_SOLID, 0, this->m_crPlotColor[i]); - this->m_brushBack = CreateSolidBrush(this->m_crBackColor); + GetClientRect(hWnd, &rc); + inst->BitmapHeight = rc.bottom; + inst->ftPixelsPerPercent = (FLOAT)(inst->BitmapHeight) / 100.00f; - strcpy(this->m_strXUnitsString, "Samples"); - strcpy(this->m_strYUnitsString, "Y units"); + hdc = GetDC(hParentWnd); + hdcg = CreateCompatibleDC(hdc); + inst->hdcGraph = hdcg; + inst->hbmGraph = CreateCompatibleBitmap(hdc, inst->BitmapWidth, inst->BitmapHeight); - this->m_bitmapOldGrid = NULL; - this->m_bitmapOldPlot = NULL; -} + if (!hdc || !hdcg || !inst->hbmGraph) + goto fail; -void GraphCtrl_Dispose(TGraphCtrl* this) -{ - int plot; + ReleaseDC(hParentWnd, hdc); + hbmOld = (HBITMAP)SelectObject(hdcg, inst->hbmGraph); + DeleteObject(hbmOld); - for (plot = 0; plot < MAX_PLOTS; plot++) - DeleteObject(this->m_penPlot[plot]); + SetBkColor(hdcg, fmt->clrBack); + rc.right = inst->BitmapWidth; + FillRect(hdcg, &rc, inst->hBrushBack); - if (this->m_bitmapOldGrid != NULL) SelectObject(this->m_dcGrid, this->m_bitmapOldGrid); - if (this->m_bitmapOldPlot != NULL) SelectObject(this->m_dcPlot, this->m_bitmapOldPlot); - if (this->m_bitmapGrid != NULL) DeleteObject(this->m_bitmapGrid); - if (this->m_bitmapPlot != NULL) DeleteObject(this->m_bitmapPlot); - if (this->m_dcGrid != NULL) DeleteDC(this->m_dcGrid); - if (this->m_dcPlot != NULL) DeleteDC(this->m_dcPlot); - if (this->m_brushBack != NULL) DeleteObject(this->m_brushBack); -} - -void GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd, UINT nID) -{ - GraphCtrl_Init(this); - this->m_hParentWnd = hParentWnd; - this->m_hWnd = hWnd; - - GraphCtrl_Resize(this); -} - -void GraphCtrl_SetRange(TGraphCtrl* this, double dLower, double dUpper, int nDecimalPlaces) -{ - this->m_dLowerLimit = dLower; - this->m_dUpperLimit = dUpper; - this->m_nYDecimals = nDecimalPlaces; - this->m_dRange = this->m_dUpperLimit - this->m_dLowerLimit; - this->m_dVerticalFactor = (double)this->m_nPlotHeight / this->m_dRange; - GraphCtrl_InvalidateCtrl(this, FALSE); -} - -void GraphCtrl_SetGridColor(TGraphCtrl* this, COLORREF color) -{ - this->m_crGridColor = color; - GraphCtrl_InvalidateCtrl(this, FALSE); -} - -void GraphCtrl_SetPlotColor(TGraphCtrl* this, int plot, COLORREF color) -{ - this->m_crPlotColor[plot] = color; - DeleteObject(this->m_penPlot[plot]); - this->m_penPlot[plot] = CreatePen(PS_SOLID, 0, this->m_crPlotColor[plot]); - GraphCtrl_InvalidateCtrl(this, FALSE); -} - -void GraphCtrl_SetBackgroundColor(TGraphCtrl* this, COLORREF color) -{ - this->m_crBackColor = color; - DeleteObject(this->m_brushBack); - this->m_brushBack = CreateSolidBrush(this->m_crBackColor); - GraphCtrl_InvalidateCtrl(this, FALSE); -} - -void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize) -{ - int i; - int nCharacters; - HPEN oldPen; - HPEN solidPen = CreatePen(PS_SOLID, 0, this->m_crGridColor); - HDC dc = GetDC(this->m_hParentWnd); - - if (this->m_dcGrid == NULL) + inst->CurrShift = 0; + SelectObject(hdcg, inst->hPenGrid); + for (p = inst->GridCellHeight - 1; p < inst->BitmapHeight; p += inst->GridCellHeight) { - this->m_dcGrid = CreateCompatibleDC(dc); - this->m_bitmapGrid = CreateCompatibleBitmap(dc, this->m_nClientWidth, this->m_nClientHeight); - this->m_bitmapOldGrid = (HBITMAP)SelectObject(this->m_dcGrid, this->m_bitmapGrid); + MoveToEx(hdcg, 0, p, NULL); + LineTo(hdcg, inst->BitmapWidth, p); } - else if(bResize) + for (p = inst->BitmapWidth - 1; p > 0; p -= inst->GridCellWidth) { - if(this->m_bitmapGrid != NULL) + MoveToEx(hdcg, p, 0, NULL); + LineTo(hdcg, p, inst->BitmapHeight); + } + SelectObject(hdcg, inst->hPen0); + + return; + +fail: + GraphCtrl_Dispose(inst); +} + +void GraphCtrl_Dispose(PTGraphCtrl inst) +{ + if (inst->PointBuffer) + HeapFree(GetProcessHeap(), 0, inst->PointBuffer); + + if (inst->hdcGraph) + DeleteDC(inst->hdcGraph); + + if (inst->hPenGrid) + DeleteObject(inst->hPenGrid); + + if (inst->hPen0) + DeleteObject(inst->hPen0); + + if (inst->hPen1) + DeleteObject(inst->hPen1); + + if (inst->hBrushBack) + DeleteObject(inst->hBrushBack); + + if (inst->hbmGraph) + DeleteObject(inst->hbmGraph); +} + +void GraphCtrl_AddPoint(PTGraphCtrl inst, BYTE val0, BYTE val1) +{ + HDC hdcg; + PBYTE t; + RECT rcDirt; + UINT Prev0, Prev1, RetainingWidth; + INT PrevY, CurrY, p, v; + + hdcg = inst->hdcGraph; + RetainingWidth = inst->BitmapWidth - PLOT_SHIFT; + t = inst->PointBuffer; + Prev0 = *(t + inst->CurrIndex); + Prev1 = *(t + inst->CurrIndex + inst->NumberOfPoints); + if (inst->CurrIndex < inst->NumberOfPoints - 1) + inst->CurrIndex++; + else + inst->CurrIndex = 0; + *(t + inst->CurrIndex) = val0; + *(t + inst->CurrIndex + inst->NumberOfPoints) = val1; + + // Drawing points, first shifting the plot left + BitBlt(hdcg, 0, 0, RetainingWidth, inst->BitmapHeight, hdcg, PLOT_SHIFT, 0, SRCCOPY); + + rcDirt.left = RetainingWidth; + rcDirt.top = 0; + rcDirt.right = inst->BitmapWidth; + rcDirt.bottom = inst->BitmapHeight; + FillRect(hdcg, &rcDirt, inst->hBrushBack); + + SelectObject(hdcg, inst->hPenGrid); + for (p = inst->GridCellHeight - 1; p < inst->BitmapHeight; p += inst->GridCellHeight) + { + MoveToEx(hdcg, RetainingWidth, p, NULL); + LineTo(hdcg, inst->BitmapWidth, p); + } + v = inst->CurrShift + PLOT_SHIFT; + if (v >= inst->GridCellWidth) + { + v -= inst->GridCellWidth; + p = inst->BitmapWidth - v - 1; + MoveToEx(hdcg, p, 0, NULL); + LineTo(hdcg, p, inst->BitmapHeight); + } + inst->CurrShift = v; + + if (inst->DrawSecondaryPlot) + { + SelectObject(inst->hdcGraph, inst->hPen1); + + PrevY = inst->BitmapHeight - Prev1 * inst->ftPixelsPerPercent; + MoveToEx(inst->hdcGraph, RetainingWidth - 1, PrevY, NULL); + CurrY = inst->BitmapHeight - val1 * inst->ftPixelsPerPercent; + LineTo(inst->hdcGraph, inst->BitmapWidth - 1, CurrY); + } + + SelectObject(inst->hdcGraph, inst->hPen0); + PrevY = inst->BitmapHeight - Prev0 * inst->ftPixelsPerPercent; + MoveToEx(inst->hdcGraph, RetainingWidth - 1, PrevY, NULL); + CurrY = inst->BitmapHeight - val0 * inst->ftPixelsPerPercent; + LineTo(inst->hdcGraph, inst->BitmapWidth - 1, CurrY); +} + +inline void GraphCtrl_RedrawBitmap(PTGraphCtrl inst, INT h) +{ + HDC hdcg; + PBYTE t; + RECT rc; + INT i, j, y, x, p; + FLOAT coef; + + hdcg = inst->hdcGraph; + rc.left = 0; rc.top = 0; + rc.right = inst->BitmapWidth; rc.bottom = h; + FillRect(hdcg, &rc, inst->hBrushBack); + + SelectObject(hdcg, inst->hPenGrid); + + for (p = inst->GridCellHeight - 1; p < inst->BitmapHeight; p += inst->GridCellHeight) + { + MoveToEx(hdcg, 0, p, NULL); + LineTo(hdcg, inst->BitmapWidth, p); + } + + for (p = inst->BitmapWidth - inst->CurrShift - 1; p > 0; p -= inst->GridCellWidth) + { + MoveToEx(hdcg, p, 0, NULL); + LineTo(hdcg, p, inst->BitmapHeight); + } + + coef = inst->ftPixelsPerPercent; + + if (inst->DrawSecondaryPlot) + { + SelectObject(hdcg, inst->hPen1); + t = inst->PointBuffer + inst->NumberOfPoints; + x = inst->BitmapWidth - 1; + j = inst->CurrIndex; + y = h - *(t + j) * coef; + MoveToEx(hdcg, x, y, NULL); + for (i = 0; i < inst->NumberOfPoints; i++) { - this->m_bitmapGrid = (HBITMAP)SelectObject(this->m_dcGrid, this->m_bitmapOldGrid); - DeleteObject(this->m_bitmapGrid); - this->m_bitmapGrid = CreateCompatibleBitmap(dc, this->m_nClientWidth, this->m_nClientHeight); - SelectObject(this->m_dcGrid, this->m_bitmapGrid); + j = (j ? j : inst->NumberOfPoints) - 1; + y = h - *(t + j) * coef; + x -= PLOT_SHIFT; + LineTo(hdcg, x, y); } } - SetBkColor(this->m_dcGrid, this->m_crBackColor); + SelectObject(hdcg, inst->hPen0); + t = inst->PointBuffer; + x = inst->BitmapWidth - 1; + j = inst->CurrIndex; + y = h - *(t + j) * coef; + MoveToEx(hdcg, x, y, NULL); - FillRect(this->m_dcGrid, &this->m_rectClient, this->m_brushBack); - - nCharacters = abs((int)log10(fabs(this->m_dUpperLimit))); - nCharacters = max(nCharacters, abs((int)log10(fabs(this->m_dLowerLimit)))); - nCharacters = nCharacters + 4 + this->m_nYDecimals; - - this->m_rectPlot.left = this->m_rectClient.left; - this->m_nPlotWidth = this->m_rectPlot.right - this->m_rectPlot.left; - - oldPen = (HPEN)SelectObject(this->m_dcGrid, solidPen); - MoveToEx(this->m_dcGrid, this->m_rectPlot.left, this->m_rectPlot.top, NULL); - LineTo(this->m_dcGrid, this->m_rectPlot.right+1, this->m_rectPlot.top); - LineTo(this->m_dcGrid, this->m_rectPlot.right+1, this->m_rectPlot.bottom+1); - LineTo(this->m_dcGrid, this->m_rectPlot.left, this->m_rectPlot.bottom+1); - - for (i = this->m_rectPlot.top; i < this->m_rectPlot.bottom; i += 12) + for (i = 0; i < inst->NumberOfPoints; i++) { - MoveToEx(this->m_dcGrid, this->m_rectPlot.left, this->m_rectPlot.top + i, NULL); - LineTo(this->m_dcGrid, this->m_rectPlot.right, this->m_rectPlot.top + i); - } - - for (i = this->m_rectPlot.left; i < this->m_rectPlot.right; i += 12) - { - MoveToEx(this->m_dcGrid, this->m_rectPlot.left + i, this->m_rectPlot.bottom, NULL); - LineTo(this->m_dcGrid, this->m_rectPlot.left + i, this->m_rectPlot.top); - } - - SelectObject(this->m_dcGrid, oldPen); - DeleteObject(solidPen); - - if (this->m_dcPlot == NULL) - { - this->m_dcPlot = CreateCompatibleDC(dc); - this->m_bitmapPlot = CreateCompatibleBitmap(dc, this->m_nClientWidth, this->m_nClientHeight); - this->m_bitmapOldPlot = (HBITMAP)SelectObject(this->m_dcPlot, this->m_bitmapPlot); - } - else if(bResize) - { - if(this->m_bitmapPlot != NULL) - { - this->m_bitmapPlot = (HBITMAP)SelectObject(this->m_dcPlot, this->m_bitmapOldPlot); - DeleteObject(this->m_bitmapPlot); - this->m_bitmapPlot = CreateCompatibleBitmap(dc, this->m_nClientWidth, this->m_nClientHeight); - SelectObject(this->m_dcPlot, this->m_bitmapPlot); - } - } - - SetBkColor(this->m_dcPlot, this->m_crBackColor); - FillRect(this->m_dcPlot, &this->m_rectClient, this->m_brushBack); - - InvalidateRect(this->m_hParentWnd, &this->m_rectClient, TRUE); - ReleaseDC(this->m_hParentWnd, dc); -} - -double GraphCtrl_AppendPoint(TGraphCtrl* this, - double dNewPoint0, double dNewPoint1, - double dNewPoint2, double dNewPoint3) -{ - double dPrevious; - - dPrevious = this->m_dCurrentPosition[0]; - this->m_dCurrentPosition[0] = dNewPoint0; - this->m_dCurrentPosition[1] = dNewPoint1; - this->m_dCurrentPosition[2] = dNewPoint2; - this->m_dCurrentPosition[3] = dNewPoint3; - GraphCtrl_DrawPoint(this); - return dPrevious; -} - -void GraphCtrl_Paint(TGraphCtrl* this, HWND hWnd, HDC dc) -{ - HDC memDC; - HBITMAP memBitmap; - HBITMAP oldBitmap; - - memDC = CreateCompatibleDC(dc); - memBitmap = (HBITMAP)CreateCompatibleBitmap(dc, this->m_nClientWidth, this->m_nClientHeight); - oldBitmap = (HBITMAP)SelectObject(memDC, memBitmap); - - if (memDC != NULL) - { - BitBlt(memDC, 0, 0, this->m_nClientWidth, this->m_nClientHeight, this->m_dcGrid, 0, 0, SRCCOPY); - BitBlt(memDC, 0, 0, this->m_nClientWidth, this->m_nClientHeight, this->m_dcPlot, 0, 0, SRCPAINT); - BitBlt(dc, 0, 0, this->m_nClientWidth, this->m_nClientHeight, memDC, 0, 0, SRCCOPY); - } - SelectObject(memDC, oldBitmap); - DeleteObject(memBitmap); - DeleteDC(memDC); -} - -void GraphCtrl_DrawPoint(TGraphCtrl* this) -{ - int currX, prevX, currY, prevY; - HPEN oldPen; - RECT rectCleanUp; - int i; - - if (this->m_dcPlot != NULL) - { - BitBlt(this->m_dcPlot, this->m_rectPlot.left, this->m_rectPlot.top+1, - this->m_nPlotWidth, this->m_nPlotHeight, this->m_dcPlot, - this->m_rectPlot.left+this->m_nShiftPixels, this->m_rectPlot.top+1, - SRCCOPY); - - rectCleanUp = this->m_rectPlot; - rectCleanUp.left = rectCleanUp.right - this->m_nShiftPixels; - - FillRect(this->m_dcPlot, &rectCleanUp, this->m_brushBack); - - for (i = 0; i < MAX_PLOTS; i++) - { - oldPen = (HPEN)SelectObject(this->m_dcPlot, this->m_penPlot[i]); - - prevX = this->m_rectPlot.right-this->m_nPlotShiftPixels; - prevY = this->m_rectPlot.bottom - - (long)((this->m_dPreviousPosition[i] - this->m_dLowerLimit) * this->m_dVerticalFactor); - MoveToEx(this->m_dcPlot, prevX, prevY, NULL); - - currX = this->m_rectPlot.right-this->m_nHalfShiftPixels; - currY = this->m_rectPlot.bottom - - (long)((this->m_dCurrentPosition[i] - this->m_dLowerLimit) * this->m_dVerticalFactor); - LineTo(this->m_dcPlot, currX, currY); - - SelectObject(this->m_dcPlot, oldPen); - - if ((prevY <= this->m_rectPlot.top) || (currY <= this->m_rectPlot.top)) - { - RECT rc; - rc.bottom = this->m_rectPlot.top+1; - rc.left = prevX; - rc.right = currX+1; - rc.top = this->m_rectClient.top; - FillRect(this->m_dcPlot, &rc, this->m_brushBack); - } - if ((prevY >= this->m_rectPlot.bottom) || (currY >= this->m_rectPlot.bottom)) - { - RECT rc; - rc.bottom = this->m_rectClient.bottom+1; - rc.left = prevX; - rc.right = currX+1; - rc.top = this->m_rectPlot.bottom+1; - FillRect(this->m_dcPlot, &rc, this->m_brushBack); - } - - this->m_dPreviousPosition[i] = this->m_dCurrentPosition[i]; - } + j = (j ? j : inst->NumberOfPoints) - 1; + y = h - *(t + j) * coef; + x -= PLOT_SHIFT; + LineTo(hdcg, x, y); } } -void GraphCtrl_Resize(TGraphCtrl* this) +inline void GraphCtrl_RedrawOnHeightChange(PTGraphCtrl inst, INT nh) { - GetClientRect(this->m_hWnd, &this->m_rectClient); + HDC hdc; + HBITMAP hbmOld; - this->m_nClientHeight = this->m_rectClient.bottom - this->m_rectClient.top; - this->m_nClientWidth = this->m_rectClient.right - this->m_rectClient.left; + inst->BitmapHeight = nh; + inst->ftPixelsPerPercent = (FLOAT)nh / 100.00f; - this->m_rectPlot.left = 0; - this->m_rectPlot.top = -1; - this->m_rectPlot.right = this->m_rectClient.right; - this->m_rectPlot.bottom = this->m_rectClient.bottom; + hdc = GetDC(inst->hParentWnd); + hbmOld = inst->hbmGraph; + inst->hbmGraph = CreateCompatibleBitmap(hdc, inst->BitmapWidth, nh); + SelectObject(inst->hdcGraph, inst->hbmGraph); + DeleteObject(hbmOld); + ReleaseDC(inst->hParentWnd, hdc); - this->m_nPlotHeight = this->m_rectPlot.bottom - this->m_rectPlot.top; - this->m_nPlotWidth = this->m_rectPlot.right - this->m_rectPlot.left; - - this->m_dVerticalFactor = (double)this->m_nPlotHeight / this->m_dRange; + GraphCtrl_RedrawBitmap(inst, nh); } extern TGraphCtrl PerformancePageCpuUsageHistoryGraph; @@ -321,6 +262,7 @@ extern HWND hPerformancePageMemUsageHistoryGraph; INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { + PTGraphCtrl graph; RECT rcClient; HDC hdc; PAINTSTRUCT ps; @@ -371,24 +313,32 @@ GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_NCCALCSIZE: return 0; case WM_SIZE: - if (hWnd == hPerformancePageMemUsageHistoryGraph) - { - GraphCtrl_Resize(&PerformancePageMemUsageHistoryGraph); - GraphCtrl_InvalidateCtrl(&PerformancePageMemUsageHistoryGraph, TRUE); - } if (hWnd == hPerformancePageCpuUsageHistoryGraph) - { - GraphCtrl_Resize(&PerformancePageCpuUsageHistoryGraph); - GraphCtrl_InvalidateCtrl(&PerformancePageCpuUsageHistoryGraph, TRUE); - } + graph = &PerformancePageCpuUsageHistoryGraph; + else if (hWnd == hPerformancePageMemUsageHistoryGraph) + graph = &PerformancePageMemUsageHistoryGraph; + else + return 0; + if (HIWORD(lParam) != graph->BitmapHeight) + GraphCtrl_RedrawOnHeightChange(graph, HIWORD(lParam)); + InvalidateRect(hWnd, NULL, FALSE); return 0; case WM_PAINT: + if (hWnd == hPerformancePageCpuUsageHistoryGraph) + graph = &PerformancePageCpuUsageHistoryGraph; + else if (hWnd == hPerformancePageMemUsageHistoryGraph) + graph = &PerformancePageMemUsageHistoryGraph; + else + return 0; hdc = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &rcClient); - if (hWnd == hPerformancePageMemUsageHistoryGraph) - GraphCtrl_Paint(&PerformancePageMemUsageHistoryGraph, hWnd, hdc); - if (hWnd == hPerformancePageCpuUsageHistoryGraph) - GraphCtrl_Paint(&PerformancePageCpuUsageHistoryGraph, hWnd, hdc); + BitBlt(hdc, 0, 0, + rcClient.right, + rcClient.bottom, + graph->hdcGraph, + graph->BitmapWidth - rcClient.right, + 0, + SRCCOPY); EndPaint(hWnd, &ps); return 0; } diff --git a/base/applications/taskmgr/graphctl.h b/base/applications/taskmgr/graphctl.h index 2948a924754..9956157e7b4 100644 --- a/base/applications/taskmgr/graphctl.h +++ b/base/applications/taskmgr/graphctl.h @@ -6,72 +6,47 @@ #pragma once -#define MAX_PLOTS 4 -#define MAX_CTRLS 4 - -#ifdef __cplusplus -extern "C" { -#endif +#define NUM_PLOTS 2 +#define PLOT_SHIFT 2 typedef struct { - int m_nShiftPixels; - int m_nYDecimals; + HWND hParentWnd; + HWND hWnd; + HDC hdcGraph; + HBITMAP hbmGraph; + HPEN hPenGrid; + HPEN hPen0; + HPEN hPen1; + HBRUSH hBrushBack; + INT BitmapWidth; + INT BitmapHeight; + INT GridCellWidth; + INT GridCellHeight; + INT CurrShift; + PBYTE PointBuffer; + UINT32 NumberOfPoints; + UINT32 CurrIndex; + FLOAT ftPixelsPerPercent; + BOOL DrawSecondaryPlot; +} TGraphCtrl, *PTGraphCtrl; - char m_strXUnitsString[50]; - char m_strYUnitsString[50]; - - COLORREF m_crBackColor; - COLORREF m_crGridColor; - COLORREF m_crPlotColor[MAX_PLOTS]; - - double m_dCurrentPosition[MAX_PLOTS]; - double m_dPreviousPosition[MAX_PLOTS]; - - int m_nHalfShiftPixels; - int m_nPlotShiftPixels; - int m_nClientHeight; - int m_nClientWidth; - int m_nPlotHeight; - int m_nPlotWidth; - - double m_dLowerLimit; - double m_dUpperLimit; - double m_dRange; - double m_dVerticalFactor; - - HWND m_hWnd; - HWND m_hParentWnd; - HDC m_dcGrid; - HDC m_dcPlot; - HBITMAP m_bitmapOldGrid; - HBITMAP m_bitmapOldPlot; - HBITMAP m_bitmapGrid; - HBITMAP m_bitmapPlot; - HBRUSH m_brushBack; - HPEN m_penPlot[MAX_PLOTS]; - RECT m_rectClient; - RECT m_rectPlot; -} TGraphCtrl; +typedef struct +{ + COLORREF clrBack; + COLORREF clrGrid; + COLORREF clrPlot0; + COLORREF clrPlot1; + INT GridCellWidth; + INT GridCellHeight; + BOOL DrawSecondaryPlot; +} TFormat, *PTFormat; extern WNDPROC OldGraphCtrlWndProc; -double GraphCtrl_AppendPoint(TGraphCtrl* this, - double dNewPoint0, double dNewPoint1, - double dNewPoint2, double dNewPoint3); -void GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd, UINT nID); -void GraphCtrl_Dispose(TGraphCtrl* this); -void GraphCtrl_DrawPoint(TGraphCtrl* this); -void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize); -void GraphCtrl_Paint(TGraphCtrl* this, HWND hWnd, HDC dc); -void GraphCtrl_Reset(TGraphCtrl* this); -void GraphCtrl_Resize(TGraphCtrl* this); -void GraphCtrl_SetBackgroundColor(TGraphCtrl* this, COLORREF color); -void GraphCtrl_SetGridColor(TGraphCtrl* this, COLORREF color); -void GraphCtrl_SetPlotColor(TGraphCtrl* this, int plot, COLORREF color); -void GraphCtrl_SetRange(TGraphCtrl* this, double dLower, double dUpper, int nDecimalPlaces); - INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -#ifdef __cplusplus -} -#endif +void GraphCtrl_Create(PTGraphCtrl inst, HWND hWnd, HWND hParentWnd, PTFormat fmt); +void GraphCtrl_Dispose(PTGraphCtrl inst); +void GraphCtrl_AddPoint(PTGraphCtrl inst, BYTE val0, BYTE val1); +void GraphCtrl_RedrawOnHeightChange(PTGraphCtrl inst, INT nh); +void GraphCtrl_RedrawBitmap(PTGraphCtrl inst, INT h); diff --git a/base/applications/taskmgr/lang/bg-BG.rc b/base/applications/taskmgr/lang/bg-BG.rc index 94560778221..52a6ebba429 100644 --- a/base/applications/taskmgr/lang/bg-BG.rc +++ b/base/applications/taskmgr/lang/bg-BG.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "Помо&щ" BEGIN - MENUITEM "Съдържание на помо&щта за задачния управител", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&За задачния управител", ID_HELP_ABOUT END END @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 125, 160, 115, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Задачен управител" IDC_TASKMGR "Задачен управител" IDS_IDLE_PROCESS "Бездействия" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Приложения" IDS_TAB_PROCESSES "Действия" IDS_TAB_PERFORMANCE "Производителност" diff --git a/base/applications/taskmgr/lang/cs-CZ.rc b/base/applications/taskmgr/lang/cs-CZ.rc index 5a7ae57cddf..2c7c8008469 100644 --- a/base/applications/taskmgr/lang/cs-CZ.rc +++ b/base/applications/taskmgr/lang/cs-CZ.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "&Nápověda" BEGIN - MENUITEM "&Nápověda pro správce úloh", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&O správci úloh", ID_HELP_ABOUT END END @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Správce úloh" IDC_TASKMGR "Správce úloh" IDS_IDLE_PROCESS "Nečinné procesy" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Aplikace" IDS_TAB_PROCESSES "Procesy" IDS_TAB_PERFORMANCE "Výkon" diff --git a/base/applications/taskmgr/lang/da-DK.rc b/base/applications/taskmgr/lang/da-DK.rc index 1e9cdd9326c..065360a106a 100644 --- a/base/applications/taskmgr/lang/da-DK.rc +++ b/base/applications/taskmgr/lang/da-DK.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "&Hjælp" BEGIN - MENUITEM "Opgavestyring &Hjælpe Emner", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Omkring Opgavestyring", ID_HELP_ABOUT END END @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 85, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Opgavestyring" IDC_TASKMGR "Opgavestyring" IDS_IDLE_PROCESS "System Idle Process" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Applications" IDS_TAB_PROCESSES "Processes" IDS_TAB_PERFORMANCE "Performance" diff --git a/base/applications/taskmgr/lang/de-DE.rc b/base/applications/taskmgr/lang/de-DE.rc index a7ef0a0a5f9..70d9104b084 100644 --- a/base/applications/taskmgr/lang/de-DE.rc +++ b/base/applications/taskmgr/lang/de-DE.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&?" BEGIN - MENUITEM "&Hilfethemen\tF1", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "Inf&o", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "Befeh&lszeile", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 127, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Task-Manager" IDC_TASKMGR "Task-Manager" IDS_IDLE_PROCESS "Leerlaufprozess" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Anwendungen" IDS_TAB_PROCESSES "Prozesse" IDS_TAB_PERFORMANCE "Systemleistung" diff --git a/base/applications/taskmgr/lang/el-GR.rc b/base/applications/taskmgr/lang/el-GR.rc index 21546d0cc05..31ef7e81676 100644 --- a/base/applications/taskmgr/lang/el-GR.rc +++ b/base/applications/taskmgr/lang/el-GR.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&Βοήθεια" BEGIN - MENUITEM "Θέματα &Βοήθειας του Διαχειριστή Διεργασιών", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Σχετικά με τον Διαχειριστή Διεργασιών", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Task Manager" IDC_TASKMGR "Task Manager" IDS_IDLE_PROCESS "System Idle Process" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Applications" IDS_TAB_PROCESSES "Processes" IDS_TAB_PERFORMANCE "Performance" diff --git a/base/applications/taskmgr/lang/en-US.rc b/base/applications/taskmgr/lang/en-US.rc index 62d291f15cd..9d4ba73c6c3 100644 --- a/base/applications/taskmgr/lang/en-US.rc +++ b/base/applications/taskmgr/lang/en-US.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "&Help" BEGIN - MENUITEM "Task Manager &Help Topics", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&About Task Manager", ID_HELP_ABOUT END END @@ -138,8 +136,6 @@ BEGIN END END -/* Dialogs */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -304,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Task Manager" IDC_TASKMGR "Task Manager" IDS_IDLE_PROCESS "System Idle Process" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Applications" IDS_TAB_PROCESSES "Processes" IDS_TAB_PERFORMANCE "Performance" diff --git a/base/applications/taskmgr/lang/es-ES.rc b/base/applications/taskmgr/lang/es-ES.rc index 0a7f718408b..eaaed798ff6 100644 --- a/base/applications/taskmgr/lang/es-ES.rc +++ b/base/applications/taskmgr/lang/es-ES.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "Ay&uda" BEGIN - MENUITEM "&Temas de Ayuda del Administrador de tareas", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Acerca del Administrador de tareas", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "&Línea de comandos", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 127, 160, 75, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Administrador de tareas" IDC_TASKMGR "Administrador de tareas" IDS_IDLE_PROCESS "Proceso inactivo del sistema" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Aplicaciones" IDS_TAB_PROCESSES "Procesos" IDS_TAB_PERFORMANCE "Rendimiento" diff --git a/base/applications/taskmgr/lang/et-EE.rc b/base/applications/taskmgr/lang/et-EE.rc index 98f35c816a6..0bfc75e0ba7 100644 --- a/base/applications/taskmgr/lang/et-EE.rc +++ b/base/applications/taskmgr/lang/et-EE.rc @@ -1,7 +1,6 @@ -/* - * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) - * TRANSLATOR: Joann Mõndresku - */ +// LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) +// COPYRIGHT: Joann Mõndresku + LANGUAGE LANG_ESTONIAN, SUBLANG_DEFAULT IDR_TASKMANAGER MENU @@ -64,8 +63,6 @@ BEGIN END POPUP "S&pikker" BEGIN - MENUITEM "Tegumihalduri &spikriteemad", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "Teave &Tegumihalduri kohta", ID_HELP_ABOUT END END @@ -142,8 +139,6 @@ BEGIN END END -/* Dialogs */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +303,11 @@ BEGIN CONTROL "K&äsurida", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Tegumihaldur" IDC_TASKMGR "Tegumihaldur" IDS_IDLE_PROCESS "Süsteemi jõudeoleku protsess" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Rakendused" IDS_TAB_PROCESSES "Protsessid" IDS_TAB_PERFORMANCE "Jõudlus" diff --git a/base/applications/taskmgr/lang/fr-FR.rc b/base/applications/taskmgr/lang/fr-FR.rc index bda6eaddb89..732eb0ca3c8 100644 --- a/base/applications/taskmgr/lang/fr-FR.rc +++ b/base/applications/taskmgr/lang/fr-FR.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&Aide" BEGIN - MENUITEM "&Rubriques d'aide du Gestionnaire des tâches", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "À &propos du Gestionnaire des tâches", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "&Ligne de commande", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 129, 160, 95, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Gestionnaire des tâches" IDC_TASKMGR "Gestionnaire des tâches" IDS_IDLE_PROCESS "Processus système en attente" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Applications" IDS_TAB_PROCESSES "Processus" IDS_TAB_PERFORMANCE "Performance" diff --git a/base/applications/taskmgr/lang/he-IL.rc b/base/applications/taskmgr/lang/he-IL.rc index f71721e9131..f4059693c91 100644 --- a/base/applications/taskmgr/lang/he-IL.rc +++ b/base/applications/taskmgr/lang/he-IL.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&עזרה" BEGIN - MENUITEM "&נושאי עזרה של מנהל המשימות", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&אודות מנהל המשימות", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "מנהל המשימות" IDC_TASKMGR "מנהל המשימות" IDS_IDLE_PROCESS "תהליך לא פעיל של המערכת" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "יישומים" IDS_TAB_PROCESSES "תהליכים" IDS_TAB_PERFORMANCE "ביצועים" diff --git a/base/applications/taskmgr/lang/hu-HU.rc b/base/applications/taskmgr/lang/hu-HU.rc index c3de9d79e71..939fa1a5ee8 100644 --- a/base/applications/taskmgr/lang/hu-HU.rc +++ b/base/applications/taskmgr/lang/hu-HU.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&Súgó" BEGIN - MENUITEM "&Témakörök", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Névjegy", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "&Parancssor", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Feladatkezelõ" IDC_TASKMGR "Feladatkezelõ" IDS_IDLE_PROCESS "Üresjárat" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Programok" IDS_TAB_PROCESSES "Folyamatok" IDS_TAB_PERFORMANCE "Performance" diff --git a/base/applications/taskmgr/lang/id-ID.rc b/base/applications/taskmgr/lang/id-ID.rc index 6ade87d4943..2306580f3f0 100644 --- a/base/applications/taskmgr/lang/id-ID.rc +++ b/base/applications/taskmgr/lang/id-ID.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: Zaenal Mutaqin */ +// COPYRIGHT: Zaenal Mutaqin LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT @@ -62,8 +62,6 @@ BEGIN END POPUP "&Help" BEGIN - MENUITEM "Task Manager &Help Topics", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&About Task Manager", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Manajer Tugas" IDC_TASKMGR "Manajer Tugas" IDS_IDLE_PROCESS "Proses Diam Sistem" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Aplikasi" IDS_TAB_PROCESSES "Proses" IDS_TAB_PERFORMANCE "Kinerja" diff --git a/base/applications/taskmgr/lang/it-IT.rc b/base/applications/taskmgr/lang/it-IT.rc index 51719081210..bdbfe978de5 100644 --- a/base/applications/taskmgr/lang/it-IT.rc +++ b/base/applications/taskmgr/lang/it-IT.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "&Aiuto" BEGIN - MENUITEM "Task Manager &Help Topics", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Informazioni su Task Manager", ID_HELP_ABOUT END END @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "&Linea di comando", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 70, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Task Manager" IDC_TASKMGR "Task Manager" IDS_IDLE_PROCESS "Processo Idle di sistema" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Applicazioni" IDS_TAB_PROCESSES "Processi" IDS_TAB_PERFORMANCE "Prestazioni" diff --git a/base/applications/taskmgr/lang/ja-JP.rc b/base/applications/taskmgr/lang/ja-JP.rc index 6d1a0a067eb..5b19b8547b0 100644 --- a/base/applications/taskmgr/lang/ja-JP.rc +++ b/base/applications/taskmgr/lang/ja-JP.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "ヘルプ(&H)" BEGIN - MENUITEM "トピックの検索(&H)", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "バージョン情報(&A)", ID_HELP_ABOUT END END @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "タスク マネージャ" IDC_TASKMGR "タスク マネージャ" IDS_IDLE_PROCESS "System Idle Process" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "アプリケーション" IDS_TAB_PROCESSES "プロセス" IDS_TAB_PERFORMANCE "パフォーマンス" diff --git a/base/applications/taskmgr/lang/ko-KR.rc b/base/applications/taskmgr/lang/ko-KR.rc index 9f9499b46e7..d71355775cd 100644 --- a/base/applications/taskmgr/lang/ko-KR.rc +++ b/base/applications/taskmgr/lang/ko-KR.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "도움말(&H)" BEGIN - MENUITEM "작업 관리자 도움말 항목(&H)", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "작업 관리자 정보(&A)", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "작업 관리자" IDC_TASKMGR "작업 관리자" IDS_IDLE_PROCESS "System Idle Process" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "응용 프로그램" IDS_TAB_PROCESSES "프로세스" IDS_TAB_PERFORMANCE "성능" diff --git a/base/applications/taskmgr/lang/nl-NL.rc b/base/applications/taskmgr/lang/nl-NL.rc index 6172da32011..624ee50340e 100644 --- a/base/applications/taskmgr/lang/nl-NL.rc +++ b/base/applications/taskmgr/lang/nl-NL.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "&Help" BEGIN - MENUITEM "&Help-onderwerpen", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Info", ID_HELP_ABOUT END END @@ -121,11 +119,11 @@ IDR_PROCESS_PAGE_CONTEXT MENU BEGIN POPUP "" BEGIN - MENUITEM "&Proces beëindigen", ID_PROCESS_PAGE_ENDPROCESS + MENUITEM "Pro&ces beëindigen", ID_PROCESS_PAGE_ENDPROCESS MENUITEM "Process&tructuur beëindigen", ID_PROCESS_PAGE_ENDPROCESSTREE MENUITEM "&Fouten opsporen", ID_PROCESS_PAGE_DEBUG MENUITEM SEPARATOR - POPUP "P&rioriteit instellen" + POPUP "&Prioriteit instellen" BEGIN MENUITEM "&Realtime", ID_PROCESS_PAGE_SETPRIORITY_REALTIME MENUITEM "&Hoog", ID_PROCESS_PAGE_SETPRIORITY_HIGH @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 117, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Taakbeheer" IDC_TASKMGR "Taakbeheer" IDS_IDLE_PROCESS "Niet-actieve systeemprocessen" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Toepassingen" IDS_TAB_PROCESSES "Procesnaam" IDS_TAB_PERFORMANCE "Prestaties" diff --git a/base/applications/taskmgr/lang/no-NO.rc b/base/applications/taskmgr/lang/no-NO.rc index 44f26ec87e5..e51a5cb0317 100644 --- a/base/applications/taskmgr/lang/no-NO.rc +++ b/base/applications/taskmgr/lang/no-NO.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "&Hjelp" BEGIN - MENUITEM "Emner i &hjelp for Oppgavebehandling", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Om Oppgavebehandling", ID_HELP_ABOUT END END @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Oppgavebehandling" IDC_TASKMGR "Oppgavebehandling" IDS_IDLE_PROCESS "System Idle Process" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Programmer" IDS_TAB_PROCESSES "Prosesser" IDS_TAB_PERFORMANCE "Ytelse" diff --git a/base/applications/taskmgr/lang/pl-PL.rc b/base/applications/taskmgr/lang/pl-PL.rc index d4bd9e14ffc..7c35c6e0187 100644 --- a/base/applications/taskmgr/lang/pl-PL.rc +++ b/base/applications/taskmgr/lang/pl-PL.rc @@ -67,8 +67,6 @@ BEGIN END POPUP "Pomo&c" BEGIN - MENUITEM "Menedżer zadań - tematy &pomocy", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "Menedżer zadań - &informacje", ID_HELP_ABOUT END END @@ -145,10 +143,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -313,17 +307,11 @@ BEGIN CONTROL "Linia poleceń", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 85, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Menedżer zadań" IDC_TASKMGR "Menedżer zadań" IDS_IDLE_PROCESS "Proces bezczynności systemu" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Aplikacje" IDS_TAB_PROCESSES "Procesy" IDS_TAB_PERFORMANCE "Wydajność" diff --git a/base/applications/taskmgr/lang/pt-BR.rc b/base/applications/taskmgr/lang/pt-BR.rc index 0226097358a..a2f5c241eb5 100644 --- a/base/applications/taskmgr/lang/pt-BR.rc +++ b/base/applications/taskmgr/lang/pt-BR.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "Aj&uda" BEGIN - MENUITEM "&Tópicos da Ajuda do Gerenciador de tarefas", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "So&bre o Gerenciador de tarefas", ID_HELP_ABOUT END END @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 123, 160, 95, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Gerenciador de tarefas" IDC_TASKMGR "Gerenciador de tarefas" IDS_IDLE_PROCESS "Processo inativo do sistema" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Aplicativos" IDS_TAB_PROCESSES "Processos" IDS_TAB_PERFORMANCE "Performance" diff --git a/base/applications/taskmgr/lang/ro-RO.rc b/base/applications/taskmgr/lang/ro-RO.rc index 4dbc8ad94fc..4e2564cf2dc 100644 --- a/base/applications/taskmgr/lang/ro-RO.rc +++ b/base/applications/taskmgr/lang/ro-RO.rc @@ -65,8 +65,6 @@ BEGIN END POPUP "Aj&utor" BEGIN - MENUITEM "&Manual…", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Despre…", ID_HELP_ABOUT END END @@ -143,10 +141,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -311,17 +305,11 @@ BEGIN CONTROL "Linie de comandă", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 120, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Gestionar de activități" IDC_TASKMGR "Gestionar de activități" IDS_IDLE_PROCESS "Proces de inactivitate sistem" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Aplicații" IDS_TAB_PROCESSES "Procese" IDS_TAB_PERFORMANCE "Performanță" diff --git a/base/applications/taskmgr/lang/ru-RU.rc b/base/applications/taskmgr/lang/ru-RU.rc index 3fce9a493a9..19bb72c7caf 100644 --- a/base/applications/taskmgr/lang/ru-RU.rc +++ b/base/applications/taskmgr/lang/ru-RU.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&Справка" BEGIN - MENUITEM "&Вызов справки", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&О программе...", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "Коммандная строка", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 90, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Диспетчер задач" IDC_TASKMGR "Диспетчер задач" IDS_IDLE_PROCESS "Бездействие системы" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Приложения" IDS_TAB_PROCESSES "Процессы" IDS_TAB_PERFORMANCE "Быстродействие" diff --git a/base/applications/taskmgr/lang/sk-SK.rc b/base/applications/taskmgr/lang/sk-SK.rc index 3e0f2c20507..80a8af1185d 100644 --- a/base/applications/taskmgr/lang/sk-SK.rc +++ b/base/applications/taskmgr/lang/sk-SK.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&Pomocník" BEGIN - MENUITEM "Témy &Pomocníka pre Správcu úloh", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "Č&o je &Správca úloh", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 130, 160, 95, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Správca úloh systému" IDC_TASKMGR "Správca úloh systému" IDS_IDLE_PROCESS "Procesy systémovej nečinnosti" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Aplikácie" IDS_TAB_PROCESSES "Procesy" IDS_TAB_PERFORMANCE "Výkon" diff --git a/base/applications/taskmgr/lang/sq-AL.rc b/base/applications/taskmgr/lang/sq-AL.rc index dc7bbc0c9a3..7f75c21116e 100644 --- a/base/applications/taskmgr/lang/sq-AL.rc +++ b/base/applications/taskmgr/lang/sq-AL.rc @@ -63,8 +63,6 @@ BEGIN END POPUP "Ndihme" BEGIN - MENUITEM "Task Manager &Ndihme me teme", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "Rreth Task Menager", ID_HELP_ABOUT END END @@ -141,8 +139,6 @@ BEGIN END END -/* Dialogs */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -307,17 +303,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Task Manager" IDC_TASKMGR "Task Manager" IDS_IDLE_PROCESS "Procese te papune te sistemit" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Aplikacione" IDS_TAB_PROCESSES "Procese" IDS_TAB_PERFORMANCE "Performanca" diff --git a/base/applications/taskmgr/lang/sv-SE.rc b/base/applications/taskmgr/lang/sv-SE.rc index e267ad92f21..f0ba21cce1f 100644 --- a/base/applications/taskmgr/lang/sv-SE.rc +++ b/base/applications/taskmgr/lang/sv-SE.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&Hjälp" BEGIN - MENUITEM "Aktivitetshanteraren &hjälpavsnitt", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Om Aktivitetshanteraren", ID_HELP_ABOUT END END @@ -140,10 +138,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -308,17 +302,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 133, 160, 95, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Aktivitetshanteraren" IDC_TASKMGR "Aktivitetshanteraren" IDS_IDLE_PROCESS "Systemets lediga resurser" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Program" IDS_TAB_PROCESSES "Processer" IDS_TAB_PERFORMANCE "Prestanda" diff --git a/base/applications/taskmgr/lang/tr-TR.rc b/base/applications/taskmgr/lang/tr-TR.rc index c303af4395f..43cb7640ed1 100644 --- a/base/applications/taskmgr/lang/tr-TR.rc +++ b/base/applications/taskmgr/lang/tr-TR.rc @@ -62,8 +62,6 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Görev Yöneticisi Yardım Konuları", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Görev Yöneticisi Hakkında", ID_HELP_ABOUT END END @@ -140,8 +138,6 @@ BEGIN END END -/* Dialogs */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +302,11 @@ BEGIN CONTROL "Komut Satırı", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Görev Yöneticisi" IDC_TASKMGR "Görev Yöneticisi" IDS_IDLE_PROCESS "Boş Sistem İşlemi" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Uygulamalar" IDS_TAB_PROCESSES "İşlemler" IDS_TAB_PERFORMANCE "Başarım" diff --git a/base/applications/taskmgr/lang/uk-UA.rc b/base/applications/taskmgr/lang/uk-UA.rc index c1500c9352d..656a64f724c 100644 --- a/base/applications/taskmgr/lang/uk-UA.rc +++ b/base/applications/taskmgr/lang/uk-UA.rc @@ -60,8 +60,6 @@ BEGIN END POPUP "&Довідка" BEGIN - MENUITEM "&Зміст", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "&Про Диспетчер завдань", ID_HELP_ABOUT END END @@ -138,10 +136,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -306,17 +300,11 @@ BEGIN CONTROL "Command &Line", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "Диспетчер завдань" IDC_TASKMGR "Диспетчер завдань" IDS_IDLE_PROCESS "Бездіяльність системи" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "Додатки" IDS_TAB_PROCESSES "Процеси" IDS_TAB_PERFORMANCE "Швидкодія" diff --git a/base/applications/taskmgr/lang/zh-CN.rc b/base/applications/taskmgr/lang/zh-CN.rc index b14ae2589f2..a74c180851a 100644 --- a/base/applications/taskmgr/lang/zh-CN.rc +++ b/base/applications/taskmgr/lang/zh-CN.rc @@ -67,8 +67,6 @@ BEGIN END POPUP "帮助(&H)" BEGIN - MENUITEM "任务管理器帮助主题(&H)", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "关于任务管理器(&A)", ID_HELP_ABOUT END END @@ -145,10 +143,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -313,17 +307,11 @@ BEGIN CONTROL "命令行(&L)", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "任务管理器" IDC_TASKMGR "任务管理器" IDS_IDLE_PROCESS "系统空闲进程" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "应用程序" IDS_TAB_PROCESSES "进程" IDS_TAB_PERFORMANCE "性能" @@ -377,7 +365,7 @@ BEGIN IDS_MSG_UNABLETERMINATEPRO "无法终止进程" IDS_MSG_CLOSESYSTEMPROCESS "这是一个至关重要的系统进程。任务管理器不会结束这一进程。" IDS_MSG_UNABLECHANGEPRIORITY "无法更改优先级" - IDS_MSG_WARNINGCHANGEPRIORITY "警告: 改变这一进程的优先级可能会\n导致意外的结果,包括系统不稳定。 您确定\n要更改优先级类?" + IDS_MSG_WARNINGCHANGEPRIORITY "警告:改变这一进程的优先级可能会\n导致意外的结果,包括系统不稳定。 您确定\n要更改优先级类?" IDS_MSG_TRAYICONCPUUSAGE "CPU 使用情况: %d%%" IDS_STATUS_MEMUSAGE "内存使用情况: %s / %s (%d%%)" IDS_STATUS_CPUUSAGE "CPU 使用情况: %3d%%" diff --git a/base/applications/taskmgr/lang/zh-TW.rc b/base/applications/taskmgr/lang/zh-TW.rc index 0f2bc6d7307..9733c7fa68c 100644 --- a/base/applications/taskmgr/lang/zh-TW.rc +++ b/base/applications/taskmgr/lang/zh-TW.rc @@ -1,7 +1,5 @@ -/* - * LICENSE: GPL - See COPYING in the top level directory - * TRANSLATOR: Elton Chung - */ +// LICENSE: GPL - See COPYING in the top level directory +// COPYRIGHT: Elton Chung LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL @@ -65,8 +63,6 @@ BEGIN END POPUP "說明(&H)" BEGIN - MENUITEM "工作管理員說明主题(&H)", ID_HELP_TOPICS - MENUITEM SEPARATOR MENUITEM "關於工作管理員(&A)", ID_HELP_ABOUT END END @@ -143,10 +139,6 @@ BEGIN END END -/* Dialogs */ - -/* TRANSLATORS: CAPTION must be the same as IDS_APP_TITLE to be brought back to focus when already opened */ - IDD_TASKMGR_DIALOG DIALOGEX 0, 0, 264, 246 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -311,17 +303,11 @@ BEGIN CONTROL "命令列(&L)", IDC_COMMANDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 107, 160, 65, 10 END -/* String Tables */ - STRINGTABLE BEGIN IDS_APP_TITLE "工作管理員" IDC_TASKMGR "工作管理員" IDS_IDLE_PROCESS "系統空閒處理序" -END - -STRINGTABLE -BEGIN IDS_TAB_APPS "應用程式" IDS_TAB_PROCESSES "處理程序" IDS_TAB_PERFORMANCE "性能" diff --git a/base/applications/taskmgr/perfdata.c b/base/applications/taskmgr/perfdata.c index 8ec67412d0b..293e3a3a18f 100644 --- a/base/applications/taskmgr/perfdata.c +++ b/base/applications/taskmgr/perfdata.c @@ -91,9 +91,8 @@ void PerfDataUninitialize(void) HeapFree(GetProcessHeap(), 0, pEntry); } - if (SystemProcessorTimeInfo) { + if (SystemProcessorTimeInfo) HeapFree(GetProcessHeap(), 0, SystemProcessorTimeInfo); - } } static void SidToUserName(PSID Sid, LPWSTR szBuffer, DWORD BufferSize) @@ -257,18 +256,16 @@ void PerfDataRefresh(void) /* If it's a first call - skip idle time calcs */ if (liOldIdleTime.QuadPart != 0) { - /* CurrentValue = NewValue - OldValue */ + // CurrentValue = NewValue - OldValue dbIdleTime = Li2Double(SysPerfInfo.IdleProcessTime) - Li2Double(liOldIdleTime); dbKernelTime = CurrentKernelTime - OldKernelTime; dbSystemTime = Li2Double(SysTimeInfo.CurrentTime) - Li2Double(liOldSystemTime); - /* CurrentCpuIdle = IdleTime / SystemTime */ dbIdleTime = dbIdleTime / dbSystemTime; dbKernelTime = dbKernelTime / dbSystemTime; - /* CurrentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors */ - dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */ - dbKernelTime = 100.0 - dbKernelTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */ + dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; + dbKernelTime = 100.0 - dbKernelTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; } /* Store new CPU's idle and system time */ @@ -320,11 +317,11 @@ void PerfDataRefresh(void) pPerfData[Idx].ProcessId = pSPI->UniqueProcessId; - if (pPDOld) { + if (pPDOld) { double CurTime = Li2Double(pSPI->KernelTime) + Li2Double(pSPI->UserTime); double OldTime = Li2Double(pPDOld->KernelTime) + Li2Double(pPDOld->UserTime); double CpuTime = (CurTime - OldTime) / dbSystemTime; - CpuTime = CpuTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; /* + 0.5; */ + CpuTime = CpuTime * 100.0 / (double)SystemBasicInfo.NumberOfProcessors; pPerfData[Idx].CPUUsage = (ULONG)CpuTime; } pPerfData[Idx].CPUTime.QuadPart = pSPI->UserTime.QuadPart + pSPI->KernelTime.QuadPart; @@ -390,25 +387,22 @@ ReadProcOwner: } else { ClearInfo: /* clear information we were unable to fetch */ - ZeroMemory(&pPerfData[Idx].IOCounters, sizeof(IO_COUNTERS)); + memset(&pPerfData[Idx].IOCounters, 0, sizeof(IO_COUNTERS)); } cwcUserName = _countof(pPerfData[0].UserName); CachedGetUserFromSid(ProcessUser, pPerfData[Idx].UserName, &cwcUserName); if (ProcessSD != NULL) - { LocalFree((HLOCAL)ProcessSD); - } pPerfData[Idx].UserTime.QuadPart = pSPI->UserTime.QuadPart; pPerfData[Idx].KernelTime.QuadPart = pSPI->KernelTime.QuadPart; pSPI = (PSYSTEM_PROCESS_INFORMATION)((LPBYTE)pSPI + pSPI->NextEntryOffset); } HeapFree(GetProcessHeap(), 0, pBuffer); - if (pPerfDataOld) { + if (pPerfDataOld) HeapFree(GetProcessHeap(), 0, pPerfDataOld); - } pPerfDataOld = pPerfData; LeaveCriticalSection(&PerfDataCriticalSection); } @@ -422,17 +416,13 @@ ULONG PerfDataGetProcessIndex(ULONG pid) for (idx = 0; idx < ProcessCount; idx++) { if (PtrToUlong(pPerfData[idx].ProcessId) == pid) - { break; - } } LeaveCriticalSection(&PerfDataCriticalSection); if (idx == ProcessCount) - { return -1; - } return idx; } @@ -625,16 +615,15 @@ cleanup: void PerfDataDeallocCommandLineCache() { - PCMD_LINE_CACHE cache = global_cache; - PCMD_LINE_CACHE cache_old; + PCMD_LINE_CACHE cache, pnext; - while (cache && cache->pnext != NULL) + for (cache = global_cache; cache; cache = pnext) { - cache_old = cache; - cache = cache->pnext; - - HeapFree(GetProcessHeap(), 0, cache_old); + pnext = cache->pnext; + HeapFree(GetProcessHeap(), 0, cache); } + + global_cache = NULL; } ULONG PerfDataGetSessionId(ULONG Index) @@ -1088,9 +1077,7 @@ ULONG PerfDataGetTotalThreadCount(void) EnterCriticalSection(&PerfDataCriticalSection); for (i=0; iProcessId == dwProcessId) - { return i; - } } return 0; } @@ -160,7 +157,6 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) /* Refresh page */ ProcessPageUpdate(); - return TRUE; case WM_DESTROY: @@ -177,8 +173,8 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) /* Handle the button clicks */ switch (LOWORD(wParam)) { - case IDC_ENDPROCESS: - ProcessPage_OnEndProcess(); + case IDC_ENDPROCESS: + ProcessPage_OnEndProcess(); } break; @@ -248,31 +244,21 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam) case LVN_ITEMCHANGED: ProcessPageUpdate(); break; - case LVN_GETDISPINFO: - if (!(pnmdi->item.mask & LVIF_TEXT)) break; - pData = (LPPROCESS_PAGE_LIST_ITEM)pnmdi->item.lParam; Index = PerfDataGetProcessIndex(pData->ProcessId); ColumnIndex = pnmdi->item.iSubItem; - PerfDataGetText(Index, ColumnIndex, pnmdi->item.pszText, (ULONG)pnmdi->item.cchTextMax); - break; - case NM_RCLICK: - ProcessPageShowContextMenu(GetSelectedProcessId()); break; - case LVN_KEYDOWN: - if (((LPNMLVKEYDOWN)lParam)->wVKey == VK_DELETE) ProcessPage_OnEndProcess(); break; - } } else if (pnmh->hwndFrom == hProcessPageHeaderCtrl) @@ -280,25 +266,16 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam) switch (pnmh->code) { case HDN_ITEMCLICK: - TaskManagerSettings.SortColumn = ColumnDataHints[pnmhdr->iItem]; TaskManagerSettings.SortAscending = !TaskManagerSettings.SortAscending; (void)ListView_SortItems(hProcessPageListCtrl, ProcessPageCompareFunc, NULL); - break; - case HDN_ITEMCHANGED: - UpdateColumnDataHints(); - break; - case HDN_ENDDRAG: - UpdateColumnDataHints(); - break; - } } } @@ -351,7 +328,7 @@ void ProcessPageShowContextMenu(DWORD dwProcessId) if (si.dwNumberOfProcessors < 2) RemoveMenu(hSubMenu, ID_PROCESS_PAGE_SETAFFINITY, MF_BYCOMMAND); - switch (dwProcessPriorityClass) { + switch (dwProcessPriorityClass) { case REALTIME_PRIORITY_CLASS: CheckMenuRadioItem(hPriorityMenu, ID_PROCESS_PAGE_SETPRIORITY_REALTIME, ID_PROCESS_PAGE_SETPRIORITY_LOW, ID_PROCESS_PAGE_SETPRIORITY_REALTIME, MF_BYCOMMAND); break; @@ -405,13 +382,12 @@ DWORD WINAPI ProcessPageRefreshThread(void *lpParameter) { MSG msg; - while (1) { - /* Wait for an the event or application close */ + for (;;) { + // Wait for an the event or application close if (GetMessage(&msg, NULL, 0, 0) <= 0) return 0; if (msg.message == WM_TIMER) { - UpdateProcesses(); if (IsWindowVisible(hProcessPage)) @@ -452,15 +428,11 @@ void UpdateProcesses() { /* Add new processes by checking against the current items */ for (l = 0; l < PerfDataGetProcessCount(); l++) - { AddProcess(l); - } } if (TaskManagerSettings.SortColumn != -1) - { (void)ListView_SortItems(hProcessPageListCtrl, ProcessPageCompareFunc, NULL); - } SendMessage(hProcessPageListCtrl, WM_SETREDRAW, TRUE, 0); @@ -471,12 +443,6 @@ void UpdateProcesses() ListView_SetItemState(hProcessPageListCtrl, 0, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED); bProcessPageSelectionMade = TRUE; } - /* - else - { - bProcessPageSelectionMade = FALSE; - } - */ } BOOL ProcessRunning(ULONG ProcessId) @@ -484,14 +450,12 @@ BOOL ProcessRunning(ULONG ProcessId) HANDLE hProcess; DWORD exitCode; - if (ProcessId == 0) { + if (ProcessId == 0) return TRUE; - } hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessId); - if (hProcess == NULL) { + if (hProcess == NULL) return FALSE; - } if (GetExitCodeProcess(hProcess, &exitCode)) { CloseHandle(hProcess); @@ -544,22 +508,29 @@ void AddProcess(ULONG Index) BOOL PerfDataGetText(ULONG Index, ULONG ColumnIndex, LPTSTR lpText, ULONG nMaxCount) { IO_COUNTERS iocounters; - LARGE_INTEGER time; - if (ColumnDataHints[ColumnIndex] == COLUMN_IMAGENAME) + switch (ColumnDataHints[ColumnIndex]) { + case COLUMN_IMAGENAME: PerfDataGetImageName(Index, lpText, nMaxCount); - if (ColumnDataHints[ColumnIndex] == COLUMN_PID) + return TRUE; + case COLUMN_PID: wsprintfW(lpText, L"%lu", PerfDataGetProcessId(Index)); - if (ColumnDataHints[ColumnIndex] == COLUMN_USERNAME) + return TRUE; + case COLUMN_USERNAME: PerfDataGetUserName(Index, lpText, nMaxCount); - if (ColumnDataHints[ColumnIndex] == COLUMN_COMMANDLINE) + return TRUE; + case COLUMN_COMMANDLINE: PerfDataGetCommandLine(Index, lpText, nMaxCount); - if (ColumnDataHints[ColumnIndex] == COLUMN_SESSIONID) + return TRUE; + case COLUMN_SESSIONID: wsprintfW(lpText, L"%lu", PerfDataGetSessionId(Index)); - if (ColumnDataHints[ColumnIndex] == COLUMN_CPUUSAGE) + return TRUE; + case COLUMN_CPUUSAGE: wsprintfW(lpText, L"%02lu", PerfDataGetCPUUsage(Index)); - if (ColumnDataHints[ColumnIndex] == COLUMN_CPUTIME) + return TRUE; + case COLUMN_CPUTIME: { + LARGE_INTEGER time; DWORD dwHours; DWORD dwMinutes; DWORD dwSeconds; @@ -567,116 +538,100 @@ BOOL PerfDataGetText(ULONG Index, ULONG ColumnIndex, LPTSTR lpText, ULONG nMaxCo time = PerfDataGetCPUTime(Index); gethmsfromlargeint(time, &dwHours, &dwMinutes, &dwSeconds); wsprintfW(lpText, L"%lu:%02lu:%02lu", dwHours, dwMinutes, dwSeconds); + return TRUE; } - if (ColumnDataHints[ColumnIndex] == COLUMN_MEMORYUSAGE) - { + case COLUMN_MEMORYUSAGE: wsprintfW(lpText, L"%lu", PerfDataGetWorkingSetSizeBytes(Index) / 1024); CommaSeparateNumberString(lpText, nMaxCount); wcscat(lpText, L" K"); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_PEAKMEMORYUSAGE) - { + return TRUE; + case COLUMN_PEAKMEMORYUSAGE: wsprintfW(lpText, L"%lu", PerfDataGetPeakWorkingSetSizeBytes(Index) / 1024); CommaSeparateNumberString(lpText, nMaxCount); wcscat(lpText, L" K"); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_MEMORYUSAGEDELTA) - { + return TRUE; + case COLUMN_MEMORYUSAGEDELTA: wsprintfW(lpText, L"%lu", PerfDataGetWorkingSetSizeDelta(Index) / 1024); CommaSeparateNumberString(lpText, nMaxCount); wcscat(lpText, L" K"); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEFAULTS) - { + return TRUE; + case COLUMN_PAGEFAULTS: wsprintfW(lpText, L"%lu", PerfDataGetPageFaultCount(Index)); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEFAULTSDELTA) - { + return TRUE; + case COLUMN_PAGEFAULTSDELTA: wsprintfW(lpText, L"%lu", PerfDataGetPageFaultCountDelta(Index)); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_VIRTUALMEMORYSIZE) - { + return TRUE; + case COLUMN_VIRTUALMEMORYSIZE: wsprintfW(lpText, L"%lu", PerfDataGetVirtualMemorySizeBytes(Index) / 1024); CommaSeparateNumberString(lpText, nMaxCount); wcscat(lpText, L" K"); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_PAGEDPOOL) - { + return TRUE; + case COLUMN_PAGEDPOOL: wsprintfW(lpText, L"%lu", PerfDataGetPagedPoolUsagePages(Index) / 1024); CommaSeparateNumberString(lpText, nMaxCount); wcscat(lpText, L" K"); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_NONPAGEDPOOL) - { + return TRUE; + case COLUMN_NONPAGEDPOOL: wsprintfW(lpText, L"%lu", PerfDataGetNonPagedPoolUsagePages(Index) / 1024); CommaSeparateNumberString(lpText, nMaxCount); wcscat(lpText, L" K"); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_BASEPRIORITY) + return TRUE; + case COLUMN_BASEPRIORITY: wsprintfW(lpText, L"%lu", PerfDataGetBasePriority(Index)); - if (ColumnDataHints[ColumnIndex] == COLUMN_HANDLECOUNT) - { + return TRUE; + case COLUMN_HANDLECOUNT: wsprintfW(lpText, L"%lu", PerfDataGetHandleCount(Index)); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_THREADCOUNT) - { + return TRUE; + case COLUMN_THREADCOUNT: wsprintfW(lpText, L"%lu", PerfDataGetThreadCount(Index)); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_USEROBJECTS) - { + return TRUE; + case COLUMN_USEROBJECTS: wsprintfW(lpText, L"%lu", PerfDataGetUSERObjectCount(Index)); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_GDIOBJECTS) - { + return TRUE; + case COLUMN_GDIOBJECTS: wsprintfW(lpText, L"%lu", PerfDataGetGDIObjectCount(Index)); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_IOREADS) - { + return TRUE; + case COLUMN_IOREADS: PerfDataGetIOCounters(Index, &iocounters); _ui64tow(iocounters.ReadOperationCount, lpText, 10); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_IOWRITES) - { + return TRUE; + case COLUMN_IOWRITES: PerfDataGetIOCounters(Index, &iocounters); _ui64tow(iocounters.WriteOperationCount, lpText, 10); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_IOOTHER) - { + return TRUE; + case COLUMN_IOOTHER: PerfDataGetIOCounters(Index, &iocounters); _ui64tow(iocounters.OtherOperationCount, lpText, 10); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_IOREADBYTES) - { + return TRUE; + case COLUMN_IOREADBYTES: PerfDataGetIOCounters(Index, &iocounters); _ui64tow(iocounters.ReadTransferCount, lpText, 10); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_IOWRITEBYTES) - { + return TRUE; + case COLUMN_IOWRITEBYTES: PerfDataGetIOCounters(Index, &iocounters); _ui64tow(iocounters.WriteTransferCount, lpText, 10); CommaSeparateNumberString(lpText, nMaxCount); - } - if (ColumnDataHints[ColumnIndex] == COLUMN_IOOTHERBYTES) - { + return TRUE; + case COLUMN_IOOTHERBYTES: PerfDataGetIOCounters(Index, &iocounters); _ui64tow(iocounters.OtherTransferCount, lpText, 10); CommaSeparateNumberString(lpText, nMaxCount); + return TRUE; } return FALSE; } - void gethmsfromlargeint(LARGE_INTEGER largeint, DWORD *dwHours, DWORD *dwMinutes, DWORD *dwSeconds) { #ifdef _MSC_VER @@ -707,9 +662,7 @@ int largeintcmp(LARGE_INTEGER l1, LARGE_INTEGER l2) { ret = CMP(dwMinutes1, dwMinutes2); if (ret == 0) - { ret = CMP(dwSeconds1, dwSeconds2); - } } return ret; } diff --git a/base/applications/taskmgr/resource.h b/base/applications/taskmgr/resource.h index d7352677614..fad4eac132b 100644 --- a/base/applications/taskmgr/resource.h +++ b/base/applications/taskmgr/resource.h @@ -150,7 +150,6 @@ #define ID_WINDOWS_MAXIMIZE 32788 #define ID_WINDOWS_CASCADE 32789 #define ID_WINDOWS_BRINGTOFRONT 32790 -#define ID_HELP_TOPICS 32791 #define ID_HELP_ABOUT 32792 #define ID_FILE_EXIT 32793 #define ID_OPTIONS_SHOW16BITTASKS 32794 diff --git a/base/applications/taskmgr/taskmgr.c b/base/applications/taskmgr/taskmgr.c index 58f0244c58a..424646451bd 100644 --- a/base/applications/taskmgr/taskmgr.c +++ b/base/applications/taskmgr/taskmgr.c @@ -15,47 +15,27 @@ #define STATUS_WINDOW 2001 -/* Global Variables: */ HINSTANCE hInst; /* current instance */ - HWND hMainWnd; /* Main Window */ HWND hStatusWnd; /* Status Bar Window */ HWND hTabWnd; /* Tab Control Window */ - HMENU hWindowMenu = NULL; - int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */ int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */ - int nOldWidth; /* Holds the previous client area width */ int nOldHeight; /* Holds the previous client area height */ - BOOL bWasKeyboardInput = FALSE; /* TabChange by Keyboard or Mouse ? */ TASKMANAGER_SETTINGS TaskManagerSettings; -//////////////////////////////////////////////////////////////////////////////// -// Taken from WinSpy++ 1.7 -// http://www.catch22.net/software/winspy -// Copyright (c) 2002 by J Brown -// - -// -// Copied from uxtheme.h -// If you have this new header, then delete these and -// #include instead! -// #define ETDT_DISABLE 0x00000001 #define ETDT_ENABLE 0x00000002 #define ETDT_USETABTEXTURE 0x00000004 #define ETDT_ENABLETAB (ETDT_ENABLE | ETDT_USETABTEXTURE) -// typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD); -// // Try to call EnableThemeDialogTexture, if uxtheme.dll is present -// BOOL EnableDialogTheme(HWND hwnd) { HMODULE hUXTheme; @@ -99,7 +79,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, TOKEN_PRIVILEGES tkp; HANDLE hMutex; - /* check wether we're already running or not */ hMutex = CreateMutexW(NULL, TRUE, L"taskmgrros"); if (hMutex && GetLastError() == ERROR_ALREADY_EXISTS) { @@ -152,10 +131,8 @@ int APIENTRY wWinMain(HINSTANCE hInstance, CloseHandle(hToken); } - /* Load our settings from the registry */ LoadSettings(); - /* Initialize perf data */ if (!PerfDataInitialize()) return -1; @@ -167,7 +144,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, DialogBoxW(hInst, (LPCWSTR)IDD_TASKMGR_DIALOG, NULL, TaskManagerWndProc); - /* Save our settings to the registry */ SaveSettings(); PerfDataUninitialize(); CloseHandle(hMutex); @@ -176,7 +152,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, return 0; } -/* Message handler for dialog box. */ INT_PTR CALLBACK TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { @@ -186,8 +161,6 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) switch (message) { case WM_INITDIALOG: - // For now, the Help dialog menu item is disabled because of lacking of HTML Help support - EnableMenuItem(GetMenu(hDlg), ID_HELP_TOPICS, MF_BYCOMMAND | MF_GRAYED); hMainWnd = hDlg; return OnCreate(hDlg); @@ -300,8 +273,6 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case ID_PROCESS_PAGE_SETPRIORITY_LOW: DoSetPriority(IDLE_PRIORITY_CLASS); break; - -/* ShutDown items */ case ID_SHUTDOWN_STANDBY: ShutDown_StandBy(); break; @@ -329,7 +300,6 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case ID_SHUTDOWN_EJECT_COMPUTER: ShutDown_EjectComputer(); break; - case ID_HELP_ABOUT: OnAbout(); break; @@ -338,12 +308,11 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) break; } break; - case WM_ONTRAYICON: switch(lParam) { case WM_RBUTTONDOWN: - { + { POINT pt; BOOL OnTop; HMENU hMenu, hPopupMenu; @@ -370,13 +339,12 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) DestroyMenu(hMenu); break; - } + } case WM_LBUTTONDBLCLK: TaskManager_OnRestoreMainWindow(); break; } break; - case WM_NOTIFY: pnmh = (LPNMHDR)lParam; if ((pnmh->hwndFrom == hTabWnd) && @@ -396,7 +364,6 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) } } break; - case WM_SIZING: /* Make sure the user is sizing the dialog */ /* in an acceptable range */ @@ -420,18 +387,9 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) pRC->bottom = pRC->top + nMinimumHeight; } return TRUE; - break; - case WM_SIZE: - /* Handle the window sizing in it's own function */ OnSize(wParam, LOWORD(lParam), HIWORD(lParam)); break; - - case WM_MOVE: - /* Handle the window moving in it's own function */ - OnMove(wParam, LOWORD(lParam), HIWORD(lParam)); - break; - case WM_DESTROY: ShowWindow(hDlg, SW_HIDE); TrayIcon_RemoveIcon(); @@ -450,16 +408,13 @@ TaskManagerWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if (hWindowMenu) DestroyMenu(hWindowMenu); return DefWindowProcW(hDlg, message, wParam, lParam); - case WM_TIMER: - /* Refresh the performance data */ PerfDataRefresh(); RefreshApplicationPage(); RefreshProcessPage(); RefreshPerformancePage(); TrayIcon_UpdateIcon(); break; - case WM_SYSCOLORCHANGE: /* Forward WM_SYSCOLORCHANGE to common controls */ SendMessage(hApplicationPageListCtrl, WM_SYSCOLORCHANGE, 0, 0); @@ -512,7 +467,6 @@ BOOL OnCreate(HWND hWnd) SendMessageW(hMainWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIconW(hInst, MAKEINTRESOURCEW(IDI_TASKMANAGER))); - /* Initialize the Windows Common Controls DLL */ InitCommonControls(); /* Get the minimum window sizes */ @@ -533,15 +487,9 @@ BOOL OnCreate(HWND hWnd) /* Create tab pages */ hTabWnd = GetDlgItem(hWnd, IDC_TAB); -#if 1 hApplicationPage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_APPLICATION_PAGE), hWnd, ApplicationPageWndProc); EnableDialogTheme(hApplicationPage); hProcessPage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_PROCESS_PAGE), hWnd, ProcessPageWndProc); EnableDialogTheme(hProcessPage); hPerformancePage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_PERFORMANCE_PAGE), hWnd, PerformancePageWndProc); EnableDialogTheme(hPerformancePage); -#else - hApplicationPage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_APPLICATION_PAGE), hTabWnd, ApplicationPageWndProc); EnableDialogTheme(hApplicationPage); - hProcessPage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_PROCESS_PAGE), hTabWnd, ProcessPageWndProc); EnableDialogTheme(hProcessPage); - hPerformancePage = CreateDialogW(hInst, MAKEINTRESOURCEW(IDD_PERFORMANCE_PAGE), hTabWnd, PerformancePageWndProc); EnableDialogTheme(hPerformancePage); -#endif /* Insert tabs */ LoadStringW(hInst, IDS_TAB_APPS, szTemp, 256); @@ -564,13 +512,6 @@ BOOL OnCreate(HWND hWnd) GetClientRect(hWnd, &rc); nOldWidth = rc.right; nOldHeight = rc.bottom; - /* nOldStartX = rc.left; */ - /*nOldStartY = rc.top; */ - -#define PAGE_OFFSET_LEFT 17 -#define PAGE_OFFSET_TOP 72 -#define PAGE_OFFSET_WIDTH (PAGE_OFFSET_LEFT*2) -#define PAGE_OFFSET_HEIGHT (PAGE_OFFSET_TOP+32) if ((TaskManagerSettings.Left != 0) || (TaskManagerSettings.Top != 0) || @@ -578,11 +519,6 @@ BOOL OnCreate(HWND hWnd) (TaskManagerSettings.Bottom != 0)) { MoveWindow(hWnd, TaskManagerSettings.Left, TaskManagerSettings.Top, TaskManagerSettings.Right - TaskManagerSettings.Left, TaskManagerSettings.Bottom - TaskManagerSettings.Top, TRUE); -#ifdef __GNUC__TEST__ - MoveWindow(hApplicationPage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE); - MoveWindow(hProcessPage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE); - MoveWindow(hPerformancePage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE); -#endif } if (TaskManagerSettings.Maximized) ShowWindow(hWnd, SW_MAXIMIZE); @@ -595,7 +531,6 @@ BOOL OnCreate(HWND hWnd) hUpdateSpeedMenu = GetSubMenu(hViewMenu, 1); hCPUHistoryMenu = GetSubMenu(hViewMenu, 7); - /* Check or uncheck the always on top menu item */ if (TaskManagerSettings.AlwaysOnTop) { CheckMenuItem(hEditMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_CHECKED); SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); @@ -604,19 +539,16 @@ BOOL OnCreate(HWND hWnd) SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); } - /* Check or uncheck the minimize on use menu item */ if (TaskManagerSettings.MinimizeOnUse) CheckMenuItem(hEditMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_CHECKED); else CheckMenuItem(hEditMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_UNCHECKED); - /* Check or uncheck the hide when minimized menu item */ if (TaskManagerSettings.HideWhenMinimized) CheckMenuItem(hEditMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_CHECKED); else CheckMenuItem(hEditMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_UNCHECKED); - /* Check or uncheck the show 16-bit tasks menu item */ if (TaskManagerSettings.Show16BitTasks) CheckMenuItem(hEditMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_CHECKED); else @@ -672,7 +604,6 @@ BOOL OnCreate(HWND hWnd) /* 3- Set the menu item text to its formatted counterpart */ ModifyMenuW(hShutMenu, ID_SHUTDOWN_LOGOFF, MF_BYCOMMAND | MF_STRING, ID_SHUTDOWN_LOGOFF, szLogOffItem); - /* Setup update speed */ SetUpdateSpeed(hWnd); /* @@ -692,24 +623,11 @@ BOOL OnCreate(HWND hWnd) return TRUE; } -/* OnMove() - * This function handles all the moving events for the application - * It moves every child window that needs moving - */ -void OnMove( WPARAM nType, int cx, int cy ) -{ -#ifdef __GNUC__TEST__ - MoveWindow(hApplicationPage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE); - MoveWindow(hProcessPage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE); - MoveWindow(hPerformancePage, TaskManagerSettings.Left + PAGE_OFFSET_LEFT, TaskManagerSettings.Top + PAGE_OFFSET_TOP, TaskManagerSettings.Right - TaskManagerSettings.Left - PAGE_OFFSET_WIDTH, TaskManagerSettings.Bottom - TaskManagerSettings.Top - PAGE_OFFSET_HEIGHT, FALSE); -#endif -} - /* OnSize() * This function handles all the sizing events for the application * It re-sizes every window, and child window that needs re-sizing */ -void OnSize( WPARAM nType, int cx, int cy ) +void OnSize(WPARAM nType, int cx, int cy) { int nParts[3]; int nXDifference; @@ -1027,18 +945,17 @@ LPWSTR GetLastErrorText(LPWSTR lpszBuf, DWORD dwSize) LANG_NEUTRAL, (LPWSTR)&lpszTemp, 0, - NULL ); + NULL); /* supplied buffer is not long enough */ - if (!dwRet || ( (long)dwSize < (long)dwRet+14)) { + if (!dwRet || ((long)dwSize < (long)dwRet+14)) lpszBuf[0] = L'\0'; - } else { + else { lpszTemp[lstrlenW(lpszTemp)-2] = L'\0'; /*remove cr and newline character */ wsprintfW(lpszBuf, L"%s (0x%x)", lpszTemp, (int)GetLastError()); } - if (lpszTemp) { + if (lpszTemp) LocalFree((HLOCAL)lpszTemp); - } return lpszBuf; } diff --git a/base/applications/taskmgr/taskmgr.h b/base/applications/taskmgr/taskmgr.h index 7805e7673b1..f7d7b1ea84d 100644 --- a/base/applications/taskmgr/taskmgr.h +++ b/base/applications/taskmgr/taskmgr.h @@ -6,10 +6,6 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - #include "resource.h" #define RUN_APPS_PAGE @@ -39,15 +35,14 @@ typedef struct BOOL HideWhenMinimized; BOOL Show16BitTasks; - /* Update speed settings */ - /* How many half-seconds in between updates (i.e. 0 - Paused, 1 - High, 2 - Normal, 4 - Low) */ + // 0 - Paused, 1 - High, 2 - Normal, 4 - Low DWORD UpdateSpeed; /* Applications page settings */ DWORD ViewMode; /* Processes page settings */ - BOOL ShowProcessesFromAllUsers; /* Server-only? */ + BOOL ShowProcessesFromAllUsers; BOOL Columns[COLUMN_NMAX]; int ColumnOrderArray[COLUMN_NMAX]; int ColumnSizeArray[COLUMN_NMAX]; @@ -57,10 +52,8 @@ typedef struct /* Performance page settings */ BOOL CPUHistory_OneGraphPerCPU; BOOL ShowKernelTimes; - } TASKMANAGER_SETTINGS, *LPTASKMANAGER_SETTINGS; -/* Global Variables: */ extern HINSTANCE hInst; /* current instance */ extern HWND hMainWnd; /* Main Window */ extern HWND hStatusWnd; /* Status Bar Window */ @@ -71,7 +64,6 @@ extern int nOldWidth; /* Holds the previous client area width */ extern int nOldHeight; /* Holds the previous client area height */ extern TASKMANAGER_SETTINGS TaskManagerSettings; -/* Forward declarations of functions included in this code module: */ INT_PTR CALLBACK TaskManagerWndProc(HWND, UINT, WPARAM, LPARAM); BOOL OnCreate(HWND hWnd); void OnSize(WPARAM nType, int cx, int cy); @@ -83,9 +75,5 @@ void TaskManager_OnRestoreMainWindow(void); void TaskManager_OnViewUpdateSpeed(DWORD); void TaskManager_OnTabWndSelChange(void); VOID ShowWin32Error(DWORD dwError); -LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize ); +LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize); DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread); - -#ifdef __cplusplus -} -#endif diff --git a/base/applications/taskmgr/trayicon.c b/base/applications/taskmgr/trayicon.c index fb56a099f16..5794884ca67 100644 --- a/base/applications/taskmgr/trayicon.c +++ b/base/applications/taskmgr/trayicon.c @@ -7,7 +7,7 @@ #include "precomp.h" -HICON TrayIcon_GetProcessorUsageIcon(void) +HICON TrayIcon_GetProcessorUsageIcon(ULONG CpuUsage) { HICON hTrayIcon = NULL; HDC hScreenDC = NULL; @@ -16,7 +16,6 @@ HICON TrayIcon_GetProcessorUsageIcon(void) HBITMAP hOldBitmap = NULL; HBITMAP hBitmapMask = NULL; ICONINFO iconInfo; - ULONG CpuUsage; int nLinesToDraw; HBRUSH hBitmapBrush = NULL; RECT rc; @@ -47,8 +46,6 @@ HICON TrayIcon_GetProcessorUsageIcon(void) */ hOldBitmap = SelectObject(hDC, hBitmap); - CpuUsage = PerfDataGetProcessorUsage(); - /* * Calculate how many lines to draw * since we have 11 rows of space @@ -97,16 +94,18 @@ done: return hTrayIcon; } -BOOL TrayIcon_AddIcon(void) +BOOL TrayIcon_Update(DWORD dwMessage) { NOTIFYICONDATAW nid; + ULONG CpuUsage; HICON hIcon = NULL; BOOL bRetVal; WCHAR szMsg[64]; memset(&nid, 0, sizeof(nid)); - hIcon = TrayIcon_GetProcessorUsageIcon(); + CpuUsage = PerfDataGetProcessorUsage(); + hIcon = TrayIcon_GetProcessorUsageIcon(CpuUsage); nid.cbSize = sizeof(nid); nid.hWnd = hMainWnd; @@ -115,10 +114,10 @@ BOOL TrayIcon_AddIcon(void) nid.uCallbackMessage = WM_ONTRAYICON; nid.hIcon = hIcon; - LoadStringW(GetModuleHandleW(NULL), IDS_MSG_TRAYICONCPUUSAGE, szMsg, _countof(szMsg)); - wsprintfW(nid.szTip, szMsg, PerfDataGetProcessorUsage()); + LoadStringW(hInst, IDS_MSG_TRAYICONCPUUSAGE, szMsg, _countof(szMsg)); + wsprintfW(nid.szTip, szMsg, CpuUsage); - bRetVal = Shell_NotifyIconW(NIM_ADD, &nid); + bRetVal = Shell_NotifyIconW(dwMessage, &nid); if (hIcon) DestroyIcon(hIcon); @@ -126,6 +125,11 @@ BOOL TrayIcon_AddIcon(void) return bRetVal; } +BOOL TrayIcon_AddIcon(VOID) +{ + return TrayIcon_Update(NIM_ADD); +} + BOOL TrayIcon_RemoveIcon(void) { NOTIFYICONDATAW nid; @@ -143,28 +147,5 @@ BOOL TrayIcon_RemoveIcon(void) BOOL TrayIcon_UpdateIcon(void) { - NOTIFYICONDATAW nid; - HICON hIcon = NULL; - BOOL bRetVal; - WCHAR szMsg[64]; - - memset(&nid, 0, sizeof(nid)); - - hIcon = TrayIcon_GetProcessorUsageIcon(); - - nid.cbSize = sizeof(nid); - nid.hWnd = hMainWnd; - nid.uID = 0; - nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; - nid.uCallbackMessage = WM_ONTRAYICON; - nid.hIcon = hIcon; - LoadStringW(hInst, IDS_MSG_TRAYICONCPUUSAGE, szMsg, _countof(szMsg)); - wsprintfW(nid.szTip, szMsg, PerfDataGetProcessorUsage()); - - bRetVal = Shell_NotifyIconW(NIM_MODIFY, &nid); - - if (hIcon) - DestroyIcon(hIcon); - - return bRetVal; + return TrayIcon_Update(NIM_MODIFY); }