ReactOS 0.4.16-dev-250-g3ecd236
perfpage.c File Reference
#include "precomp.h"
#include <shlwapi.h>
Include dependency graph for perfpage.c:

Go to the source code of this file.

Functions

DWORD WINAPI PerformancePageRefreshThread (PVOID Parameter)
 
void AdjustFrameSize (HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference, int pos)
 
static void AdjustControlPosition (HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference)
 
static void AdjustCntrlPos (int ctrl_id, HWND hDlg, int nXDifference, int nYDifference)
 
INT_PTR CALLBACK PerformancePageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
void RefreshPerformancePage (void)
 
void PerformancePage_OnViewShowKernelTimes (void)
 
void PerformancePage_OnViewCPUHistoryOneGraphAll (void)
 
void PerformancePage_OnViewCPUHistoryOneGraphPerCPU (void)
 

Variables

TM_GRAPH_CONTROL PerformancePageCpuUsageHistoryGraph
 
TM_GRAPH_CONTROL PerformancePageMemUsageHistoryGraph
 
HWND hPerformancePage
 
static HWND hCpuUsageGraph
 
static HWND hMemUsageGraph
 
HWND hPerformancePageCpuUsageHistoryGraph
 
HWND hPerformancePageMemUsageHistoryGraph
 
static HWND hTotalsFrame
 
static HWND hCommitChargeFrame
 
static HWND hKernelMemoryFrame
 
static HWND hPhysicalMemoryFrame
 
static HWND hCpuUsageFrame
 
static HWND hMemUsageFrame
 
static HWND hCpuUsageHistoryFrame
 
static HWND hMemUsageHistoryFrame
 
static HWND hCommitChargeTotalEdit
 
static HWND hCommitChargeLimitEdit
 
static HWND hCommitChargePeakEdit
 
static HWND hKernelMemoryTotalEdit
 
static HWND hKernelMemoryPagedEdit
 
static HWND hKernelMemoryNonPagedEdit
 
static HWND hPhysicalMemoryTotalEdit
 
static HWND hPhysicalMemoryAvailableEdit
 
static HWND hPhysicalMemorySystemCacheEdit
 
static HWND hTotalsHandleCountEdit
 
static HWND hTotalsProcessCountEdit
 
static HWND hTotalsThreadCountEdit
 
static HANDLE hPerformanceThread = NULL
 
static DWORD dwPerformanceThread
 
static int nPerformancePageWidth
 
static int nPerformancePageHeight
 
static int lastX
 
static int lastY
 

Function Documentation

◆ AdjustCntrlPos()

static void AdjustCntrlPos ( int  ctrl_id,
HWND  hDlg,
int  nXDifference,
int  nYDifference 
)
inlinestatic

Definition at line 92 of file perfpage.c.

93{
94 AdjustFrameSize(GetDlgItem(hDlg, ctrl_id), hDlg, nXDifference, nYDifference, 0);
95}
void AdjustFrameSize(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference, int pos)
Definition: perfpage.c:50
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)

Referenced by PerformancePageWndProc().

◆ AdjustControlPosition()

static void AdjustControlPosition ( HWND  hCntrl,
HWND  hDlg,
int  nXDifference,
int  nYDifference 
)
inlinestatic

Definition at line 86 of file perfpage.c.

87{
88 AdjustFrameSize(hCntrl, hDlg, nXDifference, nYDifference, 0);
89}

Referenced by PerformancePageWndProc().

◆ AdjustFrameSize()

void AdjustFrameSize ( HWND  hCntrl,
HWND  hDlg,
int  nXDifference,
int  nYDifference,
int  pos 
)

Definition at line 50 of file perfpage.c.

