Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CListCtrl -- Not receiving custom draw NM_CUSTOMDRAW message. Help.

414 views
Skip to first unread message

Chip Calvert

unread,
Jun 1, 2000, 3:00:00 AM6/1/00
to
On Sun, 21 May 2000 22:38:48 -0700, "Tony" <tpatte...@uswest.net>
wrote:

>I need some minor custom drawing to occur in my CListCtrl. The project I'm
>working on requires specific text colors which may vary from one item to
>another. I'd begun implementing owner draw when I was pointed to some code
>snippets that demonstrated using the OnCustomDraw callback to avoid handling
>all the drawing overhead associated with an owner drawn control... Sounded
>great. The code seemed much cleaner than what I'd been doing.
>
>After adding the:
>
>ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
>
>&
>
>afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult); +
>implementation.
>
>I never get the callback.

I've used this successfully a lot. Have you looked at the following
article? http://www.codeguru.com/listview/CustomDraw.shtml

>Looking at MSDN (I should note that I'm a novice with MFC), I found some
>documentation where this message is called for the "list view control". I'm
>wondering if they mean a CListView (is a list view control synonymous with a
>clistctrl)? I can't use CListView (I think) because I required free
>floating dialogs which are independent of the main window. On the other
>hand, from what I can see there isn't a lot of difference between a
>CListView and a CListCtrl (which I'm using) except the former contains the
>later.

The terminology is unfortunately vague. I believe that they are
talking about CListCtrl, not CListView.

>Is there anything "special" that needs to be done to have the custom draw
>message sent to the owning window?

I don't believe so.


--
Chip
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"Make it idiot-proof and someone will make a better idiot."
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

0 new messages