Checkbox in CListCtrl

All questions regarding Windows programming, post here. API,COM, ActiveX, DirectX, OpenGL, MFC and so on...

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Checkbox in CListCtrl

Postby rag84dec » Tue Apr 29, 2008 3:18 am

Hi,
here is my code
Code: Select all
OnCheckboxChanged
( NMHDR*                  pNMHeader,
  LRESULT*                pResult )
{
   
   
    CListCtrl* a_pStatus = (CListCtrl*) GetDlgItem(IDC_DLG_FWUPDATE_FILES_LOCALFILES);
    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHeader;
    LVHITTESTINFO hitinfo;

//Get the current element item selected.
   hitinfo.pt = pNMListView->ptAction;

//Make the hit test...
   OC_ULong_t item = a_pStatus->HitTest(&hitinfo);

   if ((IsChecked(pNMListView->uNewState)))
      a_pStatus->SetCheck(item,false);
//*pResult = 0;
  if((IsChecked(pNMListView->uNewState))&&(m_FWInfo.size() != 0))
   GetDlgItem(IDC_BUTTON_DETAILS)->EnableWindow(true);
  else
   GetDlgItem(IDC_BUTTON_DETAILS)->EnableWindow(false);


}



What is am doing is Enabling the "IDC_BUTTON_DETAILS" button only if one checkbox is set.Can any one tell me other way of doing this?...I want the check box to be set only if mouse is clicked on the checkbox not on the text of the cell which has the check box.... Can anyone please help????
rag84dec
 
Posts: 34
Joined: Thu Jun 14, 2007 4:34 pm

Postby ventsyv » Tue Apr 29, 2008 8:43 am

Looks reasonable. What seems to be the problem ?
User avatar
ventsyv
 
Posts: 2810
Joined: Mon Sep 22, 2003 5:25 pm
Location: MD USA


Return to Windows Programming

Who is online

Users browsing this forum: Google Adsense [Bot] and 2 guests