51{
52 RECT rc;
53 int cx, cy, sx, sy;
54
55 GetClientRect(hCntrl, &rc);
56 MapWindowPoints(hCntrl, hDlg, (LPPOINT)(PRECT)(&rc), sizeof(RECT)/sizeof(POINT));
57 if (pos) {
58 cx = rc.left;
59 cy = rc.top;
60 sx = rc.right - rc.left;
61 switch (pos) {
62 case 1:
63 break;
64 case 2:
65 cy += nYDifference / 2;
66 break;
67 case 3:
68 sx += nXDifference;
69 break;
70 case 4:
71 cy += nYDifference / 2;
72 sx += nXDifference;
73 break;
74 }
75 sy = rc.bottom - rc.top + nYDifference / 2;
77 } else {
78 cx = rc.left + nXDifference;
79 cy = rc.top + nYDifference;
81 }
82 InvalidateRect(hCntrl, NULL, TRUE);
83}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SWP_NOACTIVATE
Definition: winuser.h:1245
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1248
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOOWNERZORDER
Definition: winuser.h:1252
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define SWP_NOZORDER
Definition: winuser.h:1250

Referenced by AdjustCntrlPos(), AdjustControlPosition(), and PerformancePageWndProc().

◆ PerformancePage_OnViewCPUHistoryOneGraphAll()

void PerformancePage_OnViewCPUHistoryOneGraphAll ( void  )

Definition at line 479 of file perfpage.c.

480{
481 HMENU hMenu;
482 HMENU hViewMenu;
483 HMENU hCPUHistoryMenu;
484
485 hMenu = GetMenu(hMainWnd);
486 hViewMenu = GetSubMenu(hMenu, 2);
487 hCPUHistoryMenu = GetSubMenu(hViewMenu, 3);
488
491}
#define ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
Definition: resource.h:168
#define ID_VIEW_CPUHISTORY_ONEGRAPHALL
Definition: resource.h:167
#define FALSE
Definition: types.h:117
HWND hMainWnd
Definition: magnifier.c:32
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
BOOL CPUHistory_OneGraphPerCPU
Definition: taskmgr.h:54
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:37
#define MF_BYCOMMAND
Definition: winuser.h:202
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
HMENU WINAPI GetMenu(_In_ HWND)

Referenced by TaskManagerWndProc().

◆ PerformancePage_OnViewCPUHistoryOneGraphPerCPU()

void PerformancePage_OnViewCPUHistoryOneGraphPerCPU ( void  )

Definition at line 493 of file perfpage.c.

494{
495 HMENU hMenu;
496 HMENU hViewMenu;
497 HMENU hCPUHistoryMenu;
498
499 hMenu = GetMenu(hMainWnd);
500 hViewMenu = GetSubMenu(hMenu, 2);
501 hCPUHistoryMenu = GetSubMenu(hViewMenu, 3);
502
505}

Referenced by TaskManagerWndProc().

◆ PerformancePage_OnViewShowKernelTimes()

void PerformancePage_OnViewShowKernelTimes ( void  )

Definition at line 453 of file perfpage.c.

454{
455 HMENU hMenu;
456 HMENU hViewMenu;
457
458 hMenu = GetMenu(hMainWnd);
459 hViewMenu = GetSubMenu(hMenu, 2);
460
461 /* Check or uncheck the show 16-bit tasks menu item */
463 {
467 }
468 else
469 {
473 }
474
477}
#define ID_VIEW_SHOWKERNELTIMES
Definition: resource.h:166
void GraphCtrl_RedrawBitmap(PTM_GRAPH_CONTROL inst, INT h)
Definition: graphctl.c:210
TM_GRAPH_CONTROL PerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:11
void RefreshPerformancePage(void)
Definition: perfpage.c:288
BOOL DrawSecondaryPlot
Definition: graphctl.h:41
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)

Referenced by TaskManagerWndProc().

◆ PerformancePageRefreshThread()

DWORD WINAPI PerformancePageRefreshThread ( PVOID  Parameter)

Definition at line 297 of file perfpage.c.

