> Hello,
>
> I am trying to change the color of my CTreeCtrl item text by using the Custom Draw event handler. While I see the correct progression of messages
while debugging, I never see the color of the text change. I have included
my event handler code...can anyone see a problem?
I think it's this line...
> LPNMTVCUSTOMDRAW pCustomDraw = (LPNMTVCUSTOMDRAW) pNMCD->lItemlParam;
...should that maybe be...
LPNMTVCUSTOMDRAW pCustomDraw = (LPNMTVCUSTOMDRAW) pNMCD;

Signature
Jeff Partch [VC++ MVP]
JFisher365 - 06 Jun 2004 01:16 GMT
----- Jeff Partch [MVP] wrote: ----
"JFisher365" <anonymous@discussions.microsoft.com> wrote in messag
news:13107F16-D999-4110-8A1B-30D3CACADEFF@microsoft.com..
> Hello
>> I am trying to change the color of my CTreeCtrl item text by using th
Custom Draw event handler. While I see the correct progression of message
while debugging, I never see the color of the text change. I have include
my event handler code...can anyone see a problem
I think it's this line..
> LPNMTVCUSTOMDRAW pCustomDraw = (LPNMTVCUSTOMDRAW) pNMCD->lItemlParam
....should that maybe be..
LPNMTVCUSTOMDRAW pCustomDraw = (LPNMTVCUSTOMDRAW) pNMCD
--
Jeff Partch [VC++ MVP
That was it. I got confused by the documentation. I wonder why the Add Event Handler wizard would add in it's own code as LPNMCUSTOMDRAW pNMCD = reinterpret_cast<LPNMCUSTOMDRAW>(pNMHDR) instead of the Tree Control specific version. I had looked thru some OnNotify code and it set the LPNMTVCUSTOMDRAW pCustomDraw pointer to the lParam argument. I guess I had assumed that it meant the lItemlParam field of the original pointer
Anyway, thank you for the quick response and great information!!
Joh