Курсовая работа: Характеристика Win32
)
{
int nItem;
CMainFrame * pFrame = (CMainFrame *) lParam;
ASSERT_VALID(pFrame);
CListCtrl& wndView = pFrame->m_wndView;
CItemData * pData;
BOOL bFound = FALSE;
TCHAR szID[64];
wsprintf (szID, _T («%u (0x % X)»), dwProcessId, dwProcessId);
// try to find the corresponding item in the list
int nCount = wndView. GetItemCount();
for (nItem = 0; nItem < nCount; nItem++)
{
pData = (CItemData *) wndView. GetItemData(nItem);
if (pData->dwProcessId == dwProcessId &&
pData->dwWowTaskId == 0 &&
pData->strName == pszName)
{
pData->bDelete = FALSE;
bFound = TRUE;
break;
}
}
if (! bFound)
{
pData = new CItemData (dwProcessId, DWORD(0));
nItem = wndView. InsertItem (LVIF_TEXT|LVIF_PARAM, nCount, szID,
0, 0, -1, (LPARAM) pData);