MCPcopy Create free account
hub / github.com/ajkhoury/ReClassEx / CompareFunction

Method CompareFunction

ReClass/DialogProcSelect.cpp:184–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184int CALLBACK CDialogProcSelect::CompareFunction( LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort )
185{
186 PCOMPARESTRUCT pCompare = (PCOMPARESTRUCT)lParamSort;
187 if (pCompare)
188 {
189 CListCtrl* pListCtrl = pCompare->pListCtrl;
190 INT column = pCompare->iColumn;
191 BOOLEAN bAscending = pCompare->bAscending;
192
193 int item1 = bAscending ? static_cast<int>(lParam1) : static_cast<int>(lParam2);
194 int item2 = bAscending ? static_cast<int>(lParam2) : static_cast<int>(lParam1);
195
196 if (column == COLUMN_PROCESSID)
197 {
198 CString strValue1 = pListCtrl->GetItemText( item1, column );
199 CString strValue2 = pListCtrl->GetItemText( item2, column );
200 DWORD value1 = (DWORD)_tcstoul( strValue1.GetString( ), NULL, 16 );
201 DWORD value2 = (DWORD)_tcstoul( strValue2.GetString( ), NULL, 16 );
202
203 return (int)(value2 - value1);
204 }
205 else if (column == COLUMN_PROCESSNAME)
206 {
207 CString strModuleName1 = pListCtrl->GetItemText( item1, column );
208 CString strModuleName2 = pListCtrl->GetItemText( item2, column );
209
210 return strModuleName1.CompareNoCase( strModuleName2 );
211 }
212 }
213 return 0;
214}
215
216void CDialogProcSelect::OnColumnClick( NMHDR* pNMHDR, LRESULT* pResult )
217{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected