ReactOS 0.4.15-dev-5893-g1bb4167
perfpage.c
Go to the documentation of this file.
1/*
2 * ReactOS Task Manager
3 *
4 * perfpage.c
5 *
6 * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
7 *
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.
12 *
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.
17 *
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.
21 */
22
23#include "precomp.h"
24#include <shlwapi.h>
25
26extern BOOL bInMenuLoop; /* Tells us if we are in the menu loop - from taskmgr.c */
27
30
31HWND hPerformancePage; /* Performance Property Page */
32HWND hPerformancePageCpuUsageGraph; /* CPU Usage Graph */
33HWND hPerformancePageMemUsageGraph; /* MEM Usage Graph */
34HWND hPerformancePageCpuUsageHistoryGraph; /* CPU Usage History Graph */
35HWND hPerformancePageMemUsageHistoryGraph; /* Memory Usage History Graph */
37HWND hPerformancePageCommitChargeFrame; /* Commit Charge Frame */
38HWND hPerformancePageKernelMemoryFrame; /* Kernel Memory Frame */
39HWND hPerformancePagePhysicalMemoryFrame; /* Physical Memory Frame */
44HWND hPerformancePageCommitChargeTotalEdit; /* Commit Charge Total Edit Control */
45HWND hPerformancePageCommitChargeLimitEdit; /* Commit Charge Limit Edit Control */
46HWND hPerformancePageCommitChargePeakEdit; /* Commit Charge Peak Edit Control */
47HWND hPerformancePageKernelMemoryTotalEdit; /* Kernel Memory Total Edit Control */
48HWND hPerformancePageKernelMemoryPagedEdit; /* Kernel Memory Paged Edit Control */
49HWND hPerformancePageKernelMemoryNonPagedEdit; /* Kernel Memory NonPaged Edit Control */
50HWND hPerformancePagePhysicalMemoryTotalEdit; /* Physical Memory Total Edit Control */
51HWND hPerformancePagePhysicalMemoryAvailableEdit; /* Physical Memory Available Edit Control */
52HWND hPerformancePagePhysicalMemorySystemCacheEdit; /* Physical Memory System Cache Edit Control */
53HWND hPerformancePageTotalsHandleCountEdit; /* Total Handles Edit Control */
54HWND hPerformancePageTotalsProcessCountEdit; /* Total Processes Edit Control */
55HWND hPerformancePageTotalsThreadCountEdit; /* Total Threads Edit Control */
56
57#ifdef RUN_PERF_PAGE
60#endif
61
64static int lastX, lastY;
66
67void AdjustFrameSize(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference, int pos)
68{
69 RECT rc;
70 int cx, cy, sx, sy;
71
72 GetClientRect(hCntrl, &rc);
73 MapWindowPoints(hCntrl, hDlg, (LPPOINT)(PRECT)(&rc), sizeof(RECT)/sizeof(POINT));
74 if (pos) {
75 cx = rc.left;
76 cy = rc.top;
77 sx = rc.right - rc.left;
78 switch (pos) {
79 case 1:
80 break;
81 case 2:
82 cy += nYDifference / 2;
83 break;
84 case 3:
85 sx += nXDifference;
86 break;
87 case 4:
88 cy += nYDifference / 2;
89 sx += nXDifference;
90 break;
91 }
92 sy = rc.bottom - rc.top + nYDifference / 2;
94 } else {
95 cx = rc.left + nXDifference;
96 cy = rc.top + nYDifference;
98 }
99 InvalidateRect(hCntrl, NULL, TRUE);
100}
101
102static void AdjustControlPosition(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference)
103{
104 AdjustFrameSize(hCntrl, hDlg, nXDifference, nYDifference, 0);
105}
106
107static void AdjustCntrlPos(int ctrl_id, HWND hDlg, int nXDifference, int nYDifference)
108{
109 AdjustFrameSize(GetDlgItem(hDlg, ctrl_id), hDlg, nXDifference, nYDifference, 0);
110}
111
114{
115 RECT rc;
116 int nXDifference;
117 int nYDifference;
118/* HDC hdc; */
119/* PAINTSTRUCT ps; */
120
121 switch (message) {
122 case WM_DESTROY:
125#ifdef RUN_PERF_PAGE
127#endif
128 break;
129
130 case WM_INITDIALOG:
131 {
132 BOOL bGraph;
134
135 /* Save the width and height */
136 GetClientRect(hDlg, &rc);
139
140 /* Update window position */
142
143 /*
144 * Get handles to all the controls
145 */
150
155
168
173
174 /* Create the controls */
175 fmt.clrBack = RGB(0, 0, 0);
176 fmt.clrGrid = RGB(0, 128, 64);
177 fmt.clrPlot0 = RGB(0, 255, 0);
178 fmt.clrPlot1 = RGB(255, 0, 0);
179 fmt.GridCellWidth = fmt.GridCellHeight = 12;
180 fmt.DrawSecondaryPlot = TaskManagerSettings.ShowKernelTimes;
182 if (!bGraph)
183 {
184 EndDialog(hDlg, 0);
185 return FALSE;
186 }
187
188 fmt.clrPlot0 = RGB(255, 255, 0);
189 fmt.clrPlot1 = RGB(100, 255, 255);
190 fmt.DrawSecondaryPlot = TRUE;
192 if (!bGraph)
193 {
194 EndDialog(hDlg, 0);
195 return FALSE;
196 }
197
198 /* Start our refresh thread */
199#ifdef RUN_PERF_PAGE
201#endif
202
203 /*
204 * Subclass graph buttons
205 */
210 return TRUE;
211 }
212
213 case WM_COMMAND:
214 break;
215#if 0
216 case WM_NCPAINT:
217 hdc = GetDC(hDlg);
218 GetClientRect(hDlg, &rc);
220 ReleaseDC(hDlg, hdc);
221 break;
222
223 case WM_PAINT:
224 hdc = BeginPaint(hDlg, &ps);
225 GetClientRect(hDlg, &rc);
227 EndPaint(hDlg, &ps);
228 break;
229#endif
230 case WM_SIZE:
231 do {
232 int cx, cy;
233
234 if (wParam == SIZE_MINIMIZED)
235 return 0;
236
237 cx = LOWORD(lParam);
238 cy = HIWORD(lParam);
239 nXDifference = cx - nPerformancePageWidth;
240 nYDifference = cy - nPerformancePageHeight;
243 } while (0);
244
245 /* Reposition the performance page's controls */
246 AdjustFrameSize(hPerformancePageTotalsFrame, hDlg, 0, nYDifference, 0);
247 AdjustFrameSize(hPerformancePageCommitChargeFrame, hDlg, 0, nYDifference, 0);
248 AdjustFrameSize(hPerformancePageKernelMemoryFrame, hDlg, 0, nYDifference, 0);
249 AdjustFrameSize(hPerformancePagePhysicalMemoryFrame, hDlg, 0, nYDifference, 0);
250 AdjustCntrlPos(IDS_COMMIT_CHARGE_TOTAL, hDlg, 0, nYDifference);
251 AdjustCntrlPos(IDS_COMMIT_CHARGE_LIMIT, hDlg, 0, nYDifference);
252 AdjustCntrlPos(IDS_COMMIT_CHARGE_PEAK, hDlg, 0, nYDifference);
253 AdjustCntrlPos(IDS_KERNEL_MEMORY_TOTAL, hDlg, 0, nYDifference);
254 AdjustCntrlPos(IDS_KERNEL_MEMORY_PAGED, hDlg, 0, nYDifference);
255 AdjustCntrlPos(IDS_KERNEL_MEMORY_NONPAGED, hDlg, 0, nYDifference);
256 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_TOTAL, hDlg, 0, nYDifference);
257 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_AVAILABLE, hDlg, 0, nYDifference);
258 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_SYSTEM_CACHE, hDlg, 0, nYDifference);
259 AdjustCntrlPos(IDS_TOTALS_HANDLE_COUNT, hDlg, 0, nYDifference);
260 AdjustCntrlPos(IDS_TOTALS_PROCESS_COUNT, hDlg, 0, nYDifference);
261 AdjustCntrlPos(IDS_TOTALS_THREAD_COUNT, hDlg, 0, nYDifference);
262
275
276 nXDifference += lastX;
277 nYDifference += lastY;
278 lastX = lastY = 0;
279 if (nXDifference % 2) {
280 if (nXDifference > 0) {
281 nXDifference--;
282 lastX++;
283 } else {
284 nXDifference++;
285 lastX--;
286 }
287 }
288 if (nYDifference % 2) {
289 if (nYDifference > 0) {
290 nYDifference--;
291 lastY++;
292 } else {
293 nYDifference++;
294 lastY--;
295 }
296 }
297 AdjustFrameSize(hPerformancePageCpuUsageFrame, hDlg, nXDifference, nYDifference, 1);
298 AdjustFrameSize(hPerformancePageMemUsageFrame, hDlg, nXDifference, nYDifference, 2);
299 AdjustFrameSize(hPerformancePageCpuUsageHistoryFrame, hDlg, nXDifference, nYDifference, 3);
300 AdjustFrameSize(hPerformancePageMemUsageHistoryFrame, hDlg, nXDifference, nYDifference, 4);
301 AdjustFrameSize(hPerformancePageCpuUsageGraph, hDlg, nXDifference, nYDifference, 1);
302 AdjustFrameSize(hPerformancePageMemUsageGraph, hDlg, nXDifference, nYDifference, 2);
303 AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph, hDlg, nXDifference, nYDifference, 3);
304 AdjustFrameSize(hPerformancePageMemUsageHistoryGraph, hDlg, nXDifference, nYDifference, 4);
305 break;
306 }
307 return 0;
308}
309
311{
312#ifdef RUN_PERF_PAGE
313 /* Signal the event so that our refresh thread */
314 /* will wake up and refresh the performance page */
316#endif
317}
318
320{
321 ULONGLONG CommitChargeTotal;
322 ULONGLONG CommitChargeLimit;
323 ULONGLONG CommitChargePeak;
324
325 ULONG CpuUsage;
326 ULONG CpuKernelUsage;
327
328 ULONGLONG KernelMemoryTotal;
329 ULONGLONG KernelMemoryPaged;
330 ULONGLONG KernelMemoryNonPaged;
331
332 ULONGLONG PhysicalMemoryTotal;
333 ULONGLONG PhysicalMemoryAvailable;
334 ULONGLONG PhysicalMemorySystemCache;
335
336 ULONG TotalHandles;
337 ULONG TotalThreads;
338 ULONG TotalProcesses;
339
340 MSG msg;
341
342 WCHAR Text[260];
343 WCHAR szMemUsage[256], szCpuUsage[256], szProcesses[256];
344
345 LoadStringW(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, 256);
346 LoadStringW(hInst, IDS_STATUS_MEMUSAGE, szMemUsage, 256);
347 LoadStringW(hInst, IDS_STATUS_PROCESSES, szProcesses, 256);
348
349 while (1)
350 {
351 int nBarsUsed1;
352 int nBarsUsed2;
353
354 WCHAR szChargeTotalFormat[256];
355 WCHAR szChargeLimitFormat[256];
356
357 /* Wait for an the event or application close */
358 if (GetMessage(&msg, NULL, 0, 0) <= 0)
359 return 0;
360
361 if (msg.message == WM_TIMER)
362 {
363 /*
364 * Update the commit charge info
365 */
366 CommitChargeTotal = PerfDataGetCommitChargeTotalK();
367 CommitChargeLimit = PerfDataGetCommitChargeLimitK();
368 CommitChargePeak = PerfDataGetCommitChargePeakK();
369 _ultow(CommitChargeTotal, Text, 10);
371 _ultow(CommitChargeLimit, Text, 10);
373 _ultow(CommitChargePeak, Text, 10);
375
376 StrFormatByteSizeW(CommitChargeTotal * 1024,
377 szChargeTotalFormat,
378 _countof(szChargeTotalFormat));
379
380 StrFormatByteSizeW(CommitChargeLimit * 1024,
381 szChargeLimitFormat,
382 _countof(szChargeLimitFormat));
383
384 if (!bInMenuLoop)
385 {
386 wsprintfW(Text, szMemUsage, szChargeTotalFormat, szChargeLimitFormat,
387 (CommitChargeLimit ? ((CommitChargeTotal * 100) / CommitChargeLimit) : 0));
389 }
390
391 /*
392 * Update the kernel memory info
393 */
394 KernelMemoryTotal = PerfDataGetKernelMemoryTotalK();
395 KernelMemoryPaged = PerfDataGetKernelMemoryPagedK();
396 KernelMemoryNonPaged = PerfDataGetKernelMemoryNonPagedK();
397 _ultow(KernelMemoryTotal, Text, 10);
399 _ultow(KernelMemoryPaged, Text, 10);
401 _ultow(KernelMemoryNonPaged, Text, 10);
403
404 /*
405 * Update the physical memory info
406 */
407 PhysicalMemoryTotal = PerfDataGetPhysicalMemoryTotalK();
408 PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK();
409 PhysicalMemorySystemCache = PerfDataGetPhysicalMemorySystemCacheK();
410 _ultow(PhysicalMemoryTotal, Text, 10);
412 _ultow(PhysicalMemoryAvailable, Text, 10);
414 _ultow(PhysicalMemorySystemCache, Text, 10);
416
417 /*
418 * Update the totals info
419 */
420 TotalHandles = PerfDataGetSystemHandleCount();
421 TotalThreads = PerfDataGetTotalThreadCount();
422 TotalProcesses = PerfDataGetProcessCount();
423 _ultow(TotalHandles, Text, 10);
425 _ultow(TotalThreads, Text, 10);
427 _ultow(TotalProcesses, Text, 10);
429 if (!bInMenuLoop)
430 {
431 wsprintfW(Text, szProcesses, TotalProcesses);
433 }
434
435 /*
436 * Redraw the graphs
437 */
440
441 /*
442 * Get the CPU usage
443 */
444 CpuUsage = PerfDataGetProcessorUsage();
445 if (CpuUsage <= 0 ) CpuUsage = 0;
446 if (CpuUsage > 100) CpuUsage = 100;
447
448 if (!bInMenuLoop)
449 {
450 wsprintfW(Text, szCpuUsage, CpuUsage);
452 }
453
454 CpuKernelUsage = PerfDataGetProcessorSystemUsage();
455 if (CpuKernelUsage <= 0)
456 CpuKernelUsage = 0;
457 else if (CpuKernelUsage > 100)
458 CpuKernelUsage = 100;
459
460 /*
461 * Get the memory usage
462 */
463 CommitChargeTotal = PerfDataGetCommitChargeTotalK();
464 CommitChargeLimit = PerfDataGetCommitChargeLimitK();
465 nBarsUsed1 = CommitChargeLimit ? ((CommitChargeTotal * 100) / CommitChargeLimit) : 0;
466
467 PhysicalMemoryTotal = PerfDataGetPhysicalMemoryTotalK();
468 PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK();
469 nBarsUsed2 = PhysicalMemoryTotal ? ((PhysicalMemoryAvailable * 100) / PhysicalMemoryTotal) : 0;
470
475 }
476 }
477 return 0;
478}
479
481{
482 HMENU hMenu;
483 HMENU hViewMenu;
484
485 hMenu = GetMenu(hMainWnd);
486 hViewMenu = GetSubMenu(hMenu, 2);
487
488 /* Check or uncheck the show 16-bit tasks menu item */
490 {
494 }
495 else
496 {
500 }
501
504}
505
507{
508 HMENU hMenu;
509 HMENU hViewMenu;
510 HMENU hCPUHistoryMenu;
511
512 hMenu = GetMenu(hMainWnd);
513 hViewMenu = GetSubMenu(hMenu, 2);
514 hCPUHistoryMenu = GetSubMenu(hViewMenu, 3);
515
518}
519
521{
522 HMENU hMenu;
523 HMENU hViewMenu;
524 HMENU hCPUHistoryMenu;
525
526 hMenu = GetMenu(hMainWnd);
527 hViewMenu = GetSubMenu(hMenu, 2);
528 hCPUHistoryMenu = GetSubMenu(hViewMenu, 3);
529
532}
533
#define msg(x)
Definition: auth_time.c:54
#define IDC_PHYSICAL_MEMORY_AVAILABLE
Definition: resource.h:72
#define IDS_STATUS_MEMUSAGE
Definition: resource.h:255
#define IDC_COMMIT_CHARGE_PEAK
Definition: resource.h:66
#define IDC_TOTALS_FRAME
Definition: resource.h:87
#define IDC_PHYSICAL_MEMORY_TOTAL
Definition: resource.h:69
#define IDC_KERNEL_MEMORY_TOTAL
Definition: resource.h:78
#define IDS_KERNEL_MEMORY_NONPAGED
Definition: resource.h:135
#define IDC_MEMORY_USAGE_HISTORY_FRAME
Definition: resource.h:111
#define IDS_PHYSICAL_MEMORY_SYSTEM_CACHE
Definition: resource.h:132
#define IDC_PHYSICAL_MEMORY_FRAME
Definition: resource.h:96
#define IDS_STATUS_CPUUSAGE
Definition: resource.h:256
#define ID_VIEW_SHOWKERNELTIMES
Definition: resource.h:161
#define IDS_TOTALS_THREAD_COUNT
Definition: resource.h:125
#define IDC_MEM_USAGE_HISTORY_GRAPH
Definition: resource.h:120
#define IDS_COMMIT_CHARGE_PEAK
Definition: resource.h:129
#define IDC_CPU_USAGE_HISTORY_FRAME
Definition: resource.h:108
#define IDC_MEM_USAGE_GRAPH
Definition: resource.h:118
#define IDC_CPU_USAGE_HISTORY_GRAPH
Definition: resource.h:121
#define IDS_PHYSICAL_MEMORY_AVAILABLE
Definition: resource.h:131
#define ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
Definition: resource.h:163
#define IDS_KERNEL_MEMORY_TOTAL
Definition: resource.h:133
#define IDS_PHYSICAL_MEMORY_TOTAL
Definition: resource.h:130
#define IDC_COMMIT_CHARGE_TOTAL
Definition: resource.h:59
#define IDC_MEM_USAGE_FRAME
Definition: resource.h:105
#define IDS_KERNEL_MEMORY_PAGED
Definition: resource.h:134
#define IDS_TOTALS_PROCESS_COUNT
Definition: resource.h:126
#define IDC_KERNEL_MEMORY_FRAME
Definition: resource.h:93
#define IDC_TOTALS_HANDLE_COUNT
Definition: resource.h:48
#define ID_VIEW_CPUHISTORY_ONEGRAPHALL
Definition: resource.h:162
#define IDC_KERNEL_MEMORY_NONPAGED
Definition: resource.h:84
#define IDS_COMMIT_CHARGE_TOTAL
Definition: resource.h:127
#define IDC_COMMIT_CHARGE_LIMIT
Definition: resource.h:62
#define IDS_TOTALS_HANDLE_COUNT
Definition: resource.h:124
#define IDC_CPU_USAGE_GRAPH
Definition: resource.h:114
#define IDC_KERNEL_MEMORY_PAGED
Definition: resource.h:81
#define IDC_CPU_USAGE_FRAME
Definition: resource.h:102
#define IDC_TOTALS_PROCESS_COUNT
Definition: resource.h:56
#define IDS_COMMIT_CHARGE_LIMIT
Definition: resource.h:128
#define IDS_STATUS_PROCESSES
Definition: resource.h:257
#define IDC_COMMIT_CHARGE_FRAME
Definition: resource.h:90
#define IDC_TOTALS_THREAD_COUNT
Definition: resource.h:53
#define IDC_PHYSICAL_MEMORY_SYSTEM_CACHE
Definition: resource.h:75
HWND hStatusWnd
Definition: charmap.c:22
WPARAM wParam
Definition: combotst.c:138
char * Text
Definition: combotst.c:136
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2380
#define RGB(r, g, b)
Definition: precomp.h:62
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
INT_PTR CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: graph.c:34
WNDPROC OldGraphWndProc
Definition: graph.c:27
WNDPROC OldGraphCtrlWndProc
Definition: graphctl.c:13
void GraphCtrl_AddPoint(PTM_GRAPH_CONTROL inst, BYTE val0, BYTE val1)
Definition: graphctl.c:139
BOOL GraphCtrl_Create(PTM_GRAPH_CONTROL inst, HWND hWnd, HWND hParentWnd, PTM_FORMAT fmt)
Definition: graphctl.c:16
void GraphCtrl_RedrawBitmap(PTM_GRAPH_CONTROL inst, INT h)
Definition: graphctl.c:209
void GraphCtrl_Dispose(PTM_GRAPH_CONTROL inst)
Definition: graphctl.c:114
INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: graphctl.c:300
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
HWND hMainWnd
Definition: magnifier.c:32
HDC hdc
Definition: main.c:9
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
ULONG PerfDataGetKernelMemoryNonPagedK(void)
Definition: perfdata.c:1028
ULONG PerfDataGetSystemHandleCount(void)
Definition: perfdata.c:1094
ULONG PerfDataGetPhysicalMemoryTotalK(void)
Definition: perfdata.c:1045
ULONG PerfDataGetTotalThreadCount(void)
Definition: perfdata.c:1107
ULONG PerfDataGetCommitChargePeakK(void)
Definition: perfdata.c:971
ULONG PerfDataGetProcessorSystemUsage(void)
Definition: perfdata.c:481
ULONG PerfDataGetProcessorUsage(void)
Definition: perfdata.c:472
ULONG PerfDataGetKernelMemoryPagedK(void)
Definition: perfdata.c:1011
ULONG PerfDataGetKernelMemoryTotalK(void)
Definition: perfdata.c:988
ULONG PerfDataGetCommitChargeLimitK(void)
Definition: perfdata.c:954
ULONG PerfDataGetPhysicalMemoryAvailableK(void)
Definition: perfdata.c:1062
ULONG PerfDataGetCommitChargeTotalK(void)
Definition: perfdata.c:937
ULONG PerfDataGetProcessCount(void)
Definition: perfdata.c:463
ULONG PerfDataGetPhysicalMemorySystemCacheK(void)
Definition: perfdata.c:1079
HWND hPerformancePageMemUsageHistoryGraph
Definition: perfpage.c:35
static int nPerformancePageHeight
Definition: perfpage.c:63
HWND hPerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:34
HWND hPerformancePageCpuUsageHistoryFrame
Definition: perfpage.c:42
TM_GRAPH_CONTROL PerformancePageMemUsageHistoryGraph
Definition: perfpage.c:29
void PerformancePage_OnViewShowKernelTimes(void)
Definition: perfpage.c:480
HWND hPerformancePageTotalsThreadCountEdit
Definition: perfpage.c:55
HWND hPerformancePagePhysicalMemorySystemCacheEdit
Definition: perfpage.c:52
INT_PTR CALLBACK PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: perfpage.c:113
HWND hPerformancePageTotalsHandleCountEdit
Definition: perfpage.c:53
HWND hPerformancePagePhysicalMemoryFrame
Definition: perfpage.c:39
static void AdjustCntrlPos(int ctrl_id, HWND hDlg, int nXDifference, int nYDifference)
Definition: perfpage.c:107
HWND hPerformancePageMemUsageFrame
Definition: perfpage.c:41
void PerformancePage_OnViewCPUHistoryOneGraphPerCPU(void)
Definition: perfpage.c:520
HWND hPerformancePageCpuUsageGraph
Definition: perfpage.c:32
HWND hPerformancePageCpuUsageFrame
Definition: perfpage.c:40
DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
Definition: perfpage.c:319
HWND hPerformancePageKernelMemoryNonPagedEdit
Definition: perfpage.c:49
HWND hPerformancePageCommitChargeFrame
Definition: perfpage.c:37
HWND hPerformancePageTotalsProcessCountEdit
Definition: perfpage.c:54
HWND hPerformancePageKernelMemoryTotalEdit
Definition: perfpage.c:47
HWND hPerformancePageMemUsageGraph
Definition: perfpage.c:33
static HANDLE hPerformanceThread
Definition: perfpage.c:58
TM_GRAPH_CONTROL PerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:28
static int lastX
Definition: perfpage.c:64
void PerformancePage_OnViewCPUHistoryOneGraphAll(void)
Definition: perfpage.c:506
HWND hPerformancePageCommitChargePeakEdit
Definition: perfpage.c:46
static int nPerformancePageWidth
Definition: perfpage.c:62
HWND hPerformancePageMemUsageHistoryFrame
Definition: perfpage.c:43
void RefreshPerformancePage(void)
Definition: perfpage.c:310
HWND hPerformancePageCommitChargeLimitEdit
Definition: perfpage.c:45
void AdjustFrameSize(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference, int pos)
Definition: perfpage.c:67
static DWORD dwPerformanceThread
Definition: perfpage.c:59
static void AdjustControlPosition(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference)
Definition: perfpage.c:102
HWND hPerformancePagePhysicalMemoryAvailableEdit
Definition: perfpage.c:51
HWND hPerformancePageTotalsFrame
Definition: perfpage.c:36
static int lastY
Definition: perfpage.c:64
HWND hPerformancePagePhysicalMemoryTotalEdit
Definition: perfpage.c:50
HWND hPerformancePageKernelMemoryFrame
Definition: perfpage.c:38
BOOL bInMenuLoop
Definition: taskmgr.c:49
HWND hPerformancePageCommitChargeTotalEdit
Definition: perfpage.c:44
HWND hPerformancePageKernelMemoryPagedEdit
Definition: perfpage.c:48
HWND hPerformancePage
Definition: perfpage.c:31
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define SB_SETTEXT
Definition: commctrl.h:1949
#define _countof(array)
Definition: sndvol32.h:68
BOOL CPUHistory_OneGraphPerCPU
Definition: taskmgr.h:87
BOOL DrawSecondaryPlot
Definition: graphctl.h:56
Definition: dsound.c:943
Definition: tftpd.h:60
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
Definition: taskmgr.c:1181
void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)
Definition: taskmgr.c:552
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
#define GWLP_WNDPROC
Definition: treelist.c:66
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT_PTR
Definition: typedefs.h:64
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define HIWORD(l)
Definition: typedefs.h:247
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define WM_PAINT
Definition: winuser.h:1610
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define MF_BYCOMMAND
Definition: winuser.h:202
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_SIZE
Definition: winuser.h:1601
#define WM_COMMAND
Definition: winuser.h:1730
#define COLOR_3DSHADOW
Definition: winuser.h:925
#define MF_CHECKED
Definition: winuser.h:132
#define SWP_NOSIZE
Definition: winuser.h:1235
#define SIZE_MINIMIZED
Definition: winuser.h:2496
#define WM_INITDIALOG
Definition: winuser.h:1729
#define PostThreadMessage
Definition: winuser.h:5823
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define MF_UNCHECKED
Definition: winuser.h:204
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define GetMessage
Definition: winuser.h:5780
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_TIMER
Definition: winuser.h:1732
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define COLOR_3DHILIGHT
Definition: winuser.h:931
#define SWP_NOOWNERZORDER
Definition: winuser.h:1239
#define WM_DESTROY
Definition: winuser.h:1599
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#define SWP_NOZORDER
Definition: winuser.h:1237
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5336
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
#define WM_NCPAINT
Definition: winuser.h:1677
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
__wchar_t WCHAR
Definition: xmlstorage.h:180