LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
if ( 0 == pNMItemActivate->iSubItem )
{
TCHAR sText[MAX_PATH] = { 0 };
DWORD dwPos = GetMessagePos();
CPoint point( LOWORD(dwPos), HIWORD(dwPos) );
m_LstCtr.ScreenToClient(&point);
LVHITTESTINFO lvinfo;
lvinfo.pt = point;
lvinfo.flags = LVHT_ABOVE;
UINT nFlag;
int nItem = m_LstCtr.HitTest(point, &nFlag);
//判断是否点在checkbox上
if(nFlag == LVHT_ONITEMSTATEICON)
{
//点击了CheckBox
pAccount->bAutoLogin = !m_LstCtr.GetCheck(pNMItemActivate->iItem);
DebugInf(L"点选了暂停框: %02X", pAccount->bAutoLogin);
}
else
{
//点击的是空白区域
wsprintf(sText, L"%02X", m_LstCtr.GetCheck(pNMItemActivate->iItem));
pAccount->bAutoLogin = !m_LstCtr.GetCheck(pNMItemActivate->iItem);
}
}