6 * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 TGraphCtrl PerformancePageCpuUsageHistoryGraph
;
26 TGraphCtrl PerformancePageMemUsageHistoryGraph
;
28 HWND hPerformancePage
; /* Performance Property Page */
29 HWND hPerformancePageCpuUsageGraph
; /* CPU Usage Graph */
30 HWND hPerformancePageMemUsageGraph
; /* MEM Usage Graph */
31 HWND hPerformancePageCpuUsageHistoryGraph
; /* CPU Usage History Graph */
32 HWND hPerformancePageMemUsageHistoryGraph
; /* Memory Usage History Graph */
33 HWND hPerformancePageTotalsFrame
; /* Totals Frame */
34 HWND hPerformancePageCommitChargeFrame
; /* Commit Charge Frame */
35 HWND hPerformancePageKernelMemoryFrame
; /* Kernel Memory Frame */
36 HWND hPerformancePagePhysicalMemoryFrame
; /* Physical Memory Frame */
37 HWND hPerformancePageCpuUsageFrame
;
38 HWND hPerformancePageMemUsageFrame
;
39 HWND hPerformancePageCpuUsageHistoryFrame
;
40 HWND hPerformancePageMemUsageHistoryFrame
;
41 HWND hPerformancePageCommitChargeTotalEdit
; /* Commit Charge Total Edit Control */
42 HWND hPerformancePageCommitChargeLimitEdit
; /* Commit Charge Limit Edit Control */
43 HWND hPerformancePageCommitChargePeakEdit
; /* Commit Charge Peak Edit Control */
44 HWND hPerformancePageKernelMemoryTotalEdit
; /* Kernel Memory Total Edit Control */
45 HWND hPerformancePageKernelMemoryPagedEdit
; /* Kernel Memory Paged Edit Control */
46 HWND hPerformancePageKernelMemoryNonPagedEdit
; /* Kernel Memory NonPaged Edit Control */
47 HWND hPerformancePagePhysicalMemoryTotalEdit
; /* Physical Memory Total Edit Control */
48 HWND hPerformancePagePhysicalMemoryAvailableEdit
; /* Physical Memory Available Edit Control */
49 HWND hPerformancePagePhysicalMemorySystemCacheEdit
; /* Physical Memory System Cache Edit Control */
50 HWND hPerformancePageTotalsHandleCountEdit
; /* Total Handles Edit Control */
51 HWND hPerformancePageTotalsProcessCountEdit
; /* Total Processes Edit Control */
52 HWND hPerformancePageTotalsThreadCountEdit
; /* Total Threads Edit Control */
55 static HANDLE hPerformanceThread
= NULL
;
56 static DWORD dwPerformanceThread
;
59 static int nPerformancePageWidth
;
60 static int nPerformancePageHeight
;
61 static int lastX
, lastY
;
62 DWORD WINAPI
PerformancePageRefreshThread(void *lpParameter
);
64 void AdjustFrameSize(HWND hCntrl
, HWND hDlg
, int nXDifference
, int nYDifference
, int pos
)
69 GetClientRect(hCntrl
, &rc
);
70 MapWindowPoints(hCntrl
, hDlg
, (LPPOINT
)(PRECT
)(&rc
), (sizeof(RECT
)/sizeof(POINT
)));
74 sx
= rc
.right
- rc
.left
;
79 cy
+= nYDifference
/ 2;
85 cy
+= nYDifference
/ 2;
89 sy
= rc
.bottom
- rc
.top
+ nYDifference
/ 2;
90 SetWindowPos(hCntrl
, NULL
, cx
, cy
, sx
, sy
, SWP_NOACTIVATE
|SWP_NOOWNERZORDER
|SWP_NOZORDER
);
92 cx
= rc
.left
+ nXDifference
;
93 cy
= rc
.top
+ nYDifference
;
95 SetWindowPos(hCntrl
, NULL
, cx
, cy
, 0, 0, SWP_NOACTIVATE
|SWP_NOOWNERZORDER
|SWP_NOSIZE
|SWP_NOZORDER
);
97 InvalidateRect(hCntrl
, NULL
, TRUE
);
100 static void AdjustControlPostion(HWND hCntrl
, HWND hDlg
, int nXDifference
, int nYDifference
)
102 AdjustFrameSize(hCntrl
, hDlg
, nXDifference
, nYDifference
, 0);
105 static void AdjustCntrlPos(int ctrl_id
, HWND hDlg
, int nXDifference
, int nYDifference
)
107 AdjustFrameSize(GetDlgItem(hDlg
, ctrl_id
), hDlg
, nXDifference
, nYDifference
, 0);
111 PerformancePageWndProc(HWND hDlg
, UINT message
, WPARAM wParam
, LPARAM lParam
)
117 /* PAINTSTRUCT ps; */
121 GraphCtrl_Dispose(&PerformancePageCpuUsageHistoryGraph
);
122 GraphCtrl_Dispose(&PerformancePageMemUsageHistoryGraph
);
124 EndLocalThread(&hPerformanceThread
, dwPerformanceThread
);
130 /* Save the width and height */
131 GetClientRect(hDlg
, &rc
);
132 nPerformancePageWidth
= rc
.right
;
133 nPerformancePageHeight
= rc
.bottom
;
135 /* Update window position */
136 SetWindowPos(hDlg
, NULL
, 15, 30, 0, 0, SWP_NOACTIVATE
|SWP_NOOWNERZORDER
|SWP_NOSIZE
|SWP_NOZORDER
);
139 * Get handles to all the controls
141 hPerformancePageTotalsFrame
= GetDlgItem(hDlg
, IDC_TOTALS_FRAME
);
142 hPerformancePageCommitChargeFrame
= GetDlgItem(hDlg
, IDC_COMMIT_CHARGE_FRAME
);
143 hPerformancePageKernelMemoryFrame
= GetDlgItem(hDlg
, IDC_KERNEL_MEMORY_FRAME
);
144 hPerformancePagePhysicalMemoryFrame
= GetDlgItem(hDlg
, IDC_PHYSICAL_MEMORY_FRAME
);
146 hPerformancePageCpuUsageFrame
= GetDlgItem(hDlg
, IDC_CPU_USAGE_FRAME
);
147 hPerformancePageMemUsageFrame
= GetDlgItem(hDlg
, IDC_MEM_USAGE_FRAME
);
148 hPerformancePageCpuUsageHistoryFrame
= GetDlgItem(hDlg
, IDC_CPU_USAGE_HISTORY_FRAME
);
149 hPerformancePageMemUsageHistoryFrame
= GetDlgItem(hDlg
, IDC_MEMORY_USAGE_HISTORY_FRAME
);
151 hPerformancePageCommitChargeTotalEdit
= GetDlgItem(hDlg
, IDC_COMMIT_CHARGE_TOTAL
);
152 hPerformancePageCommitChargeLimitEdit
= GetDlgItem(hDlg
, IDC_COMMIT_CHARGE_LIMIT
);
153 hPerformancePageCommitChargePeakEdit
= GetDlgItem(hDlg
, IDC_COMMIT_CHARGE_PEAK
);
154 hPerformancePageKernelMemoryTotalEdit
= GetDlgItem(hDlg
, IDC_KERNEL_MEMORY_TOTAL
);
155 hPerformancePageKernelMemoryPagedEdit
= GetDlgItem(hDlg
, IDC_KERNEL_MEMORY_PAGED
);
156 hPerformancePageKernelMemoryNonPagedEdit
= GetDlgItem(hDlg
, IDC_KERNEL_MEMORY_NONPAGED
);
157 hPerformancePagePhysicalMemoryTotalEdit
= GetDlgItem(hDlg
, IDC_PHYSICAL_MEMORY_TOTAL
);
158 hPerformancePagePhysicalMemoryAvailableEdit
= GetDlgItem(hDlg
, IDC_PHYSICAL_MEMORY_AVAILABLE
);
159 hPerformancePagePhysicalMemorySystemCacheEdit
= GetDlgItem(hDlg
, IDC_PHYSICAL_MEMORY_SYSTEM_CACHE
);
160 hPerformancePageTotalsHandleCountEdit
= GetDlgItem(hDlg
, IDC_TOTALS_HANDLE_COUNT
);
161 hPerformancePageTotalsProcessCountEdit
= GetDlgItem(hDlg
, IDC_TOTALS_PROCESS_COUNT
);
162 hPerformancePageTotalsThreadCountEdit
= GetDlgItem(hDlg
, IDC_TOTALS_THREAD_COUNT
);
164 hPerformancePageCpuUsageGraph
= GetDlgItem(hDlg
, IDC_CPU_USAGE_GRAPH
);
165 hPerformancePageMemUsageGraph
= GetDlgItem(hDlg
, IDC_MEM_USAGE_GRAPH
);
166 hPerformancePageMemUsageHistoryGraph
= GetDlgItem(hDlg
, IDC_MEM_USAGE_HISTORY_GRAPH
);
167 hPerformancePageCpuUsageHistoryGraph
= GetDlgItem(hDlg
, IDC_CPU_USAGE_HISTORY_GRAPH
);
169 GetClientRect(hPerformancePageCpuUsageHistoryGraph
, &rc
);
170 /* create the control */
171 /* PerformancePageCpuUsageHistoryGraph.Create(0, rc, hDlg, IDC_CPU_USAGE_HISTORY_GRAPH); */
172 GraphCtrl_Create(&PerformancePageCpuUsageHistoryGraph
, hPerformancePageCpuUsageHistoryGraph
, hDlg
, IDC_CPU_USAGE_HISTORY_GRAPH
);
173 /* customize the control */
174 GraphCtrl_SetRange(&PerformancePageCpuUsageHistoryGraph
, 0.0, 100.0, 10);
175 /* PerformancePageCpuUsageHistoryGraph.SetYUnits("Current") ; */
176 /* PerformancePageCpuUsageHistoryGraph.SetXUnits("Samples (Windows Timer: 100 msec)") ; */
177 /* PerformancePageCpuUsageHistoryGraph.SetBackgroundColor(RGB(0, 0, 64)) ; */
178 /* PerformancePageCpuUsageHistoryGraph.SetGridColor(RGB(192, 192, 255)) ; */
179 /* PerformancePageCpuUsageHistoryGraph.SetPlotColor(RGB(255, 255, 255)) ; */
180 GraphCtrl_SetBackgroundColor(&PerformancePageCpuUsageHistoryGraph
, RGB(0, 0, 0)) ;
181 GraphCtrl_SetGridColor(&PerformancePageCpuUsageHistoryGraph
, RGB(0, 128, 64));
183 GraphCtrl_SetPlotColor(&PerformancePageCpuUsageHistoryGraph
, 0, RGB(0, 255, 0)) ;
184 GraphCtrl_SetPlotColor(&PerformancePageCpuUsageHistoryGraph
, 1, RGB(255, 0, 0)) ;
187 GetClientRect(hPerformancePageMemUsageHistoryGraph
, &rc
);
188 GraphCtrl_Create(&PerformancePageMemUsageHistoryGraph
, hPerformancePageMemUsageHistoryGraph
, hDlg
, IDC_MEM_USAGE_HISTORY_GRAPH
);
189 GraphCtrl_SetRange(&PerformancePageMemUsageHistoryGraph
, 0.0, 100.0, 10) ;
190 GraphCtrl_SetBackgroundColor(&PerformancePageMemUsageHistoryGraph
, RGB(0, 0, 0)) ;
191 GraphCtrl_SetGridColor(&PerformancePageMemUsageHistoryGraph
, RGB(0, 128, 64)) ;
192 GraphCtrl_SetPlotColor(&PerformancePageMemUsageHistoryGraph
, 0, RGB(255, 255, 0)) ;
193 /* Start our refresh thread */
195 hPerformanceThread
= CreateThread(NULL
, 0, PerformancePageRefreshThread
, NULL
, 0, &dwPerformanceThread
);
199 * Subclass graph buttons
201 OldGraphWndProc
= (WNDPROC
)(LONG_PTR
) SetWindowLongPtrW(hPerformancePageCpuUsageGraph
, GWL_WNDPROC
, (LONG_PTR
)Graph_WndProc
);
202 SetWindowLongPtrW(hPerformancePageMemUsageGraph
, GWL_WNDPROC
, (LONG_PTR
)Graph_WndProc
);
203 OldGraphCtrlWndProc
= (WNDPROC
)(LONG_PTR
) SetWindowLongPtrW(hPerformancePageMemUsageHistoryGraph
, GWL_WNDPROC
, (LONG_PTR
)GraphCtrl_WndProc
);
204 SetWindowLongPtrW(hPerformancePageCpuUsageHistoryGraph
, GWL_WNDPROC
, (LONG_PTR
)GraphCtrl_WndProc
);
212 GetClientRect(hDlg
, &rc
);
213 Draw3dRect(hdc
, rc
.left
, rc
.top
, rc
.right
, rc
.top
+ 2, GetSysColor(COLOR_3DSHADOW
), GetSysColor(COLOR_3DHILIGHT
));
214 ReleaseDC(hDlg
, hdc
);
218 hdc
= BeginPaint(hDlg
, &ps
);
219 GetClientRect(hDlg
, &rc
);
220 Draw3dRect(hdc
, rc
.left
, rc
.top
, rc
.right
, rc
.top
+ 2, GetSysColor(COLOR_3DSHADOW
), GetSysColor(COLOR_3DHILIGHT
));
228 if (wParam
== SIZE_MINIMIZED
)
233 nXDifference
= cx
- nPerformancePageWidth
;
234 nYDifference
= cy
- nPerformancePageHeight
;
235 nPerformancePageWidth
= cx
;
236 nPerformancePageHeight
= cy
;
239 /* Reposition the performance page's controls */
240 AdjustFrameSize(hPerformancePageTotalsFrame
, hDlg
, 0, nYDifference
, 0);
241 AdjustFrameSize(hPerformancePageCommitChargeFrame
, hDlg
, 0, nYDifference
, 0);
242 AdjustFrameSize(hPerformancePageKernelMemoryFrame
, hDlg
, 0, nYDifference
, 0);
243 AdjustFrameSize(hPerformancePagePhysicalMemoryFrame
, hDlg
, 0, nYDifference
, 0);
244 AdjustCntrlPos(IDS_COMMIT_CHARGE_TOTAL
, hDlg
, 0, nYDifference
);
245 AdjustCntrlPos(IDS_COMMIT_CHARGE_LIMIT
, hDlg
, 0, nYDifference
);
246 AdjustCntrlPos(IDS_COMMIT_CHARGE_PEAK
, hDlg
, 0, nYDifference
);
247 AdjustCntrlPos(IDS_KERNEL_MEMORY_TOTAL
, hDlg
, 0, nYDifference
);
248 AdjustCntrlPos(IDS_KERNEL_MEMORY_PAGED
, hDlg
, 0, nYDifference
);
249 AdjustCntrlPos(IDS_KERNEL_MEMORY_NONPAGED
, hDlg
, 0, nYDifference
);
250 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_TOTAL
, hDlg
, 0, nYDifference
);
251 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_AVAILABLE
, hDlg
, 0, nYDifference
);
252 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_SYSTEM_CACHE
, hDlg
, 0, nYDifference
);
253 AdjustCntrlPos(IDS_TOTALS_HANDLE_COUNT
, hDlg
, 0, nYDifference
);
254 AdjustCntrlPos(IDS_TOTALS_PROCESS_COUNT
, hDlg
, 0, nYDifference
);
255 AdjustCntrlPos(IDS_TOTALS_THREAD_COUNT
, hDlg
, 0, nYDifference
);
257 AdjustControlPostion(hPerformancePageCommitChargeTotalEdit
, hDlg
, 0, nYDifference
);
258 AdjustControlPostion(hPerformancePageCommitChargeLimitEdit
, hDlg
, 0, nYDifference
);
259 AdjustControlPostion(hPerformancePageCommitChargePeakEdit
, hDlg
, 0, nYDifference
);
260 AdjustControlPostion(hPerformancePageKernelMemoryTotalEdit
, hDlg
, 0, nYDifference
);
261 AdjustControlPostion(hPerformancePageKernelMemoryPagedEdit
, hDlg
, 0, nYDifference
);
262 AdjustControlPostion(hPerformancePageKernelMemoryNonPagedEdit
, hDlg
, 0, nYDifference
);
263 AdjustControlPostion(hPerformancePagePhysicalMemoryTotalEdit
, hDlg
, 0, nYDifference
);
264 AdjustControlPostion(hPerformancePagePhysicalMemoryAvailableEdit
, hDlg
, 0, nYDifference
);
265 AdjustControlPostion(hPerformancePagePhysicalMemorySystemCacheEdit
, hDlg
, 0, nYDifference
);
266 AdjustControlPostion(hPerformancePageTotalsHandleCountEdit
, hDlg
, 0, nYDifference
);
267 AdjustControlPostion(hPerformancePageTotalsProcessCountEdit
, hDlg
, 0, nYDifference
);
268 AdjustControlPostion(hPerformancePageTotalsThreadCountEdit
, hDlg
, 0, nYDifference
);
270 nXDifference
+= lastX
;
271 nYDifference
+= lastY
;
273 if (nXDifference
% 2) {
274 if (nXDifference
> 0) {
282 if (nYDifference
% 2) {
283 if (nYDifference
> 0) {
291 AdjustFrameSize(hPerformancePageCpuUsageFrame
, hDlg
, nXDifference
, nYDifference
, 1);
292 AdjustFrameSize(hPerformancePageMemUsageFrame
, hDlg
, nXDifference
, nYDifference
, 2);
293 AdjustFrameSize(hPerformancePageCpuUsageHistoryFrame
, hDlg
, nXDifference
, nYDifference
, 3);
294 AdjustFrameSize(hPerformancePageMemUsageHistoryFrame
, hDlg
, nXDifference
, nYDifference
, 4);
295 AdjustFrameSize(hPerformancePageCpuUsageGraph
, hDlg
, nXDifference
, nYDifference
, 1);
296 AdjustFrameSize(hPerformancePageMemUsageGraph
, hDlg
, nXDifference
, nYDifference
, 2);
297 AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph
, hDlg
, nXDifference
, nYDifference
, 3);
298 AdjustFrameSize(hPerformancePageMemUsageHistoryGraph
, hDlg
, nXDifference
, nYDifference
, 4);
304 void RefreshPerformancePage(void)
307 /* Signal the event so that our refresh thread */
308 /* will wake up and refresh the performance page */
309 PostThreadMessage(dwPerformanceThread
, WM_TIMER
, 0, 0);
313 DWORD WINAPI
PerformancePageRefreshThread(void *lpParameter
)
315 ULONG CommitChargeTotal
;
316 ULONG CommitChargeLimit
;
317 ULONG CommitChargePeak
;
320 ULONG CpuKernelUsage
;
322 ULONG KernelMemoryTotal
;
323 ULONG KernelMemoryPaged
;
324 ULONG KernelMemoryNonPaged
;
326 ULONG PhysicalMemoryTotal
;
327 ULONG PhysicalMemoryAvailable
;
328 ULONG PhysicalMemorySystemCache
;
332 ULONG TotalProcesses
;
335 WCHAR szMemUsage
[256];
339 LoadStringW(hInst
, IDS_STATUS_MEMUSAGE
, szMemUsage
, 256);
346 /* Wait for an the event or application close */
347 if (GetMessage(&msg
, NULL
, 0, 0) <= 0)
350 if (msg
.message
== WM_TIMER
)
353 * Update the commit charge info
355 CommitChargeTotal
= PerfDataGetCommitChargeTotalK();
356 CommitChargeLimit
= PerfDataGetCommitChargeLimitK();
357 CommitChargePeak
= PerfDataGetCommitChargePeakK();
358 _ultow(CommitChargeTotal
, Text
, 10);
359 SetWindowTextW(hPerformancePageCommitChargeTotalEdit
, Text
);
360 _ultow(CommitChargeLimit
, Text
, 10);
361 SetWindowTextW(hPerformancePageCommitChargeLimitEdit
, Text
);
362 _ultow(CommitChargePeak
, Text
, 10);
363 SetWindowTextW(hPerformancePageCommitChargePeakEdit
, Text
);
364 wsprintfW(Text
, szMemUsage
, CommitChargeTotal
, CommitChargeLimit
);
365 SendMessageW(hStatusWnd
, SB_SETTEXT
, 2, (LPARAM
)Text
);
368 * Update the kernel memory info
370 KernelMemoryTotal
= PerfDataGetKernelMemoryTotalK();
371 KernelMemoryPaged
= PerfDataGetKernelMemoryPagedK();
372 KernelMemoryNonPaged
= PerfDataGetKernelMemoryNonPagedK();
373 _ultow(KernelMemoryTotal
, Text
, 10);
374 SetWindowTextW(hPerformancePageKernelMemoryTotalEdit
, Text
);
375 _ultow(KernelMemoryPaged
, Text
, 10);
376 SetWindowTextW(hPerformancePageKernelMemoryPagedEdit
, Text
);
377 _ultow(KernelMemoryNonPaged
, Text
, 10);
378 SetWindowTextW(hPerformancePageKernelMemoryNonPagedEdit
, Text
);
381 * Update the physical memory info
383 PhysicalMemoryTotal
= PerfDataGetPhysicalMemoryTotalK();
384 PhysicalMemoryAvailable
= PerfDataGetPhysicalMemoryAvailableK();
385 PhysicalMemorySystemCache
= PerfDataGetPhysicalMemorySystemCacheK();
386 _ultow(PhysicalMemoryTotal
, Text
, 10);
387 SetWindowTextW(hPerformancePagePhysicalMemoryTotalEdit
, Text
);
388 _ultow(PhysicalMemoryAvailable
, Text
, 10);
389 SetWindowTextW(hPerformancePagePhysicalMemoryAvailableEdit
, Text
);
390 _ultow(PhysicalMemorySystemCache
, Text
, 10);
391 SetWindowTextW(hPerformancePagePhysicalMemorySystemCacheEdit
, Text
);
394 * Update the totals info
396 TotalHandles
= PerfDataGetSystemHandleCount();
397 TotalThreads
= PerfDataGetTotalThreadCount();
398 TotalProcesses
= PerfDataGetProcessCount();
399 _ultow(TotalHandles
, Text
, 10);
400 SetWindowTextW(hPerformancePageTotalsHandleCountEdit
, Text
);
401 _ultow(TotalThreads
, Text
, 10);
402 SetWindowTextW(hPerformancePageTotalsThreadCountEdit
, Text
);
403 _ultow(TotalProcesses
, Text
, 10);
404 SetWindowTextW(hPerformancePageTotalsProcessCountEdit
, Text
);
409 InvalidateRect(hPerformancePageCpuUsageGraph
, NULL
, FALSE
);
410 InvalidateRect(hPerformancePageMemUsageGraph
, NULL
, FALSE
);
415 CpuUsage
= PerfDataGetProcessorUsage();
416 if (CpuUsage
<= 0 ) CpuUsage
= 0;
417 if (CpuUsage
> 100) CpuUsage
= 100;
419 if (TaskManagerSettings
.ShowKernelTimes
)
421 CpuKernelUsage
= PerfDataGetProcessorSystemUsage();
422 if (CpuKernelUsage
<= 0) CpuKernelUsage
= 0;
423 if (CpuKernelUsage
> 100) CpuKernelUsage
= 100;
430 * Get the memory usage
432 CommitChargeTotal
= PerfDataGetCommitChargeTotalK();
433 CommitChargeLimit
= PerfDataGetCommitChargeLimitK();
434 nBarsUsed1
= CommitChargeLimit
? ((CommitChargeTotal
* 100) / CommitChargeLimit
) : 0;
436 PhysicalMemoryTotal
= PerfDataGetPhysicalMemoryTotalK();
437 PhysicalMemoryAvailable
= PerfDataGetPhysicalMemoryAvailableK();
438 nBarsUsed2
= PhysicalMemoryTotal
? ((PhysicalMemoryAvailable
* 100) / PhysicalMemoryTotal
) : 0;
440 GraphCtrl_AppendPoint(&PerformancePageCpuUsageHistoryGraph
, CpuUsage
, CpuKernelUsage
, 0.0, 0.0);
441 GraphCtrl_AppendPoint(&PerformancePageMemUsageHistoryGraph
, nBarsUsed1
, nBarsUsed2
, 0.0, 0.0);
442 /* PerformancePageMemUsageHistoryGraph.SetRange(0.0, 100.0, 10) ; */
443 InvalidateRect(hPerformancePageMemUsageHistoryGraph
, NULL
, FALSE
);
444 InvalidateRect(hPerformancePageCpuUsageHistoryGraph
, NULL
, FALSE
);
450 void PerformancePage_OnViewShowKernelTimes(void)
455 hMenu
= GetMenu(hMainWnd
);
456 hViewMenu
= GetSubMenu(hMenu
, 2);
458 /* Check or uncheck the show 16-bit tasks menu item */
459 if (GetMenuState(hViewMenu
, ID_VIEW_SHOWKERNELTIMES
, MF_BYCOMMAND
) & MF_CHECKED
)
461 CheckMenuItem(hViewMenu
, ID_VIEW_SHOWKERNELTIMES
, MF_BYCOMMAND
|MF_UNCHECKED
);
462 TaskManagerSettings
.ShowKernelTimes
= FALSE
;
466 CheckMenuItem(hViewMenu
, ID_VIEW_SHOWKERNELTIMES
, MF_BYCOMMAND
|MF_CHECKED
);
467 TaskManagerSettings
.ShowKernelTimes
= TRUE
;
470 RefreshPerformancePage();
473 void PerformancePage_OnViewCPUHistoryOneGraphAll(void)
477 HMENU hCPUHistoryMenu
;
479 hMenu
= GetMenu(hMainWnd
);
480 hViewMenu
= GetSubMenu(hMenu
, 2);
481 hCPUHistoryMenu
= GetSubMenu(hViewMenu
, 3);
483 TaskManagerSettings
.CPUHistory_OneGraphPerCPU
= FALSE
;
484 CheckMenuRadioItem(hCPUHistoryMenu
, ID_VIEW_CPUHISTORY_ONEGRAPHALL
, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
, ID_VIEW_CPUHISTORY_ONEGRAPHALL
, MF_BYCOMMAND
);
487 void PerformancePage_OnViewCPUHistoryOneGraphPerCPU(void)
491 HMENU hCPUHistoryMenu
;
493 hMenu
= GetMenu(hMainWnd
);
494 hViewMenu
= GetSubMenu(hMenu
, 2);
495 hCPUHistoryMenu
= GetSubMenu(hViewMenu
, 3);
497 TaskManagerSettings
.CPUHistory_OneGraphPerCPU
= TRUE
;
498 CheckMenuRadioItem(hCPUHistoryMenu
, ID_VIEW_CPUHISTORY_ONEGRAPHALL
, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
, MF_BYCOMMAND
);