298{
299 ULONGLONG CommitChargeTotal;
300 ULONGLONG CommitChargeLimit;
301 ULONGLONG CommitChargePeak;
302
303 ULONG CpuUsage;
304 ULONG CpuKernelUsage;
305
306 ULONGLONG KernelMemoryTotal;
307 ULONGLONG KernelMemoryPaged;
308 ULONGLONG KernelMemoryNonPaged;
309
310 ULONGLONG PhysicalMemoryTotal;
311 ULONGLONG PhysicalMemoryAvailable;
312 ULONGLONG PhysicalMemorySystemCache;
313
314 ULONG TotalHandles;
315 ULONG TotalThreads;
316 ULONG TotalProcesses;
317
318 MSG msg;
319
320 WCHAR Text[260];
321 WCHAR szMemUsage[256], szCpuUsage[256], szProcesses[256];
322
323 LoadStringW(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, _countof(szCpuUsage));
324 LoadStringW(hInst, IDS_STATUS_MEMUSAGE, szMemUsage, _countof(szMemUsage));
325 LoadStringW(hInst, IDS_STATUS_PROCESSES, szProcesses, _countof(szProcesses));
326
327 while (1)
328 {
329 extern BOOL bTrackMenu; // From taskmgr.c
330
331 int nBarsUsed1;
332 int nBarsUsed2;
333
334 WCHAR szChargeTotalFormat[256];
335 WCHAR szChargeLimitFormat[256];
336
337 /* Wait for an the event or application close */
338 if (GetMessage(&msg, NULL, 0, 0) <= 0)
339 return 0;
340
341 if (msg.message == WM_TIMER)
342 {
343 /*
344 * Update the commit charge info
345 */
346 CommitChargeTotal = PerfDataGetCommitChargeTotalK();
347 CommitChargeLimit = PerfDataGetCommitChargeLimitK();
348 CommitChargePeak = PerfDataGetCommitChargePeakK();
349 _ultow(CommitChargeTotal, Text, 10);
351 _ultow(CommitChargeLimit, Text, 10);
353 _ultow(CommitChargePeak, Text, 10);
355
356 StrFormatByteSizeW(CommitChargeTotal * 1024,
357 szChargeTotalFormat,
358 _countof(szChargeTotalFormat));
359
360 StrFormatByteSizeW(CommitChargeLimit * 1024,
361 szChargeLimitFormat,
362 _countof(szChargeLimitFormat));
363
364 if (!bTrackMenu)
365 {
366 wsprintfW(Text, szMemUsage, szChargeTotalFormat, szChargeLimitFormat,
367 (CommitChargeLimit ? ((CommitChargeTotal * 100) / CommitChargeLimit) : 0));
369 }
370
371 /*
372 * Update the kernel memory info
373 */
374 KernelMemoryTotal = PerfDataGetKernelMemoryTotalK();
375 KernelMemoryPaged = PerfDataGetKernelMemoryPagedK();
376 KernelMemoryNonPaged = PerfDataGetKernelMemoryNonPagedK();
377 _ultow(KernelMemoryTotal, Text, 10);
379 _ultow(KernelMemoryPaged, Text, 10);
381 _ultow(KernelMemoryNonPaged, Text, 10);
383
384 /*
385 * Update the physical memory info
386 */
387 PhysicalMemoryTotal = PerfDataGetPhysicalMemoryTotalK();
388 PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK();
389 PhysicalMemorySystemCache = PerfDataGetPhysicalMemorySystemCacheK();
390 _ultow(PhysicalMemoryTotal, Text, 10);
392 _ultow(PhysicalMemoryAvailable, Text, 10);
394 _ultow(PhysicalMemorySystemCache, Text, 10);
396
397 /*
398 * Update the totals info
399 */
400 TotalHandles = PerfDataGetSystemHandleCount();
401 TotalThreads = PerfDataGetTotalThreadCount();
402 TotalProcesses = PerfDataGetProcessCount();
403 _ultow(TotalHandles, Text, 10);
405 _ultow(TotalThreads, Text, 10);
407 _ultow(TotalProcesses, Text, 10);
409 if (!bTrackMenu)
410 {
411 wsprintfW(Text, szProcesses, TotalProcesses);
413 }
414
415 /*
416 * Redraw the graphs
417 */
420
421 /*
422 * Get the CPU usage
423 */
424 CpuUsage = PerfDataGetProcessorUsage();
425 CpuKernelUsage = PerfDataGetProcessorSystemUsage();
426
427 if (!bTrackMenu)
428 {
429 wsprintfW(Text, szCpuUsage, CpuUsage);
431 }
432
433 /*
434 * Get the memory usage
435 */
436 CommitChargeTotal = PerfDataGetCommitChargeTotalK();
437 CommitChargeLimit = PerfDataGetCommitChargeLimitK();
438 nBarsUsed1 = CommitChargeLimit ? ((CommitChargeTotal * 100) / CommitChargeLimit) : 0;
439
440 PhysicalMemoryTotal = PerfDataGetPhysicalMemoryTotalK();
441 PhysicalMemoryAvailable = PerfDataGetPhysicalMemoryAvailableK();
442 nBarsUsed2 = PhysicalMemoryTotal ? ((PhysicalMemoryAvailable * 100) / PhysicalMemoryTotal) : 0;
443
448 }
449 }
450 return 0;
451}
#define msg(x)
Definition: auth_time.c:54
#define IDS_STATUS_MEMUSAGE
Definition: resource.h:260
#define IDS_STATUS_CPUUSAGE
Definition: resource.h:261
#define IDS_STATUS_PROCESSES
Definition: resource.h:262
HWND hStatusWnd
Definition: charmap.c:22
char * Text
Definition: combotst.c:136
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2388
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
void GraphCtrl_AddPoint(PTM_GRAPH_CONTROL inst, BYTE val0, BYTE val1)
Definition: graphctl.c:140
_CRTIMP wchar_t *__cdecl _ultow(_In_ unsigned long _Value, _Pre_notnull_ _Post_z_ wchar_t *_Dest, _In_ int _Radix)
ULONG PerfDataGetKernelMemoryNonPagedK(void)
Definition: perfdata.c:1010
ULONG PerfDataGetSystemHandleCount(void)
Definition: perfdata.c:1076
ULONG PerfDataGetPhysicalMemoryTotalK(void)
Definition: perfdata.c:1027
ULONG PerfDataGetTotalThreadCount(void)
Definition: perfdata.c:1089
ULONG PerfDataGetCommitChargePeakK(void)
Definition: perfdata.c:953
ULONG PerfDataGetProcessorSystemUsage(void)
Definition: perfdata.c:464
ULONG PerfDataGetProcessorUsage(void)
Definition: perfdata.c:455
ULONG PerfDataGetKernelMemoryPagedK(void)
Definition: perfdata.c:993
ULONG PerfDataGetKernelMemoryTotalK(void)
Definition: perfdata.c:970
ULONG PerfDataGetCommitChargeLimitK(void)
Definition: perfdata.c:936
ULONG PerfDataGetPhysicalMemoryAvailableK(void)
Definition: perfdata.c:1044
ULONG PerfDataGetCommitChargeTotalK(void)
Definition: perfdata.c:919
ULONG PerfDataGetProcessCount(void)
Definition: perfdata.c:446
ULONG PerfDataGetPhysicalMemorySystemCacheK(void)
Definition: perfdata.c:1061
static HWND hPhysicalMemoryTotalEdit
Definition: perfpage.c:33
static HWND hCommitChargeLimitEdit
Definition: perfpage.c:28
static HWND hTotalsThreadCountEdit
Definition: perfpage.c:38
HWND hPerformancePageMemUsageHistoryGraph
Definition: perfpage.c:18
static HWND hKernelMemoryPagedEdit
Definition: perfpage.c:31
HWND hPerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:17
TM_GRAPH_CONTROL PerformancePageMemUsageHistoryGraph
Definition: perfpage.c:12
static HWND hMemUsageGraph
Definition: perfpage.c:16
static HWND hCommitChargePeakEdit
Definition: perfpage.c:29
static HWND hPhysicalMemoryAvailableEdit
Definition: perfpage.c:34
static HWND hTotalsHandleCountEdit
Definition: perfpage.c:36
static HWND hCommitChargeTotalEdit
Definition: perfpage.c:27
static HWND hCpuUsageGraph
Definition: perfpage.c:15
static HWND hKernelMemoryTotalEdit
Definition: perfpage.c:30
static HWND hKernelMemoryNonPagedEdit
Definition: perfpage.c:32
static HWND hTotalsProcessCountEdit
Definition: perfpage.c:37
static HWND hPhysicalMemorySystemCacheEdit
Definition: perfpage.c:35
#define SB_SETTEXT
Definition: commctrl.h:1954
#define _countof(array)
Definition: sndvol32.h:70
BOOL bTrackMenu
Definition: taskmgr.c:34
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
LONG_PTR LPARAM
Definition: windef.h:208
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 SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define GetMessage
Definition: winuser.h:5802
#define WM_TIMER
Definition: winuser.h:1745
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by PerformancePageWndProc().

◆ PerformancePageWndProc()

INT_PTR CALLBACK PerformancePageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 98 of file perfpage.c.

99{
100 RECT rc;
101
102 switch (message)
103 {
104 case WM_DESTROY:
107#ifdef RUN_PERF_PAGE
109#endif
110 break;
111
112 case WM_INITDIALOG:
113 {
114 BOOL bGraph;
116
117 /* Save the width and height */
118 GetClientRect(hDlg, &rc);
121
122 /* Update window position */
124
125 /*
126 * Get handles to all the controls
127 */
132
137
150
155
156 /* Create the controls */
157 fmt.clrBack = RGB(0, 0, 0);
158 fmt.clrGrid = RGB(0, 128, 64);
159 fmt.clrPlot0 = RGB(0, 255, 0);
160 fmt.clrPlot1 = RGB(255, 0, 0);
161 fmt.GridCellWidth = fmt.GridCellHeight = 12;
162 fmt.DrawSecondaryPlot = TaskManagerSettings.ShowKernelTimes;
164 if (!bGraph)
165 {
166 EndDialog(hDlg, 0);
167 return FALSE;
168 }
169
170 fmt.clrPlot0 = RGB(255, 255, 0);
171 fmt.clrPlot1 = RGB(100, 255, 255);
172 fmt.DrawSecondaryPlot = TRUE;
174 if (!bGraph)
175 {
176 EndDialog(hDlg, 0);
177 return FALSE;
178 }
179
180 /* Start our refresh thread */
181#ifdef RUN_PERF_PAGE
183#endif
184
185 /*
186 * Subclass graph buttons
187 */
192 return TRUE;
193 }
194
195 case WM_COMMAND:
196 break;
197
198 case WM_SIZE:
199 {
200 int cx, cy;
201 int nXDifference;
202 int nYDifference;
203
204 if (wParam == SIZE_MINIMIZED)
205 return 0;
206
207 cx = LOWORD(lParam);
208 cy = HIWORD(lParam);
209 nXDifference = cx - nPerformancePageWidth;
210 nYDifference = cy - nPerformancePageHeight;
213
214 /* Reposition the performance page's controls */
215 AdjustFrameSize(hTotalsFrame, hDlg, 0, nYDifference, 0);
216 AdjustFrameSize(hCommitChargeFrame, hDlg, 0, nYDifference, 0);
217 AdjustFrameSize(hKernelMemoryFrame, hDlg, 0, nYDifference, 0);
218 AdjustFrameSize(hPhysicalMemoryFrame, hDlg, 0, nYDifference, 0);
219 AdjustCntrlPos(IDS_COMMIT_CHARGE_TOTAL, hDlg, 0, nYDifference);
220 AdjustCntrlPos(IDS_COMMIT_CHARGE_LIMIT, hDlg, 0, nYDifference);
221 AdjustCntrlPos(IDS_COMMIT_CHARGE_PEAK, hDlg, 0, nYDifference);
222 AdjustCntrlPos(IDS_KERNEL_MEMORY_TOTAL, hDlg, 0, nYDifference);
223 AdjustCntrlPos(IDS_KERNEL_MEMORY_PAGED, hDlg, 0, nYDifference);
224 AdjustCntrlPos(IDS_KERNEL_MEMORY_NONPAGED, hDlg, 0, nYDifference);
225 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_TOTAL, hDlg, 0, nYDifference);
226 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_AVAILABLE, hDlg, 0, nYDifference);
227 AdjustCntrlPos(IDS_PHYSICAL_MEMORY_SYSTEM_CACHE, hDlg, 0, nYDifference);
228 AdjustCntrlPos(IDS_TOTALS_HANDLE_COUNT, hDlg, 0, nYDifference);
229 AdjustCntrlPos(IDS_TOTALS_PROCESS_COUNT, hDlg, 0, nYDifference);
230 AdjustCntrlPos(IDS_TOTALS_THREAD_COUNT, hDlg, 0, nYDifference);
231
232 AdjustControlPosition(hCommitChargeTotalEdit, hDlg, 0, nYDifference);
233 AdjustControlPosition(hCommitChargeLimitEdit, hDlg, 0, nYDifference);
234 AdjustControlPosition(hCommitChargePeakEdit, hDlg, 0, nYDifference);
235 AdjustControlPosition(hKernelMemoryTotalEdit, hDlg, 0, nYDifference);
236 AdjustControlPosition(hKernelMemoryPagedEdit, hDlg, 0, nYDifference);
237 AdjustControlPosition(hKernelMemoryNonPagedEdit, hDlg, 0, nYDifference);
238 AdjustControlPosition(hPhysicalMemoryTotalEdit, hDlg, 0, nYDifference);
241 AdjustControlPosition(hTotalsHandleCountEdit, hDlg, 0, nYDifference);
242 AdjustControlPosition(hTotalsProcessCountEdit, hDlg, 0, nYDifference);
243 AdjustControlPosition(hTotalsThreadCountEdit, hDlg, 0, nYDifference);
244
245 nXDifference += lastX;
246 nYDifference += lastY;
247 lastX = lastY = 0;
248 if (nXDifference % 2)
249 {
250 if (nXDifference > 0)
251 {
252 nXDifference--;
253 lastX++;
254 }
255 else
256 {
257 nXDifference++;
258 lastX--;
259 }
260 }
261 if (nYDifference % 2)
262 {
263 if (nYDifference > 0)
264 {
265 nYDifference--;
266 lastY++;
267 }
268 else
269 {
270 nYDifference++;
271 lastY--;
272 }
273 }
274 AdjustFrameSize(hCpuUsageFrame, hDlg, nXDifference, nYDifference, 1);
275 AdjustFrameSize(hMemUsageFrame, hDlg, nXDifference, nYDifference, 2);
276 AdjustFrameSize(hCpuUsageHistoryFrame, hDlg, nXDifference, nYDifference, 3);
277 AdjustFrameSize(hMemUsageHistoryFrame, hDlg, nXDifference, nYDifference, 4);
278 AdjustFrameSize(hCpuUsageGraph, hDlg, nXDifference, nYDifference, 1);
279 AdjustFrameSize(hMemUsageGraph, hDlg, nXDifference, nYDifference, 2);
280 AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph, hDlg, nXDifference, nYDifference, 3);
281 AdjustFrameSize(hPerformancePageMemUsageHistoryGraph, hDlg, nXDifference, nYDifference, 4);
282 break;
283 }
284 }
285 return 0;
286}
#define IDC_PHYSICAL_MEMORY_AVAILABLE
Definition: resource.h:77
#define IDC_COMMIT_CHARGE_PEAK
Definition: resource.h:71
#define IDC_TOTALS_FRAME
Definition: resource.h:92
#define IDC_PHYSICAL_MEMORY_TOTAL
Definition: resource.h:74
#define IDC_KERNEL_MEMORY_TOTAL
Definition: resource.h:83
#define IDS_KERNEL_MEMORY_NONPAGED
Definition: resource.h:140
#define IDC_MEMORY_USAGE_HISTORY_FRAME
Definition: resource.h:116
#define IDS_PHYSICAL_MEMORY_SYSTEM_CACHE
Definition: resource.h:137
#define IDC_PHYSICAL_MEMORY_FRAME
Definition: resource.h:101
#define IDS_TOTALS_THREAD_COUNT
Definition: resource.h:130
#define IDC_MEM_USAGE_HISTORY_GRAPH
Definition: resource.h:125
#define IDS_COMMIT_CHARGE_PEAK
Definition: resource.h:134
#define IDC_CPU_USAGE_HISTORY_FRAME
Definition: resource.h:113
#define IDC_MEM_USAGE_GRAPH
Definition: resource.h:123
#define IDC_CPU_USAGE_HISTORY_GRAPH
Definition: resource.h:126
#define IDS_PHYSICAL_MEMORY_AVAILABLE
Definition: resource.h:136
#define IDS_KERNEL_MEMORY_TOTAL
Definition: resource.h:138
#define IDS_PHYSICAL_MEMORY_TOTAL
Definition: resource.h:135
#define IDC_COMMIT_CHARGE_TOTAL
Definition: resource.h:64
#define IDC_MEM_USAGE_FRAME
Definition: resource.h:110
#define IDS_KERNEL_MEMORY_PAGED
Definition: resource.h:139
#define IDS_TOTALS_PROCESS_COUNT
Definition: resource.h:131
#define IDC_KERNEL_MEMORY_FRAME
Definition: resource.h:98
#define IDC_TOTALS_HANDLE_COUNT
Definition: resource.h:53
#define IDC_KERNEL_MEMORY_NONPAGED
Definition: resource.h:89
#define IDS_COMMIT_CHARGE_TOTAL
Definition: resource.h:132
#define IDC_COMMIT_CHARGE_LIMIT
Definition: resource.h:67
#define IDS_TOTALS_HANDLE_COUNT
Definition: resource.h:129
#define IDC_CPU_USAGE_GRAPH
Definition: resource.h:119
#define IDC_KERNEL_MEMORY_PAGED
Definition: resource.h:86
#define IDC_CPU_USAGE_FRAME
Definition: resource.h:107
#define IDC_TOTALS_PROCESS_COUNT
Definition: resource.h:61
#define IDS_COMMIT_CHARGE_LIMIT
Definition: resource.h:133
#define IDC_COMMIT_CHARGE_FRAME
Definition: resource.h:95
#define IDC_TOTALS_THREAD_COUNT
Definition: resource.h:58
#define IDC_PHYSICAL_MEMORY_SYSTEM_CACHE
Definition: resource.h:80
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
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
#define RGB(r, g, b)
Definition: precomp.h:71
INT_PTR CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: graph.c:19
WNDPROC OldGraphWndProc
Definition: graph.c:12
WNDPROC OldGraphCtrlWndProc
Definition: graphctl.c:14
BOOL GraphCtrl_Create(PTM_GRAPH_CONTROL inst, HWND hWnd, HWND hParentWnd, PTM_FORMAT fmt)
Definition: graphctl.c:17
void GraphCtrl_Dispose(PTM_GRAPH_CONTROL inst)
Definition: graphctl.c:115
INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: graphctl.c:301
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
static int nPerformancePageHeight
Definition: perfpage.c:46
static HWND hCpuUsageHistoryFrame
Definition: perfpage.c:25
DWORD WINAPI PerformancePageRefreshThread(PVOID Parameter)
Definition: perfpage.c:297
static HWND hMemUsageHistoryFrame
Definition: perfpage.c:26
static void AdjustCntrlPos(int ctrl_id, HWND hDlg, int nXDifference, int nYDifference)
Definition: perfpage.c:92
static HWND hPhysicalMemoryFrame
Definition: perfpage.c:22
static HANDLE hPerformanceThread
Definition: perfpage.c:41
static int lastX
Definition: perfpage.c:47
static int nPerformancePageWidth
Definition: perfpage.c:45
static HWND hTotalsFrame
Definition: perfpage.c:19
static DWORD dwPerformanceThread
Definition: perfpage.c:42
static void AdjustControlPosition(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference)
Definition: perfpage.c:86
static HWND hCpuUsageFrame
Definition: perfpage.c:23
static HWND hCommitChargeFrame
Definition: perfpage.c:20
static HWND hMemUsageFrame
Definition: perfpage.c:24
static int lastY
Definition: perfpage.c:47
static HWND hKernelMemoryFrame
Definition: perfpage.c:21
Definition: dsound.c:943
Definition: tftpd.h:60
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
Definition: taskmgr.c:1109
#define GWLP_WNDPROC
Definition: treelist.c:66
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_SIZE
Definition: winuser.h:1614
#define WM_COMMAND
Definition: winuser.h:1743
#define SIZE_MINIMIZED
Definition: winuser.h:2509
#define WM_INITDIALOG
Definition: winuser.h:1742
#define WM_DESTROY
Definition: winuser.h:1612
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909
#define SetWindowLongPtrW
Definition: winuser.h:5358
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by OnCreate().

