ReactOS  0.4.12-dev-57-g7050ac4
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 504 of file perfpage.c.

Referenced by TaskManagerWndProc().

505 {
506  HMENU hMenu;
507  HMENU hViewMenu;
508  HMENU hCPUHistoryMenu;
509 
510  hMenu = GetMenu(hMainWnd);
511  hViewMenu = GetSubMenu(hMenu, 2);
512  hCPUHistoryMenu = GetSubMenu(hViewMenu, 3);
513 
516 }
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define ID_VIEW_CPUHISTORY_ONEGRAPHALL
Definition: resource.h:162
#define ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
Definition: resource.h:163
HWND hMainWnd
Definition: magnifier.c:33
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
BOOL CPUHistory_OneGraphPerCPU
Definition: taskmgr.h:87

◆ PerformancePage_OnViewCPUHistoryOneGraphPerCPU()

void PerformancePage_OnViewCPUHistoryOneGraphPerCPU ( void  )

Definition at line 518 of file perfpage.c.

Referenced by TaskManagerWndProc().

519 {
520  HMENU hMenu;
521  HMENU hViewMenu;
522  HMENU hCPUHistoryMenu;
523 
524  hMenu = GetMenu(hMainWnd);
525  hViewMenu = GetSubMenu(hMenu, 2);
526  hCPUHistoryMenu = GetSubMenu(hViewMenu, 3);
527 
530 }
#define TRUE
Definition: types.h:120
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define ID_VIEW_CPUHISTORY_ONEGRAPHALL
Definition: resource.h:162
#define ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
Definition: resource.h:163
HWND hMainWnd
Definition: magnifier.c:33
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
BOOL CPUHistory_OneGraphPerCPU
Definition: taskmgr.h:87

◆ PerformancePage_OnViewShowKernelTimes()

void PerformancePage_OnViewShowKernelTimes ( void  )

Definition at line 481 of file perfpage.c.

Referenced by TaskManagerWndProc().

482 {
483  HMENU hMenu;
484  HMENU hViewMenu;
485 
486  hMenu = GetMenu(hMainWnd);
487  hViewMenu = GetSubMenu(hMenu, 2);
488 
489  /* Check or uncheck the show 16-bit tasks menu item */
491  {
494  }
495  else
496  {
497  CheckMenuItem(hViewMenu, ID_VIEW_SHOWKERNELTIMES, MF_BYCOMMAND|MF_CHECKED);
499  }
500 
502 }
#define TRUE
Definition: types.h:120
#define MF_BYCOMMAND
Definition: winuser.h:202
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
void RefreshPerformancePage(void)
Definition: perfpage.c:306
#define ID_VIEW_SHOWKERNELTIMES
Definition: resource.h:161
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HWND hMainWnd
Definition: magnifier.c:33
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_UNCHECKED
Definition: winuser.h:204
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ PerformancePageWndProc()

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

Definition at line 113 of file perfpage.c.

Referenced by OnCreate().

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  /* Save the width and height */
133  GetClientRect(hDlg, &rc);
136 
137  /* Update window position */
139 
140  /*
141  * Get handles to all the controls
142  */
147 
152 
165 
170 
172  /* create the control */
173  /* PerformancePageCpuUsageHistoryGraph.Create(0, rc, hDlg, IDC_CPU_USAGE_HISTORY_GRAPH); */
175  /* customize the control */
177 /* PerformancePageCpuUsageHistoryGraph.SetYUnits("Current") ; */
178 /* PerformancePageCpuUsageHistoryGraph.SetXUnits("Samples (Windows Timer: 100 msec)") ; */
179 /* PerformancePageCpuUsageHistoryGraph.SetBackgroundColor(RGB(0, 0, 64)) ; */
180 /* PerformancePageCpuUsageHistoryGraph.SetGridColor(RGB(192, 192, 255)) ; */
181 /* PerformancePageCpuUsageHistoryGraph.SetPlotColor(RGB(255, 255, 255)) ; */
184 
187 
188 
195  /* Start our refresh thread */
196 #ifdef RUN_PERF_PAGE
198 #endif
199 
200  /*
201  * Subclass graph buttons
202  */
207  return TRUE;
208 
209  case WM_COMMAND:
210  break;
211 #if 0
212  case WM_NCPAINT:
213  hdc = GetDC(hDlg);
214  GetClientRect(hDlg, &rc);
216  ReleaseDC(hDlg, hdc);
217  break;
218 
219  case WM_PAINT:
220  hdc = BeginPaint(hDlg, &ps);
221  GetClientRect(hDlg, &rc);
223  EndPaint(hDlg, &ps);
224  break;
225 #endif
226  case WM_SIZE:
227  do {
228  int cx, cy;
229 
230  if (wParam == SIZE_MINIMIZED)
231  return 0;
232 
233  cx = LOWORD(lParam);
234  cy = HIWORD(lParam);
235  nXDifference = cx - nPerformancePageWidth;
236  nYDifference = cy - nPerformancePageHeight;
237  nPerformancePageWidth = cx;
238  nPerformancePageHeight = cy;
239  } while (0);
240 
241  /* Reposition the performance page's controls */
242  AdjustFrameSize(hPerformancePageTotalsFrame, hDlg, 0, nYDifference, 0);
243  AdjustFrameSize(hPerformancePageCommitChargeFrame, hDlg, 0, nYDifference, 0);
244  AdjustFrameSize(hPerformancePageKernelMemoryFrame, hDlg, 0, nYDifference, 0);
245  AdjustFrameSize(hPerformancePagePhysicalMemoryFrame, hDlg, 0, nYDifference, 0);
246  AdjustCntrlPos(IDS_COMMIT_CHARGE_TOTAL, hDlg, 0, nYDifference);
247  AdjustCntrlPos(IDS_COMMIT_CHARGE_LIMIT, hDlg, 0, nYDifference);
248  AdjustCntrlPos(IDS_COMMIT_CHARGE_PEAK, hDlg, 0, nYDifference);
249  AdjustCntrlPos(IDS_KERNEL_MEMORY_TOTAL, hDlg, 0, nYDifference);
250  AdjustCntrlPos(IDS_KERNEL_MEMORY_PAGED, hDlg, 0, nYDifference);
251  AdjustCntrlPos(IDS_KERNEL_MEMORY_NONPAGED, hDlg, 0, nYDifference);
252  AdjustCntrlPos(IDS_PHYSICAL_MEMORY_TOTAL, hDlg, 0, nYDifference);
253  AdjustCntrlPos(IDS_PHYSICAL_MEMORY_AVAILABLE, hDlg, 0, nYDifference);
254  AdjustCntrlPos(IDS_PHYSICAL_MEMORY_SYSTEM_CACHE, hDlg, 0, nYDifference);
255  AdjustCntrlPos(IDS_TOTALS_HANDLE_COUNT, hDlg, 0, nYDifference);
256  AdjustCntrlPos(IDS_TOTALS_PROCESS_COUNT, hDlg, 0, nYDifference);
257  AdjustCntrlPos(IDS_TOTALS_THREAD_COUNT, hDlg, 0, nYDifference);
258 
271 
272  nXDifference += lastX;
273  nYDifference += lastY;
274  lastX = lastY = 0;
275  if (nXDifference % 2) {
276  if (nXDifference > 0) {
277  nXDifference--;
278  lastX++;
279  } else {
280  nXDifference++;
281  lastX--;
282  }
283  }
284  if (nYDifference % 2) {
285  if (nYDifference > 0) {
286  nYDifference--;
287  lastY++;
288  } else {
289  nYDifference++;
290  lastY--;
291  }
292  }
293  AdjustFrameSize(hPerformancePageCpuUsageFrame, hDlg, nXDifference, nYDifference, 1);
294  AdjustFrameSize(hPerformancePageMemUsageFrame, hDlg, nXDifference, nYDifference, 2);
295  AdjustFrameSize(hPerformancePageCpuUsageHistoryFrame, hDlg, nXDifference, nYDifference, 3);
296  AdjustFrameSize(hPerformancePageMemUsageHistoryFrame, hDlg, nXDifference, nYDifference, 4);
297  AdjustFrameSize(hPerformancePageCpuUsageGraph, hDlg, nXDifference, nYDifference, 1);
298  AdjustFrameSize(hPerformancePageMemUsageGraph, hDlg, nXDifference, nYDifference, 2);
299  AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph, hDlg, nXDifference, nYDifference, 3);
300  AdjustFrameSize(hPerformancePageMemUsageHistoryGraph, hDlg, nXDifference, nYDifference, 4);
301  break;
302  }
303  return 0;
304 }
static HANDLE hPerformanceThread
Definition: perfpage.c:58
INT_PTR CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: graph.c:34
void GraphCtrl_SetBackgroundColor(TGraphCtrl *this, COLORREF color)
Definition: graphctl.c:178
#define IDC_PHYSICAL_MEMORY_TOTAL
Definition: resource.h:69
HWND hPerformancePageCpuUsageHistoryFrame
Definition: perfpage.c:42
#define COLOR_3DHILIGHT
Definition: winuser.h:927
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
TGraphCtrl PerformancePageMemUsageHistoryGraph
Definition: perfpage.c:29
#define IDC_PHYSICAL_MEMORY_SYSTEM_CACHE
Definition: resource.h:75
HWND hPerformancePageTotalsHandleCountEdit
Definition: perfpage.c:53
HWND hPerformancePageKernelMemoryPagedEdit
Definition: perfpage.c:48
#define IDS_TOTALS_PROCESS_COUNT
Definition: resource.h:126
static int lastX
Definition: perfpage.c:64
HWND hPerformancePageMemUsageGraph
Definition: perfpage.c:33
#define IDC_MEM_USAGE_FRAME
Definition: resource.h:105
#define IDC_CPU_USAGE_FRAME
Definition: resource.h:102
#define IDC_KERNEL_MEMORY_NONPAGED
Definition: resource.h:84
void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)
Definition: taskmgr.c:549
#define IDC_COMMIT_CHARGE_TOTAL
Definition: resource.h:59
HDC WINAPI GetDC(_In_opt_ HWND)
static DWORD dwPerformanceThread
Definition: perfpage.c:59
HWND hPerformancePageCommitChargeFrame
Definition: perfpage.c:37
HWND hPerformancePageMemUsageHistoryGraph
Definition: perfpage.c:35
WNDPROC OldGraphWndProc
Definition: graph.c:27
HWND hPerformancePageMemUsageHistoryFrame
Definition: perfpage.c:43
LONG top
Definition: windef.h:297
HWND hPerformancePageCommitChargePeakEdit
Definition: perfpage.c:46
#define IDC_COMMIT_CHARGE_PEAK
Definition: resource.h:66
HWND hPerformancePageKernelMemoryNonPagedEdit
Definition: perfpage.c:49
#define IDC_PHYSICAL_MEMORY_FRAME
Definition: resource.h:96
static int nPerformancePageWidth
Definition: perfpage.c:62
#define IDC_MEMORY_USAGE_HISTORY_FRAME
Definition: resource.h:111
LONG left
Definition: windef.h:296
#define SWP_NOZORDER
Definition: winuser.h:1232
#define IDC_KERNEL_MEMORY_PAGED
Definition: resource.h:81
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
Definition: taskmgr.c:1178
TGraphCtrl PerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:28
#define IDS_PHYSICAL_MEMORY_TOTAL
Definition: resource.h:130
LONG right
Definition: windef.h:298
INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: graphctl.c:543
void GraphCtrl_Dispose(TGraphCtrl *this)
Definition: graphctl.c:104
DWORD WINAPI GetSysColor(_In_ int)
WPARAM wParam
Definition: combotst.c:138
#define COLOR_3DSHADOW
Definition: winuser.h:921
#define IDC_PHYSICAL_MEMORY_AVAILABLE
Definition: resource.h:72
#define WM_NCPAINT
Definition: winuser.h:1669
#define IDS_PHYSICAL_MEMORY_AVAILABLE
Definition: resource.h:131
#define IDC_COMMIT_CHARGE_LIMIT
Definition: resource.h:62
static void AdjustControlPosition(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference)
Definition: perfpage.c:102
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define IDS_COMMIT_CHARGE_LIMIT
Definition: resource.h:128
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
HDC hdc
Definition: msvc.h:53
static void AdjustCntrlPos(int ctrl_id, HWND hDlg, int nXDifference, int nYDifference)
Definition: perfpage.c:107
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:112
#define IDC_COMMIT_CHARGE_FRAME
Definition: resource.h:90
smooth NULL
Definition: ftsmooth.c:416
#define IDC_CPU_USAGE_HISTORY_FRAME
Definition: resource.h:108
HWND hPerformancePagePhysicalMemorySystemCacheEdit
Definition: perfpage.c:52
HWND hPerformancePagePhysicalMemoryFrame
Definition: perfpage.c:39
#define WM_DESTROY
Definition: winuser.h:1591
WNDPROC OldGraphCtrlWndProc
Definition: graphctl.c:27
void GraphCtrl_Create(TGraphCtrl *this, HWND hWnd, HWND hParentWnd, UINT nID)
Definition: graphctl.c:123
#define IDS_COMMIT_CHARGE_PEAK
Definition: resource.h:129
void GraphCtrl_SetRange(TGraphCtrl *this, double dLower, double dUpper, int nDecimalPlaces)
Definition: graphctl.c:134
static int nPerformancePageHeight
Definition: perfpage.c:63
HWND hPerformancePageCommitChargeLimitEdit
Definition: perfpage.c:45
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_SIZE
Definition: winuser.h:1593
void AdjustFrameSize(HWND hCntrl, HWND hDlg, int nXDifference, int nYDifference, int pos)
Definition: perfpage.c:67
HWND hPerformancePageKernelMemoryFrame
Definition: perfpage.c:38
#define SWP_NOACTIVATE
Definition: winuser.h:1227
void GraphCtrl_SetPlotColor(TGraphCtrl *this, int plot, COLORREF color)
Definition: graphctl.c:169
HWND hPerformancePageKernelMemoryTotalEdit
Definition: perfpage.c:47
#define RGB(r, g, b)
Definition: wingdi.h:2917
static int lastY
Definition: perfpage.c:64
#define IDS_PHYSICAL_MEMORY_SYSTEM_CACHE
Definition: resource.h:132
#define SIZE_MINIMIZED
Definition: winuser.h:2460
HWND hPerformancePageTotalsThreadCountEdit
Definition: perfpage.c:55
#define WM_PAINT
Definition: winuser.h:1602
HWND hPerformancePageCpuUsageFrame
Definition: perfpage.c:40
#define IDS_KERNEL_MEMORY_NONPAGED
Definition: resource.h:135
void GraphCtrl_SetGridColor(TGraphCtrl *this, COLORREF color)
Definition: graphctl.c:162
#define IDC_TOTALS_PROCESS_COUNT
Definition: resource.h:56
#define WM_COMMAND
Definition: winuser.h:1716
#define IDC_KERNEL_MEMORY_FRAME
Definition: resource.h:93
#define IDS_TOTALS_THREAD_COUNT
Definition: resource.h:125
HWND hPerformancePageCpuUsageGraph
Definition: perfpage.c:32
#define IDC_TOTALS_HANDLE_COUNT
Definition: resource.h:48
#define GWLP_WNDPROC
Definition: treelist.c:66
#define IDC_CPU_USAGE_HISTORY_GRAPH
Definition: resource.h:121
HWND hPerformancePageCommitChargeTotalEdit
Definition: perfpage.c:44
#define SWP_NOSIZE
Definition: winuser.h:1230
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
HWND hPerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:34
HWND hPerformancePageTotalsProcessCountEdit
Definition: perfpage.c:54
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND hPerformancePagePhysicalMemoryTotalEdit
Definition: perfpage.c:50
#define IDC_TOTALS_THREAD_COUNT
Definition: resource.h:53
#define IDC_CPU_USAGE_GRAPH
Definition: resource.h:114
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HWND hPerformancePageMemUsageFrame
Definition: perfpage.c:41
HWND hPerformancePageTotalsFrame
Definition: perfpage.c:36
#define IDC_MEM_USAGE_GRAPH
Definition: resource.h:118
_Out_opt_ int * cx
Definition: commctrl.h:570
#define HIWORD(l)
Definition: typedefs.h:246
#define IDS_COMMIT_CHARGE_TOTAL
Definition: resource.h:127
#define IDC_MEM_USAGE_HISTORY_GRAPH
Definition: resource.h:120
LONG bottom
Definition: windef.h:299
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SetWindowLongPtrW
Definition: winuser.h:5215
HWND hPerformancePagePhysicalMemoryAvailableEdit
Definition: perfpage.c:51
DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
Definition: perfpage.c:315
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_KERNEL_MEMORY_TOTAL
Definition: resource.h:78
#define IDS_KERNEL_MEMORY_PAGED
Definition: resource.h:134
#define IDC_TOTALS_FRAME
Definition: resource.h:87
#define IDS_KERNEL_MEMORY_TOTAL
Definition: resource.h:133
#define SWP_NOOWNERZORDER
Definition: winuser.h:1234
#define IDS_TOTALS_HANDLE_COUNT
Definition: resource.h:124

◆ RefreshPerformancePage()

void RefreshPerformancePage ( void  )

Definition at line 306 of file perfpage.c.

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

307 {
308 #ifdef RUN_PERF_PAGE
309  /* Signal the event so that our refresh thread */
310  /* will wake up and refresh the performance page */
312 #endif
313 }
static DWORD dwPerformanceThread
Definition: perfpage.c:59
#define WM_TIMER
Definition: winuser.h:1718
#define PostThreadMessage
Definition: winuser.h:5699

Variable Documentation

◆ hPerformancePage

HWND hPerformancePage

Definition at line 31 of file perfpage.c.

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