ReactOS 0.4.15-dev-8339-g4028de8
perfpage.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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

HWND hPerformancePage
 

Function Documentation

◆ 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}
#define TRUE
Definition: types.h:120

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().

◆ 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
#define NULL
Definition: types.h:112
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
unsigned int BOOL
Definition: ntddk_ex.h:94
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 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
static int nPerformancePageHeight
Definition: perfpage.c:46
HWND hPerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:17
TM_GRAPH_CONTROL PerformancePageMemUsageHistoryGraph
Definition: perfpage.c:12
static HWND hCpuUsageHistoryFrame
Definition: perfpage.c:25
DWORD WINAPI PerformancePageRefreshThread(PVOID Parameter)
Definition: perfpage.c:297
static HWND hMemUsageGraph
Definition: perfpage.c:16
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 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 hPhysicalMemoryFrame
Definition: perfpage.c:22
static HANDLE hPerformanceThread
Definition: perfpage.c:41
static int lastX
Definition: perfpage.c:47
static HWND hKernelMemoryNonPagedEdit
Definition: perfpage.c:32
static int nPerformancePageWidth
Definition: perfpage.c:45
static HWND hTotalsFrame
Definition: perfpage.c:19
void AdjustFrameSize(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference, int pos)
Definition: perfpage.c:50
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
static HWND hTotalsProcessCountEdit
Definition: perfpage.c:37
static HWND hPhysicalMemorySystemCacheEdit
Definition: perfpage.c:35
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
Definition: dsound.c:943
Definition: tftpd.h:60
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
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 SWP_NOACTIVATE
Definition: winuser.h:1242
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_SIZE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1740
#define SWP_NOSIZE
Definition: winuser.h:1245
#define SIZE_MINIMIZED
Definition: winuser.h:2506
#define WM_INITDIALOG
Definition: winuser.h:1739
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOOWNERZORDER
Definition: winuser.h:1249
#define WM_DESTROY
Definition: winuser.h:1609
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
#define SWP_NOZORDER
Definition: winuser.h:1247
#define SetWindowLongPtrW
Definition: winuser.h:5355
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:5842
#define WM_TIMER
Definition: winuser.h:1742

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

Variable Documentation

◆ hPerformancePage

HWND hPerformancePage
extern

Definition at line 14 of file perfpage.c.

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