◆ RefreshPerformancePage()

void RefreshPerformancePage ( void  )

Definition at line 288 of file perfpage.c.

289{
290#ifdef RUN_PERF_PAGE
291 /* Signal the event so that our refresh thread
292 * will wake up and refresh the performance page */
294#endif
295}
#define PostThreadMessage
Definition: winuser.h:5845

Referenced by OnCreate(), PerformancePage_OnViewShowKernelTimes(), TaskManager_OnMenuSelect(), and TaskManagerWndProc().

Variable Documentation

◆ dwPerformanceThread

DWORD dwPerformanceThread
static

Definition at line 42 of file perfpage.c.

Referenced by PerformancePageWndProc(), and RefreshPerformancePage().

◆ hCommitChargeFrame

HWND hCommitChargeFrame
static

Definition at line 20 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hCommitChargeLimitEdit

HWND hCommitChargeLimitEdit
static

Definition at line 28 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hCommitChargePeakEdit

HWND hCommitChargePeakEdit
static

Definition at line 29 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hCommitChargeTotalEdit

HWND hCommitChargeTotalEdit
static

Definition at line 27 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hCpuUsageFrame

HWND hCpuUsageFrame
static

Definition at line 23 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hCpuUsageGraph

HWND hCpuUsageGraph
static

