ClistCtrl 목록에서 초점이 아닌 항목이 선택된 경우에도 파란색

980 단어 list
      Show Selection Always  。


//             

void CZZHCCEditorDlg::OnRclickList3(NMHDR* pNMHDR, LRESULT* pResult) 

{

	// TODO: Add your control notification handler code here

	

	*pResult = 0;	

	

	NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );

	*pResult = CDRF_DODEFAULT;

	if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )

	{

		*pResult = CDRF_NOTIFYITEMDRAW;

	}

	else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )

	{

		*pResult = CDRF_NOTIFYSUBITEMDRAW;

	}

	else if ( (CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage )

	{

		int nItem = static_cast<int>( pLVCD->nmcd.dwItemSpec );

		

		if (m_ccFileTable.GetItemState(nItem, LVIS_SELECTED) == LVIS_SELECTED)

		{

pLVCD->clrText = RGB(255,255,255); pLVCD->clrTextBk = RGB(49,150,255);
  
		}



		*pResult = CDRF_DODEFAULT;

	}

	

}


좋은 웹페이지 즐겨찾기