Author: tkreuzer
Date: Mon Dec 24 10:51:02 2012
New Revision: 57989
URL:
http://svn.reactos.org/svn/reactos?rev=57989&view=rev
Log:
[TASKMGR]
1) Use of CheckDlgButton() and IsDlgButtonChecked() rather than SendMessage, it will
improve code readability.
2)Removes an useless initialization into perfpage.c
3) GetWindowLong/SetWindowLong were replaced with GetWindowLongPtr/SetWindowLongPtr, but
GWL_WNDPROC and GWL_ID were not with GWLP_WNDPROC and GWLP_ID.
4) Corrected some comment texts.
Patch by Carlo Bramini
CORE-6367 #resolve
Modified:
trunk/reactos/base/applications/taskmgr/affinity.c
trunk/reactos/base/applications/taskmgr/column.c
trunk/reactos/base/applications/taskmgr/graph.c
trunk/reactos/base/applications/taskmgr/graphctl.c
trunk/reactos/base/applications/taskmgr/perfpage.c
trunk/reactos/base/applications/taskmgr/procpage.c
Modified: trunk/reactos/base/applications/taskmgr/affinity.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/affinity.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/affinity.c [iso-8859-1] Mon Dec 24 10:51:02
2012
@@ -97,7 +97,7 @@
* has affinity with
*/
if (dwProcessAffinityMask & (1 << nCpu))
- SendMessageW(GetDlgItem(hDlg, dwCpuTable[nCpu]), BM_SETCHECK,
BST_CHECKED, 0);
+ CheckDlgButton(hDlg, dwCpuTable[nCpu], BST_CHECKED);
}
return TRUE;
@@ -123,7 +123,7 @@
* First we have to create a mask out of each
* checkbox that the user checked.
*/
- if (SendMessageW(GetDlgItem(hDlg, dwCpuTable[nCpu]), BM_GETCHECK, 0, 0))
+ if (IsDlgButtonChecked(hDlg, dwCpuTable[nCpu]))
dwProcessAffinityMask |= (1 << nCpu);
}
Modified: trunk/reactos/base/applications/taskmgr/column.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/column.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/column.c [iso-8859-1] Mon Dec 24 10:51:02
2012
@@ -172,7 +172,7 @@
for (i=0; i<COLUMN_NMAX; i++) {
if (TaskManagerSettings.Columns[i])
- SendMessageW(GetDlgItem(hDlg, ColumnPresets[i].dwIdcCtrl), BM_SETCHECK,
BST_CHECKED, 0);
+ CheckDlgButton(hDlg, ColumnPresets[i].dwIdcCtrl, BST_CHECKED);
}
return TRUE;
@@ -187,7 +187,7 @@
if (LOWORD(wParam) == IDOK)
{
for (i=0; i<COLUMN_NMAX; i++)
- TaskManagerSettings.Columns[i] = (BOOL) SendMessageW(GetDlgItem(hDlg,
ColumnPresets[i].dwIdcCtrl), BM_GETCHECK, 0, 0);
+ TaskManagerSettings.Columns[i] = (BOOL)IsDlgButtonChecked(hDlg,
ColumnPresets[i].dwIdcCtrl);
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
Modified: trunk/reactos/base/applications/taskmgr/graph.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/graph.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/graph.c [iso-8859-1] Mon Dec 24 10:51:02 2012
@@ -102,7 +102,7 @@
hdc = BeginPaint(hWnd, &ps);
- WindowId = GetWindowLongPtrW(hWnd, GWL_ID);
+ WindowId = GetWindowLongPtrW(hWnd, GWLP_ID);
switch (WindowId)
{
Modified: trunk/reactos/base/applications/taskmgr/graphctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/graphctl.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/graphctl.c [iso-8859-1] Mon Dec 24 10:51:02
2012
@@ -59,7 +59,7 @@
this->m_nYDecimals = 3;
/* set some initial values for the scaling until "SetRange" is called.
- * these are protected varaibles and must be set with SetRange
+ * these are protected variables and must be set with SetRange
* in order to ensure that m_dRange is updated accordingly
*/
/* m_dLowerLimit = -10.0; */
@@ -322,8 +322,8 @@
(m_rectPlot.bottom+m_rectPlot.top)/2, m_strYUnitsString,
wcslen(m_strYUnitsString));
SelectObject(m_dcGrid, oldFont);
#endif
- /* at this point we are done filling the the grid bitmap, */
- /* no more drawing to this bitmap is needed until the setting are changed */
+ /* at this point we are done filling the grid bitmap, */
+ /* no more drawing to this bitmap is needed until the settings are changed */
/* if we don't have one yet, set up a memory dc for the plot */
if (this->m_dcPlot == NULL)
@@ -441,7 +441,7 @@
/* fill the cleanup area with the background */
FillRect(this->m_dcPlot, &rectCleanUp, this->m_brushBack);
- /* draw the next line segement */
+ /* draw the next line segment */
for (i = 0; i < MAX_PLOTS; i++)
{
/* grab the plotting pen */
Modified: trunk/reactos/base/applications/taskmgr/perfpage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/perfpage.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/perfpage.c [iso-8859-1] Mon Dec 24 10:51:02
2012
@@ -91,7 +91,6 @@
} else {
cx = rc.left + nXDifference;
cy = rc.top + nYDifference;
- sx = sy = 0;
SetWindowPos(hCntrl, NULL, cx, cy, 0, 0,
SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER);
}
InvalidateRect(hCntrl, NULL, TRUE);
@@ -198,10 +197,10 @@
/*
* Subclass graph buttons
*/
- OldGraphWndProc = (WNDPROC)(LONG_PTR)
SetWindowLongPtrW(hPerformancePageCpuUsageGraph, GWL_WNDPROC, (LONG_PTR)Graph_WndProc);
- SetWindowLongPtrW(hPerformancePageMemUsageGraph, GWL_WNDPROC,
(LONG_PTR)Graph_WndProc);
- OldGraphCtrlWndProc = (WNDPROC)(LONG_PTR)
SetWindowLongPtrW(hPerformancePageMemUsageHistoryGraph, GWL_WNDPROC,
(LONG_PTR)GraphCtrl_WndProc);
- SetWindowLongPtrW(hPerformancePageCpuUsageHistoryGraph, GWL_WNDPROC,
(LONG_PTR)GraphCtrl_WndProc);
+ OldGraphWndProc = (WNDPROC)(LONG_PTR)
SetWindowLongPtrW(hPerformancePageCpuUsageGraph, GWLP_WNDPROC, (LONG_PTR)Graph_WndProc);
+ SetWindowLongPtrW(hPerformancePageMemUsageGraph, GWLP_WNDPROC,
(LONG_PTR)Graph_WndProc);
+ OldGraphCtrlWndProc = (WNDPROC)(LONG_PTR)
SetWindowLongPtrW(hPerformancePageMemUsageHistoryGraph, GWLP_WNDPROC,
(LONG_PTR)GraphCtrl_WndProc);
+ SetWindowLongPtrW(hPerformancePageCpuUsageHistoryGraph, GWLP_WNDPROC,
(LONG_PTR)GraphCtrl_WndProc);
return TRUE;
case WM_COMMAND:
Modified: trunk/reactos/base/applications/taskmgr/procpage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/procpage.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/procpage.c [iso-8859-1] Mon Dec 24 10:51:02
2012
@@ -139,7 +139,7 @@
/*
* Subclass the process list control so we can intercept WM_ERASEBKGND
*/
- OldProcessListWndProc = (WNDPROC)(LONG_PTR)
SetWindowLongPtrW(hProcessPageListCtrl, GWL_WNDPROC, (LONG_PTR)ProcessListWndProc);
+ OldProcessListWndProc = (WNDPROC)(LONG_PTR)
SetWindowLongPtrW(hProcessPageListCtrl, GWLP_WNDPROC, (LONG_PTR)ProcessListWndProc);
#ifdef RUN_PROC_PAGE
/* Start our refresh thread */