Definition at line 15 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hCpuUsageHistoryFrame

HWND hCpuUsageHistoryFrame
static

Definition at line 25 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hKernelMemoryFrame

HWND hKernelMemoryFrame
static

Definition at line 21 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hKernelMemoryNonPagedEdit

HWND hKernelMemoryNonPagedEdit
static

Definition at line 32 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hKernelMemoryPagedEdit

HWND hKernelMemoryPagedEdit
static

Definition at line 31 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hKernelMemoryTotalEdit

HWND hKernelMemoryTotalEdit
static

Definition at line 30 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hMemUsageFrame

HWND hMemUsageFrame
static

Definition at line 24 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hMemUsageGraph

HWND hMemUsageGraph
static

Definition at line 16 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hMemUsageHistoryFrame

HWND hMemUsageHistoryFrame
static

Definition at line 26 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hPerformancePage

HWND hPerformancePage

Definition at line 14 of file perfpage.c.

Referenced by OnCreate(), OnMove(), OnSize(), and TaskManager_OnTabWndSelChange().

◆ hPerformancePageCpuUsageHistoryGraph

HWND hPerformancePageCpuUsageHistoryGraph

◆ hPerformancePageMemUsageHistoryGraph

HWND hPerformancePageMemUsageHistoryGraph

◆ hPerformanceThread

