case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
return 0;
+
+ case WM_NCCALCSIZE:
+ return 0;
+
+ case WM_SIZE:
+// pGraphCtrl = TGraphCtrl::LookupGraphCtrl(hWnd);
+// if (pGraphCtrl) pGraphCtrl->Resize(wParam, HIWORD(lParam), LOWORD(lParam));
+ if (hWnd == hPerformancePageMemUsageHistoryGraph) {
+ PerformancePageMemUsageHistoryGraph.Resize();
+ PerformancePageMemUsageHistoryGraph.InvalidateCtrl();
+ }
+ if (hWnd == hPerformancePageCpuUsageHistoryGraph) {
+ PerformancePageCpuUsageHistoryGraph.Resize();
+ PerformancePageCpuUsageHistoryGraph.InvalidateCtrl();
+ }
+ return 0;
+ break;
+
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// pGraphCtrl = TGraphCtrl::LookupGraphCtrl(hWnd);
}
EndPaint(hWnd, &ps);
return 0;
-/*
- WindowId = GetWindowLong(hWnd, GWL_ID);
- switch (WindowId) {
- case IDC_CPU_USAGE_GRAPH:
- Graph_DrawCpuUsageGraph(hdc, hWnd);
- break;
- case IDC_MEM_USAGE_GRAPH:
- Graph_DrawMemUsageGraph(hdc, hWnd);
- break;
- case IDC_MEM_USAGE_HISTORY_GRAPH:
- Graph_DrawMemUsageHistoryGraph(hdc, hWnd);
- break;
- }
- */
-
- case WM_SIZE:
-// pGraphCtrl = TGraphCtrl::LookupGraphCtrl(hWnd);
-// if (pGraphCtrl) pGraphCtrl->Resize(wParam, HIWORD(lParam), LOWORD(lParam));
- if (hWnd == hPerformancePageMemUsageHistoryGraph) {
- PerformancePageMemUsageHistoryGraph.Resize();
- }
- if (hWnd == hPerformancePageCpuUsageHistoryGraph) {
- PerformancePageCpuUsageHistoryGraph.Resize();
- }
- return 0;
}
//
{
RECT rc;
int cx, cy, sx, sy;
+
GetClientRect(hCntrl, &rc);
MapWindowPoints(hCntrl, hDlg, (LPPOINT)(&rc), (sizeof(RECT)/sizeof(POINT)));
if (pos) {
cy += nYDifference / 2;
break;
case 3:
- sx += nXDifference / 2;
+ sx += nXDifference;
break;
case 4:
cy += nYDifference / 2;
- sx += nXDifference / 2;
+ sx += nXDifference;
break;
}
sy = rc.bottom - rc.top + nYDifference / 2;
//
OldGraphWndProc = SetWindowLong(hPerformancePageCpuUsageGraph, GWL_WNDPROC, (LONG)Graph_WndProc);
SetWindowLong(hPerformancePageMemUsageGraph, GWL_WNDPROC, (LONG)Graph_WndProc);
-// SetWindowLong(hPerformancePageMemUsageHistoryGraph, GWL_WNDPROC, (LONG)Graph_WndProc);
-
-// OldGraphCtrlWndProc = SetWindowLong(hPerformancePageCpuUsageGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc);
-// SetWindowLong(hPerformancePageMemUsageGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc);
OldGraphCtrlWndProc = SetWindowLong(hPerformancePageMemUsageHistoryGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc);
SetWindowLong(hPerformancePageCpuUsageHistoryGraph, GWL_WNDPROC, (LONG)GraphCtrl_WndProc);
-
return TRUE;
case WM_COMMAND:
#if 0
case WM_NCPAINT:
hdc = GetDC(hDlg);
- //GetClientRect(hDlg, &rc);
- //Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
+ GetClientRect(hDlg, &rc);
+ Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
ReleaseDC(hDlg, hdc);
break;
case WM_PAINT:
hdc = BeginPaint(hDlg, &ps);
-
- //GetClientRect(hDlg, &rc);
- //Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
+ GetClientRect(hDlg, &rc);
+ Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
EndPaint(hDlg, &ps);
break;
#endif
case WM_SIZE:
int cx, cy;
- if (wParam == SIZE_MINIMIZED)
+ if (wParam == SIZE_MINIMIZED)
return 0;
cx = LOWORD(lParam);
nYDifference = cy - nPerformancePageHeight;
nPerformancePageWidth = cx;
nPerformancePageHeight = cy;
-// SetWindowPos(hPerformancePageMemUsageHistoryGraph, NULL, 0, 0, cx, cy, SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER);
-// SetWindowPos(hPerformancePageCpuUsageHistoryGraph, NULL, 0, 0, cx, cy, SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER);
// Reposition the performance page's controls
AdjustFrameSize(hPerformancePageTotalsFrame, hDlg, 0, nYDifference, 0);
AdjustControlPostion(hPerformancePageTotalsProcessCountEdit, hDlg, 0, nYDifference);
AdjustControlPostion(hPerformancePageTotalsThreadCountEdit, hDlg, 0, nYDifference);
- static int lastX, lastY;
-
- nXDifference += lastX;
- nYDifference += lastY;
- lastX = lastY = 0;
- if (nXDifference % 2) {
- if (nXDifference > 0) {
- nXDifference--;
- lastX++;
- } else {
- nXDifference++;
- lastX--;
- }
- }
- if (nYDifference % 2) {
- if (nYDifference > 0) {
- nYDifference--;
- lastY++;
- } else {
- nYDifference++;
- lastY--;
- }
- }
+ static int lastX, lastY;
+
+ nXDifference += lastX;
+ nYDifference += lastY;
+ lastX = lastY = 0;
+ if (nXDifference % 2) {
+ if (nXDifference > 0) {
+ nXDifference--;
+ lastX++;
+ } else {
+ nXDifference++;
+ lastX--;
+ }
+ }
+ if (nYDifference % 2) {
+ if (nYDifference > 0) {
+ nYDifference--;
+ lastY++;
+ } else {
+ nYDifference++;
+ lastY--;
+ }
+ }
AdjustFrameSize(hPerformancePageCpuUsageFrame, hDlg, nXDifference, nYDifference, 1);
AdjustFrameSize(hPerformancePageMemUsageFrame, hDlg, nXDifference, nYDifference, 2);
AdjustFrameSize(hPerformancePageCpuUsageHistoryFrame, hDlg, nXDifference, nYDifference, 3);
AdjustFrameSize(hPerformancePageMemUsageHistoryFrame, hDlg, nXDifference, nYDifference, 4);
-/*
AdjustFrameSize(hPerformancePageCpuUsageGraph, hDlg, nXDifference, nYDifference, 1);
AdjustFrameSize(hPerformancePageMemUsageGraph, hDlg, nXDifference, nYDifference, 2);
- AdjustFrameSize(hPerformancePageMemUsageHistoryGraph, hDlg, nXDifference, nYDifference, 3);
- AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph, hDlg, nXDifference, nYDifference, 4);
- */
+ AdjustFrameSize(hPerformancePageCpuUsageHistoryGraph, hDlg, nXDifference, nYDifference, 3);
+ AdjustFrameSize(hPerformancePageMemUsageHistoryGraph, hDlg, nXDifference, nYDifference, 4);
break;
}
-
return 0;
}