Click here to Skip to main content
15,888,733 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioninterface programming Pin
Adno31-Aug-07 6:18
Adno31-Aug-07 6:18 
AnswerRe: interface programming Pin
led mike31-Aug-07 6:51
led mike31-Aug-07 6:51 
GeneralRe: interface programming Pin
Adno31-Aug-07 7:09
Adno31-Aug-07 7:09 
Questionhow to implement hotfix function? Pin
lostangels31-Aug-07 5:46
lostangels31-Aug-07 5:46 
AnswerRe: how to implement hotfix function? Pin
Roger Broomfield31-Aug-07 5:55
Roger Broomfield31-Aug-07 5:55 
QuestionRe: how to implement hotfix function? Pin
Hamid_RT31-Aug-07 19:09
Hamid_RT31-Aug-07 19:09 
AnswerRe: how to implement hotfix function? Pin
lostangels31-Aug-07 23:07
lostangels31-Aug-07 23:07 
Questionclistctrl oncustomdraw change row color Pin
Derrick Becker31-Aug-07 5:24
Derrick Becker31-Aug-07 5:24 
I am trying to set the row color on certain rows of my clistctrl when certain conditions are met. I am using the following code:
<br />
void CApmDlg::OnCustomdrawMyList ( NMHDR* pNMHDR, LRESULT* pResult )<br />
{<br />
   NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );<br />
<br />
   // Take the default processing unless we set this to something else below.<br />
   *pResult = CDRF_DODEFAULT;<br />
<br />
   // First thing - check the draw stage. If it's the control's prepaint<br />
   // stage, then tell Windows we want messages for every item.<br />
<br />
   if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage ) {<br />
      *pResult = CDRF_NOTIFYITEMDRAW;<br />
      }<br />
   else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage ) {<br />
<br />
      //Get current Item's data<br />
      MAnciProcedure* pData = (MAnciProcedure*)m_historyLC.GetItemData(pLVCD->nmcd.dwItemSpec);<br />
<br />
      //If data is also in tree control change color<br />
      HTREEITEM hItem = m_pushTree.GetFirstVisibleItem();<br />
      while ( hItem ) {<br />
         if ( *pData == *(MAnciProcedure*)m_pushTree.GetItemData(hItem) ) {<br />
            COLORREF crBkgnd;<br />
            crBkgnd = RGB(192,192,192);<br />
            pLVCD->clrTextBk = crBkgnd;<br />
            }<br />
         //Get next Item<br />
         if ( m_pushTree.ItemHasChildren(hItem) ) {<br />
            hItem = m_pushTree.GetChildItem(hItem);<br />
            }<br />
         else if ( m_pushTree.GetNextItem(hItem, TVGN_NEXT) ) {<br />
               hItem = m_pushTree.GetNextItem(hItem, TVGN_NEXT);<br />
               }<br />
         else {<br />
            hItem = m_pushTree.GetParentItem(hItem);<br />
            if ( hItem ) {<br />
               hItem = m_pushTree.GetNextItem(hItem, TVGN_NEXT);<br />
               }<br />
            }<br />
         }  <br />
<br />
      // Tell Windows to paint the control itself.<br />
      *pResult = CDRF_DODEFAULT;<br />
   }<br />
}<br />


I put a breakpoint inside the if statement and it makes it in there and sets the pLVCD->clrTextBk like it should but when I look at my list control the background color hasn't changed. Am I missing something?

Thanks
QuestionFindWindow Pin
Waldermort31-Aug-07 5:16
Waldermort31-Aug-07 5:16 
AnswerRe: FindWindow Pin
David Crow31-Aug-07 5:19
David Crow31-Aug-07 5:19 
GeneralRe: FindWindow Pin
Waldermort31-Aug-07 5:25
Waldermort31-Aug-07 5:25 
GeneralRe: FindWindow Pin
David Crow31-Aug-07 5:37
David Crow31-Aug-07 5:37 
GeneralRe: FindWindow Pin
Waldermort31-Aug-07 5:44
Waldermort31-Aug-07 5:44 
GeneralRe: FindWindow Pin
Roger Broomfield31-Aug-07 5:52
Roger Broomfield31-Aug-07 5:52 
GeneralRe: FindWindow Pin
Waldermort31-Aug-07 5:57
Waldermort31-Aug-07 5:57 
QuestionRe: FindWindow Pin
David Crow31-Aug-07 5:52
David Crow31-Aug-07 5:52 
QuestionMFC OnInitDialog lengthy process halts screen painting Pin
littleGreenDude31-Aug-07 5:02
littleGreenDude31-Aug-07 5:02 
AnswerRe: MFC OnInitDialog lengthy process halts screen painting Pin
Naveen31-Aug-07 5:11
Naveen31-Aug-07 5:11 
QuestionRe: MFC OnInitDialog lengthy process halts screen painting Pin
David Crow31-Aug-07 5:16
David Crow31-Aug-07 5:16 
QuestionVisual indication (Red, green) Pin
__yash__31-Aug-07 4:35
professional__yash__31-Aug-07 4:35 
AnswerRe: Visual indication (Red, green) Pin
Mark Salsbery31-Aug-07 5:02
Mark Salsbery31-Aug-07 5:02 
GeneralRe: Visual indication (Red, green) Pin
__yash__31-Aug-07 5:38
professional__yash__31-Aug-07 5:38 
GeneralRe: Visual indication (Red, green) Pin
Mark Salsbery31-Aug-07 5:48
Mark Salsbery31-Aug-07 5:48 
GeneralRe: Visual indication (Red, green) Pin
__yash__31-Aug-07 5:49
professional__yash__31-Aug-07 5:49 
GeneralRe: Visual indication (Red, green) Pin
Mark Salsbery31-Aug-07 6:13
Mark Salsbery31-Aug-07 6:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.