程序中的代码,主要看实现思路与步奏

void CxDbgDlg::gotoAddress(DWORD dwAddress)
{
    CString strAddress;
    strAddress.Format(_T("%08X"), dwAddress);
    DWORD dwItem = 0;
    do{
        if (g_pListCpu->GetItemText(dwItem, 0) == strAddress){

            int nItem = g_pListCpu->GetTopIndex();                                 // 获取顶层索引
            CRect rc;
            g_pListCpu->GetItemRect(nItem, rc, LVIR_BOUNDS);
            CSize sz(0, (dwItem - nItem)*rc.Height());                             // 取得要滚动的size
            g_pListCpu->Scroll(sz);                                                // 自滚动
            g_pListCpu->SetItemState(dwItem, LVIS_SELECTED, LVIS_SELECTED);        // 设置状态为被选中
            break;
        }
        ++dwItem;
    } while (TRUE);

}

 

相关文章:

  • 2021-05-24
  • 2022-12-23
  • 2021-12-12
  • 2021-10-14
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案