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
;
94 SetWindowPos(hCntrl
, NULL
, cx
, cy
, 0, 0, SWP_NOACTIVATE
|SWP_NOOWNERZORDER
|SWP_NOSIZE
|SWP_NOZORDER
);
96 InvalidateRect(hCntrl
, NULL
, TRUE
);
99 static void AdjustControlPostion(HWND hCntrl
, HWND hDlg
, int nXDifference
, int nYDifference
)
101 AdjustFrameSize(hCntrl
, hDlg
, nXDifference
, nYDifference
, 0);
104 static void AdjustCntrlPos(int ctrl_id
, HWND hDlg
, int nXDifference
, int nYDifference
)
106 AdjustFrameSize(GetDlgItem(hDlg
, ctrl_id
), hDlg
, nXDifference
, nYDifference
, 0);
110 PerformancePageWndProc(HWND hDlg
, UINT message
, WPARAM wParam
, LPARAM lParam
)
116 /* PAINTSTRUCT ps; */
120 GraphCtrl_Dispose(&PerformancePageCpuUsageHistoryGraph
);
121 GraphCtrl_Dispose(&PerformancePageMemUsageHistoryGraph
);
123 EndLocalThread(&hPerformanceThread
, dwPerformanceThread
);
129 /* Save the width and height */
130 GetClientRect(hDlg
, &rc
);
131 nPerformancePageWidth
= rc
.right
;
132 nPerformancePageHeight
= rc
.bottom
;
134 /* Update window position */
135 SetWindowPos(hDlg
, NULL
, 15, 30, 0, 0, SWP_NOACTIVATE
|SWP_NOOWNERZORDER
|SWP_NOSIZE
|SWP_NOZORDER
);
138 * Get handles to all the controls
140 hPerformancePageTotalsFrame
= GetDlgItem(hDlg
, IDC_TOTALS_FRAME
);
141 hPerformancePageCommitChargeFrame
= GetDlgItem(hDlg
, IDC_COMMIT_CHARGE_FRAME
);
142 hPerformancePageKernelMemoryFrame
= GetDlgItem(hDlg
, IDC_KERNEL_MEMORY_FRAME
);
143 hPerformancePagePhysicalMemoryFrame
= GetDlgItem(hDlg
, IDC_PHYSICAL_MEMORY_FRAME
);
145 hPerformancePageCpuUsageFrame
= GetDlgItem(hDlg
, IDC_CPU_USAGE_FRAME
);
146 hPerformancePageMemUsageFrame
= GetDlgItem(hDlg
, IDC_MEM_USAGE_FRAME
);
147 hPerformancePageCpuUsageHistoryFrame
= GetDlgItem(hDlg
, IDC_CPU_USAGE_HISTORY_FRAME
);
148 hPerformancePageMemUsageHistoryFrame
= GetDlgItem(hDlg
, IDC_MEMORY_USAGE_HISTORY_FRAME
);
150 hPerformancePageCommitChargeTotalEdit
= GetDlgItem(hDlg
, IDC_COMMIT_CHARGE_TOTAL
);
151 hPerformancePageCommitChargeLimitEdit
= GetDlgItem(hDlg
, IDC_COMMIT_CHARGE_LIMIT
);
152 hPerformancePageCommitChargePeakEdit
= GetDlgItem(hDlg
, IDC_COMMIT_CHARGE_PEAK
);
153 hPerformancePageKernelMemoryTotalEdit
= GetDlgItem(hDlg
, IDC_KERNEL_MEMORY_TOTAL
);
154 hPerformancePageKernelMemoryPagedEdit
= GetDlgItem(hDlg
, IDC_KERNEL_MEMORY_PAGED
);
155 hPerformancePageKernelMemoryNonPagedEdit
= GetDlgItem(hDlg
, IDC_KERNEL_MEMORY_NONPAGED
);
156 hPerformancePagePhysicalMemoryTotalEdit
= GetDlgItem(hDlg
, IDC_PHYSICAL_MEMORY_TOTAL
);
157 hPerformancePagePhysicalMemoryAvailableEdit
= GetDlgItem(hDlg
, IDC_PHYSICAL_MEMORY_AVAILABLE
);
158 hPerformancePagePhysicalMemorySystemCacheEdit
= GetDlgItem(hDlg
, IDC_PHYSICAL_MEMORY_SYSTEM_CACHE
);
159 hPerformancePageTotalsHandleCountEdit
= GetDlgItem(hDlg
, IDC_TOTALS_HANDLE_COUNT
);
160 hPerformancePageTotalsProcessCountEdit
= GetDlgItem(hDlg
, IDC_TOTALS_PROCESS_COUNT
);
161 hPerformancePageTotalsThreadCountEdit
= GetDlgItem(hDlg
, IDC_TOTALS_THREAD_COUNT
);
163 hPerformancePageCpuUsageGraph
= GetDlgItem(hDlg
, IDC_CPU_USAGE_GRAPH
);
164 hPerformancePageMemUsageGraph
= GetDlgItem(hDlg
, IDC_MEM_USAGE_GRAPH
);
165 hPerformancePageMemUsageHistoryGraph
= GetDlgItem(hDlg
, IDC_MEM_USAGE_HISTORY_GRAPH
);
166 hPerformancePageCpuUsageHistoryGraph
= GetDlgItem(hDlg
, IDC_CPU_USAGE_HISTORY_GRAPH
);
168 GetClientRect(hPerformancePageCpuUsageHistoryGraph
, &rc
);
169 /* create the control */
170 /* PerformancePageCpuUsageHistoryGraph.Create(0, rc, hDlg, IDC_CPU_USAGE_HISTORY_GRAPH); */
171 GraphCtrl_Create(&PerformancePageCpuUsageHistoryGraph
, hPerformancePageCpuUsageHistoryGraph
, hDlg
, IDC_CPU_USAGE_HISTORY_GRAPH
);
172 /* customize the control */
173 GraphCtrl_SetRange(&PerformancePageCpuUsageHistoryGraph
, 0.0, 100.0, 10);
174 /* PerformancePageCpuUsageHistoryGraph.SetYUnits("Current") ; */
175 /* PerformancePageCpuUsageHistoryGraph.SetXUnits("Samples (Windows Timer: 100 msec)") ; */
176 /* PerformancePageCpuUsageHistoryGraph.SetBackgroundColor(RGB(0, 0, 64)) ; */
177 /* PerformancePageCpuUsageHistoryGraph.SetGridColor(RGB(192, 192, 255)) ; */
178 /* PerformancePageCpuUsageHistoryGraph.SetPlotColor(RGB(255, 255, 255)) ; */
179 GraphCtrl_SetBackgroundColor(&PerformancePageCpuUsageHistoryGraph
, RGB(0, 0, 0)) ;
180 GraphCtrl_SetGridColor(&PerformancePageCpuUsageHistoryGraph
, RGB(0, 128, 64));
182 GraphCtrl_SetPlotColor(&PerformancePageCpuUsageHistoryGraph
, 0, RGB(0, 255, 0)) ;
183 GraphCtrl_SetPlotColor(&PerformancePageCpuUsageHistoryGraph
, 1, RGB(255, 0, 0)) ;
186 GetClientRect(hPerformancePageMemUsageHistoryGraph
, &rc
);
187 GraphCtrl_Create(&PerformancePageMemUsageHistoryGraph
, hPerformancePageMemUsageHistoryGraph
, hDlg
, IDC_MEM_USAGE_HISTORY_GRAPH
);
188 GraphCtrl_SetRange(&PerformancePageMemUsageHistoryGraph
, 0.0, 100.0, 10) ;
189 GraphCtrl_SetBackgroundColor(&PerformancePageMemUsageHistoryGraph
, RGB(0, 0, 0)) ;
190 GraphCtrl_SetGridColor(&PerformancePageMemUsageHistoryGraph
, RGB(0, 128, 64)) ;
191 GraphCtrl_SetPlotColor(&PerformancePageMemUsageHistoryGraph
, 0, RGB(255, 255, 0)) ;
192 /* Start our refresh thread */
194 hPerformanceThread
= CreateThread(NULL
, 0, PerformancePageRefreshThread
, NULL
, 0, &dwPerformanceThread
);
198 * Subclass graph buttons
200 OldGraphWndProc
= (WNDPROC
)SetWindowLongPtrW(hPerformancePageCpuUsageGraph
, GWLP_WNDPROC
, (LONG_PTR
)Graph_WndProc
);
201 SetWindowLongPtrW(hPerformancePageMemUsageGraph
, GWLP_WNDPROC
, (LONG_PTR
)Graph_WndProc
);
202 OldGraphCtrlWndProc
= (WNDPROC
)SetWindowLongPtrW(hPerformancePageMemUsageHistoryGraph
, GWLP_WNDPROC
, (LONG_PTR
)GraphCtrl_WndProc
);
203 SetWindowLongPtrW(hPerformancePageCpuUsageHistoryGraph
, GWLP_WNDPROC
, (LONG_PTR
)GraphCtrl_WndProc
);
211 GetClientRect(hDlg
, &rc
);
212 Draw3dRect(hdc
, rc
.left
, rc
.top
, rc
.right
, rc
.top
+ 2, GetSysColor(COLOR_3DSHADOW
), GetSysColor(COLOR_3DHILIGHT
));
213 ReleaseDC(hDlg
, hdc
);
217 hdc
= BeginPaint(hDlg
, &ps
);
218 GetClientRect(hDlg
, &rc
);
219 Draw3dRect(hdc
, rc
.left
, rc
.top
, rc
.right
, rc
.top
+ 2, GetSysColor(COLOR_3DSHADOW
), GetSysColor(COLOR_3DHILIGHT
));
227 if (wParam
== SIZE_MINIMIZED
)
232 nXDifference
= cx
- nPerformancePageWidth
;
233 nYDifference
= cy
- nPerformancePageHeight
;
234 nPerformancePageWidth
= cx
;
235 nPerformancePageHeight
= cy
;
238 /* Reposition the performance page's controls */
239 AdjustFrameSize(hPerformancePageTotalsFrame
, hDlg
, 0, nYDifference
, 0);
240 AdjustFrameSize(hPerformancePageCommitChargeFrame
, hDlg
, 0, nYDifference
, 0);
241 AdjustFrameSize(hPerformancePageKernelMemoryFrame
, hDlg
, 0, nYDifference
, 0);
242 AdjustFrameSize(hPerformancePagePhysicalMemoryFrame
, hDlg
, 0, nYDifference
, 0);
243 AdjustCntrlPos(IDS_COMMIT_CHARGE_TOTAL
, hDlg
, 0, nYDifference
);
244 AdjustCntrlPos(IDS_COMMIT_CHARGE_LIMIT
, hDlg
, 0, nYDifference
);
245 AdjustCntrlPos(IDS_COMMIT_CHARGE_PEAK
, hDlg
, 0, nYDifference
);
246 AdjustCntrlPos(IDS_KERNEL_MEMORY_TOTAL
, hDlg
, 0, nYDifference
);
247 AdjustCntrlPos(IDS_KERNEL_MEMORY_PAGED
, hDlg
, 0, nYDifference
);
248 AdjustCntrlPos(IDS_KERNEL_MEMORY_NONPAGED
, hDlg
, 0, nYDifference
);
249 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_TOTAL
, hDlg
, 0, nYDifference
);
250 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_AVAILABLE
, hDlg
, 0, nYDifference
);
251 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_SYSTEM_CACHE
, hDlg
, 0, nYDifference
);
252 AdjustCntrlPos(IDS_TOTALS_HANDLE_COUNT
, hDlg
, 0, nYDifference
);
253 AdjustCntrlPos(IDS_TOTALS_PROCESS_COUNT
, hDlg
, 0, nYDifference
);
254 AdjustCntrlPos(IDS_TOTALS_THREAD_COUNT
, hDlg
, 0, nYDifference
);
256 AdjustControlPostion(hPerformancePageCommitChargeTotalEdit
, hDlg
, 0, nYDifference
);
257 AdjustControlPostion(hPerformancePageCommitChargeLimitEdit
, hDlg
, 0, nYDifference
);
258 AdjustControlPostion(hPerformancePageCommitChargePeakEdit
, hDlg
, 0, nYDifference
);
259 AdjustControlPostion(hPerformancePageKernelMemoryTotalEdit
, hDlg
, 0, nYDifference
);
260 AdjustControlPostion(hPerformancePageKernelMemoryPagedEdit
, hDlg
, 0, nYDifference
);
261 AdjustControlPostion(hPerformancePageKernelMemoryNonPagedEdit
, hDlg
, 0, nYDifference
);
262 AdjustControlPostion(hPerformancePagePhysicalMemoryTotalEdit
, hDlg
, 0, nYDifference
);
263 AdjustControlPostion(hPerformancePagePhysicalMemoryAvailableEdit
, hDlg
, 0, nYDifference
);
264 AdjustControlPostion(hPerformancePagePhysicalMemorySystemCacheEdit
, hDlg
, 0, nYDifference
);
265 AdjustControlPostion(hPerformancePageTotalsHandleCountEdit
, hDlg
, 0, nYDifference
);
266 AdjustControlPostion(hPerformancePageTotalsProcessCountEdit
, hDlg
, 0, nYDifference
);
267 AdjustControlPostion(hPerformancePageTotalsThreadCountEdit
, hDlg
, 0, nYDifference
);
269 nXDifference
+= lastX
;
270 nYDifference
+= lastY
;
272 if (nXDifference
% 2) {
273 if (nXDifference
> 0) {
281 if (nYDifference
% 2) {
282 if (nYDifference
> 0) {
290 AdjustFrameSize(hPerformancePageCpuUsageFrame
, hDlg
, nXDifference
, nYDifference
, 1);
291 AdjustFrameSize(hPerformancePageMemUsageFrame
, hDlg
, nXDifference
, nYDifference
, 2);
292 AdjustFrameSize(hPerformancePageCpuUsageHistoryFrame
, hDlg
, nXDifference
, nYDifference
, 3);
293 AdjustFrameSize(hPerformancePageMemUsageHistoryFrame
, hDlg
, nXDifference
, nYDifference
, 4);
294 AdjustFrameSize(hPerformancePageCpuUsageGraph
, hDlg
, nXDifference
, nYDifference
, 1);
295 AdjustFrameSize(hPerformancePageMemUsageGraph
, hDlg
, nXDifference
, nYDifference
, 2);
296 AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph
, hDlg
, nXDifference
, nYDifference
, 3);
297 AdjustFrameSize(hPerformancePageMemUsageHistoryGraph
, hDlg
, nXDifference
, nYDifference
, 4);
303 void RefreshPerformancePage(void)
306 /* Signal the event so that our refresh thread */
307 /* will wake up and refresh the performance page */
308 PostThreadMessage(dwPerformanceThread
, WM_TIMER
, 0, 0);
312 DWORD WINAPI
PerformancePageRefreshThread(void *lpParameter
)
314 ULONG CommitChargeTotal
;
315 ULONG CommitChargeLimit
;
316 ULONG CommitChargePeak
;
319 ULONG CpuKernelUsage
;
321 ULONG KernelMemoryTotal
;
322 ULONG KernelMemoryPaged
;
323 ULONG KernelMemoryNonPaged
;
325 ULONG PhysicalMemoryTotal
;
326 ULONG PhysicalMemoryAvailable
;
327 ULONG PhysicalMemorySystemCache
;
331 ULONG TotalProcesses
;
334 WCHAR szMemUsage
[256];
338 LoadStringW(hInst
, IDS_STATUS_MEMUSAGE
, szMemUsage
, 256);
345 /* Wait for an the event or application close */
346 if (GetMessage(&msg
, NULL
, 0, 0) <= 0)
349 if (msg
.message
== WM_TIMER
)
352 * Update the commit charge info
354 CommitChargeTotal
= PerfDataGetCommitChargeTotalK();
355 CommitChargeLimit
= PerfDataGetCommitChargeLimitK();
356 CommitChargePeak
= PerfDataGetCommitChargePeakK();
357 _ultow(CommitChargeTotal
, Text
, 10);
358 SetWindowTextW(hPerformancePageCommitChargeTotalEdit
, Text
);
359 _ultow(CommitChargeLimit
, Text
, 10);
360 SetWindowTextW(hPerformancePageCommitChargeLimitEdit
, Text
);
361 _ultow(CommitChargePeak
, Text
, 10);
362 SetWindowTextW(hPerformancePageCommitChargePeakEdit
, Text
);
363 wsprintfW(Text
, szMemUsage
, CommitChargeTotal
, CommitChargeLimit
);
364 SendMessageW(hStatusWnd
, SB_SETTEXT
, 2, (LPARAM
)Text
);
367 * Update the kernel memory info
369 KernelMemoryTotal
= PerfDataGetKernelMemoryTotalK();
370 KernelMemoryPaged
= PerfDataGetKernelMemoryPagedK();
371 KernelMemoryNonPaged
= PerfDataGetKernelMemoryNonPagedK();
372 _ultow(KernelMemoryTotal
, Text
, 10);
373 SetWindowTextW(hPerformancePageKernelMemoryTotalEdit
, Text
);
374 _ultow(KernelMemoryPaged
, Text
, 10);
375 SetWindowTextW(hPerformancePageKernelMemoryPagedEdit
, Text
);
376 _ultow(KernelMemoryNonPaged
, Text
, 10);
377 SetWindowTextW(hPerformancePageKernelMemoryNonPagedEdit
, Text
);
380 * Update the physical memory info
382 PhysicalMemoryTotal
= PerfDataGetPhysicalMemoryTotalK();
383 PhysicalMemoryAvailable
= PerfDataGetPhysicalMemoryAvailableK();
384 PhysicalMemorySystemCache
= PerfDataGetPhysicalMemorySystemCacheK();
385 _ultow(PhysicalMemoryTotal
, Text
, 10);
386 SetWindowTextW(hPerformancePagePhysicalMemoryTotalEdit
, Text
);
387 _ultow(PhysicalMemoryAvailable
, Text
, 10);
388 SetWindowTextW(hPerformancePagePhysicalMemoryAvailableEdit
, Text
);
389 _ultow(PhysicalMemorySystemCache
, Text
, 10);
390 SetWindowTextW(hPerformancePagePhysicalMemorySystemCacheEdit
, Text
);
393 * Update the totals info
395 TotalHandles
= PerfDataGetSystemHandleCount();
396 TotalThreads
= PerfDataGetTotalThreadCount();
397 TotalProcesses
= PerfDataGetProcessCount();
398 _ultow(TotalHandles
, Text
, 10);
399 SetWindowTextW(hPerformancePageTotalsHandleCountEdit
, Text
);
400 _ultow(TotalThreads
, Text
, 10);
401 SetWindowTextW(hPerformancePageTotalsThreadCountEdit
, Text
);
402 _ultow(TotalProcesses
, Text
, 10);
403 SetWindowTextW(hPerformancePageTotalsProcessCountEdit
, Text
);
408 InvalidateRect(hPerformancePageCpuUsageGraph
, NULL
, FALSE
);
409 InvalidateRect(hPerformancePageMemUsageGraph
, NULL
, FALSE
);
414 CpuUsage
= PerfDataGetProcessorUsage();
415 if (CpuUsage
<= 0 ) CpuUsage
= 0;
416 if (CpuUsage
> 100) CpuUsage
= 100;
418 if (TaskManagerSettings
.ShowKernelTimes
)
420 CpuKernelUsage
= PerfDataGetProcessorSystemUsage();
421 if (CpuKernelUsage
<= 0) CpuKernelUsage
= 0;
422 if (CpuKernelUsage
> 100) CpuKernelUsage
= 100;
429 * Get the memory usage
431 CommitChargeTotal
= PerfDataGetCommitChargeTotalK();
432 CommitChargeLimit
= PerfDataGetCommitChargeLimitK();
433 nBarsUsed1
= CommitChargeLimit
? ((CommitChargeTotal
* 100) / CommitChargeLimit
) : 0;
435 PhysicalMemoryTotal
= PerfDataGetPhysicalMemoryTotalK();
436 PhysicalMemoryAvailable
= PerfDataGetPhysicalMemoryAvailableK();
437 nBarsUsed2
= PhysicalMemoryTotal
? ((PhysicalMemoryAvailable
* 100) / PhysicalMemoryTotal
) : 0;
439 GraphCtrl_AppendPoint(&PerformancePageCpuUsageHistoryGraph
, CpuUsage
, CpuKernelUsage
, 0.0, 0.0);
440 GraphCtrl_AppendPoint(&PerformancePageMemUsageHistoryGraph
, nBarsUsed1
, nBarsUsed2
, 0.0, 0.0);
441 /* PerformancePageMemUsageHistoryGraph.SetRange(0.0, 100.0, 10) ; */
442 InvalidateRect(hPerformancePageMemUsageHistoryGraph
, NULL
, FALSE
);
443 InvalidateRect(hPerformancePageCpuUsageHistoryGraph
, NULL
, FALSE
);
449 void PerformancePage_OnViewShowKernelTimes(void)
454 hMenu
= GetMenu(hMainWnd
);
455 hViewMenu
= GetSubMenu(hMenu
, 2);
457 /* Check or uncheck the show 16-bit tasks menu item */
458 if (GetMenuState(hViewMenu
, ID_VIEW_SHOWKERNELTIMES
, MF_BYCOMMAND
) & MF_CHECKED
)
460 CheckMenuItem(hViewMenu
, ID_VIEW_SHOWKERNELTIMES
, MF_BYCOMMAND
|MF_UNCHECKED
);
461 TaskManagerSettings
.ShowKernelTimes
= FALSE
;
465 CheckMenuItem(hViewMenu
, ID_VIEW_SHOWKERNELTIMES
, MF_BYCOMMAND
|MF_CHECKED
);
466 TaskManagerSettings
.ShowKernelTimes
= TRUE
;
469 RefreshPerformancePage();
472 void PerformancePage_OnViewCPUHistoryOneGraphAll(void)
476 HMENU hCPUHistoryMenu
;
478 hMenu
= GetMenu(hMainWnd
);
479 hViewMenu
= GetSubMenu(hMenu
, 2);
480 hCPUHistoryMenu
= GetSubMenu(hViewMenu
, 3);
482 TaskManagerSettings
.CPUHistory_OneGraphPerCPU
= FALSE
;
483 CheckMenuRadioItem(hCPUHistoryMenu
, ID_VIEW_CPUHISTORY_ONEGRAPHALL
, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
, ID_VIEW_CPUHISTORY_ONEGRAPHALL
, MF_BYCOMMAND
);
486 void PerformancePage_OnViewCPUHistoryOneGraphPerCPU(void)
490 HMENU hCPUHistoryMenu
;
492 hMenu
= GetMenu(hMainWnd
);
493 hViewMenu
= GetSubMenu(hMenu
, 2);
494 hCPUHistoryMenu
= GetSubMenu(hViewMenu
, 3);
496 TaskManagerSettings
.CPUHistory_OneGraphPerCPU
= TRUE
;
497 CheckMenuRadioItem(hCPUHistoryMenu
, ID_VIEW_CPUHISTORY_ONEGRAPHALL
, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
, ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
, MF_BYCOMMAND
);