16,472
社区成员
发帖
与我相关
我的任务
分享
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 8992);
MODULEENTRY32 mi;
mi.dwSize = sizeof(MODULEENTRY32);
BOOL bRet = Module32First(hSnapshot, &mi);
int a = 0;
while (bRet)
{
CString str,str1;
str.Format(L"0x%x", (DWORD)mi.modBaseAddr);
m_ListCtrl.InsertItem(0, str);
m_ListCtrl.SetItemText(a, 1, mi.szExePath);
str1.Format(L"个数:(%d)", a++);//这行的问题
this->SetWindowText(str1);
bRet = Module32Next(hSnapshot, &mi);
}
CString strText;
int nColumnCount = m_myListCtrl.GetHeaderCtrl()->GetItemCount();
// Insert 10 items in the list view control.
for (int i = 0; i < 10; i++)
{
strText.Format(TEXT("item %d"), i);
// Insert the item, select every other item.
m_myListCtrl.InsertItem(LVIF_TEXT | LVIF_STATE, i, strText,
(i % 2) == 0 ? LVIS_SELECTED : 0, LVIS_SELECTED, 0, 0);
// Initialize the text of the subitems.
for (int j = 1; j < nColumnCount; j++)
{
strText.Format(TEXT("sub-item %d %d"), i, j);
m_myListCtrl.SetItemText(i, j, strText);
}
}