ReactOS  0.4.15-dev-5615-gc3644fd
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 506 of file perfpage.c.

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 }
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI CheckMenuRadioItem(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
#define ID_VIEW_CPUHISTORY_ONEGRAPHALL
Definition: resource.h:162
#define ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU
Definition: resource.h:163
HWND hMainWnd
Definition: magnifier.c:32
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

Referenced by TaskManagerWndProc().

◆ PerformancePage_OnViewCPUHistoryOneGraphPerCPU()

void PerformancePage_OnViewCPUHistoryOneGraphPerCPU ( void  )

Definition at line 520 of file perfpage.c.

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 }
#define MF_BYCOMMAND
Definition: winuser.h:202
#define TRUE
Definition: types.h:120
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:32
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

Referenced by TaskManagerWndProc().

◆ PerformancePage_OnViewShowKernelTimes()

void PerformancePage_OnViewShowKernelTimes ( void  )

Definition at line 480 of file perfpage.c.

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 }
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL DrawSecondaryPlot
Definition: graphctl.h:56
#define TRUE
Definition: types.h:120
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
void GraphCtrl_RedrawBitmap(PTM_GRAPH_CONTROL inst, INT h)
Definition: graphctl.c:209
#define FALSE
Definition: types.h:117
#define MF_CHECKED
Definition: winuser.h:132
void RefreshPerformancePage(void)
Definition: perfpage.c:310
#define ID_VIEW_SHOWKERNELTIMES
Definition: resource.h:161
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
TM_GRAPH_CONTROL PerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:28
HWND hMainWnd
Definition: magnifier.c:32
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

Referenced by TaskManagerWndProc().

◆ PerformancePageWndProc()

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

Definition at line 113 of file perfpage.c.

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;
133  TM_FORMAT fmt;
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 }
static HANDLE hPerformanceThread
Definition: perfpage.c:58
INT_PTR CALLBACK Graph_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: graph.c:34
#define IDC_PHYSICAL_MEMORY_TOTAL
Definition: resource.h:69
HWND hPerformancePageCpuUsageHistoryFrame
Definition: perfpage.c:42
#define COLOR_3DHILIGHT
Definition: winuser.h:931
Definition: tftpd.h:59
#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 RGB(r, g, b)
Definition: precomp.h:62
#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:552
#define IDC_COMMIT_CHARGE_TOTAL
Definition: resource.h:59
HDC WINAPI GetDC(_In_opt_ HWND)
static DWORD dwPerformanceThread
Definition: perfpage.c:59
#define TRUE
Definition: types.h:120
HWND hPerformancePageCommitChargeFrame
Definition: perfpage.c:37
HWND hPerformancePageMemUsageHistoryGraph
Definition: perfpage.c:35
WNDPROC OldGraphWndProc
Definition: graph.c:27
HWND hPerformancePageMemUsageHistoryFrame
Definition: perfpage.c:43
TM_GRAPH_CONTROL PerformancePageMemUsageHistoryGraph
Definition: perfpage.c:29
const char * fmt
Definition: wsprintf.c:30
LONG top
Definition: windef.h:307
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:306
#define SWP_NOZORDER
Definition: winuser.h:1237
#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:1181
#define IDS_PHYSICAL_MEMORY_TOTAL
Definition: resource.h:130
LONG right
Definition: windef.h:308
INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: graphctl.c:300
DWORD WINAPI GetSysColor(_In_ int)
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define COLOR_3DSHADOW
Definition: winuser.h:925
#define IDC_PHYSICAL_MEMORY_AVAILABLE
Definition: resource.h:72
#define WM_NCPAINT
Definition: winuser.h:1677
#define IDS_PHYSICAL_MEMORY_AVAILABLE
Definition: resource.h:131
#define FALSE
Definition: types.h:117
#define IDC_COMMIT_CHARGE_LIMIT
Definition: resource.h:62
unsigned int BOOL
Definition: ntddk_ex.h:94
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:585
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:137
#define IDC_COMMIT_CHARGE_FRAME
Definition: resource.h:90
#define IDC_CPU_USAGE_HISTORY_FRAME
Definition: resource.h:108
HWND hPerformancePagePhysicalMemorySystemCacheEdit
Definition: perfpage.c:52
BOOL GraphCtrl_Create(PTM_GRAPH_CONTROL inst, HWND hWnd, HWND hParentWnd, PTM_FORMAT fmt)
Definition: graphctl.c:16
HWND hPerformancePagePhysicalMemoryFrame
Definition: perfpage.c:39
#define WM_DESTROY
Definition: winuser.h:1599
WNDPROC OldGraphCtrlWndProc
Definition: graphctl.c:13
void GraphCtrl_Dispose(PTM_GRAPH_CONTROL inst)
Definition: graphctl.c:114
#define IDS_COMMIT_CHARGE_PEAK
Definition: resource.h:129
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:1601
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:1232
HWND hPerformancePageKernelMemoryTotalEdit
Definition: perfpage.c:47
static int lastY
Definition: perfpage.c:64
#define IDS_PHYSICAL_MEMORY_SYSTEM_CACHE
Definition: resource.h:132
#define SIZE_MINIMIZED
Definition: winuser.h:2496
HWND hPerformancePageTotalsThreadCountEdit
Definition: perfpage.c:55
#define WM_PAINT
Definition: winuser.h:1610
TM_GRAPH_CONTROL PerformancePageCpuUsageHistoryGraph
Definition: perfpage.c:28
HWND hPerformancePageCpuUsageFrame
Definition: perfpage.c:40
#define IDS_KERNEL_MEMORY_NONPAGED
Definition: resource.h:135
HDC hdc
Definition: main.c:9
#define IDC_TOTALS_PROCESS_COUNT
Definition: resource.h:56
#define WM_COMMAND
Definition: winuser.h:1730
#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:1235
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
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
#define NULL
Definition: types.h:112
HWND hPerformancePageTotalsFrame
Definition: perfpage.c:36
#define IDC_MEM_USAGE_GRAPH
Definition: resource.h:118
_Out_opt_ int * cx
Definition: commctrl.h:585
#define HIWORD(l)
Definition: typedefs.h:247
#define IDS_COMMIT_CHARGE_TOTAL
Definition: resource.h:127
#define IDC_MEM_USAGE_HISTORY_GRAPH
Definition: resource.h:120
LONG bottom
Definition: windef.h:309
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SetWindowLongPtrW
Definition: winuser.h:5336
HWND hPerformancePagePhysicalMemoryAvailableEdit
Definition: perfpage.c:51
DWORD WINAPI PerformancePageRefreshThread(void *lpParameter)
Definition: perfpage.c:319
#define WM_INITDIALOG
Definition: winuser.h:1729
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
Definition: dsound.c:943
#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:1239
#define IDS_TOTALS_HANDLE_COUNT
Definition: resource.h:124

Referenced by OnCreate().

◆ RefreshPerformancePage()

void RefreshPerformancePage ( void  )

Definition at line 310 of file perfpage.c.

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 }
static DWORD dwPerformanceThread
Definition: perfpage.c:59
#define WM_TIMER
Definition: winuser.h:1732
#define PostThreadMessage
Definition: winuser.h:5823

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

Variable Documentation

◆ hPerformancePage

HWND hPerformancePage

Definition at line 31 of file perfpage.c.

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