HANDLE hPerformanceThread = NULL
static

Definition at line 41 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hPhysicalMemoryAvailableEdit

HWND hPhysicalMemoryAvailableEdit
static

Definition at line 34 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hPhysicalMemoryFrame

HWND hPhysicalMemoryFrame
static

Definition at line 22 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hPhysicalMemorySystemCacheEdit

HWND hPhysicalMemorySystemCacheEdit
static

Definition at line 35 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hPhysicalMemoryTotalEdit

HWND hPhysicalMemoryTotalEdit
static

Definition at line 33 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hTotalsFrame

HWND hTotalsFrame
static

Definition at line 19 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ hTotalsHandleCountEdit

HWND hTotalsHandleCountEdit
static

Definition at line 36 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hTotalsProcessCountEdit

HWND hTotalsProcessCountEdit
static

Definition at line 37 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ hTotalsThreadCountEdit

HWND hTotalsThreadCountEdit
static

Definition at line 38 of file perfpage.c.

Referenced by PerformancePageRefreshThread(), and PerformancePageWndProc().

◆ lastX

int lastX
static

Definition at line 47 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ lastY

int lastY
static

Definition at line 47 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ nPerformancePageHeight

int nPerformancePageHeight
static

Definition at line 46 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ nPerformancePageWidth

int nPerformancePageWidth
static

Definition at line 45 of file perfpage.c.

Referenced by PerformancePageWndProc().

◆ PerformancePageCpuUsageHistoryGraph

TM_GRAPH_CONTROL PerformancePageCpuUsageHistoryGraph

◆ PerformancePageMemUsageHistoryGraph

TM_GRAPH_CONTROL PerformancePageMemUsageHistoryGraph