CTreeViewCtrl and WM_PAINT

Andrey Sergienko <[email protected]> Fri, 04 Feb 2011 14:56:22 +0200
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
Hello

I have a main frame. And I create TreeView in it:

/* mainfrm.h */

class CMainFrame : public CFrameWindowImpl<CMainFrame>, public
CUpdateUI<CMainFrame>, public CMessageFilter, public CIdleHandler
{
public:

// ...

CMyTreeViewCtrl mytreeview;

// ...

};

/* end of mainfrm.h */

/* mainfrm.cpp */

// ...

m_treeview.Create(m_lPane.m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE
| WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);

m_lPane.SetClient(m_treeview.m_hWnd)

//...

/* mainfrm.cpp */

And what I want to do is to catch WM_PAINT in CMyTreeViewCtrl:

/* mytreeviewctrl.h */

//...

public:
  BEGIN_MSG_MAP_EX(CMyTreeViewCtrl)
    MSG_WM_PAINT(OnPaint)
  END_MSG_MAP_EX()

  LRESULT OnPaint(HDC hdc);

//...

/* end of mytreeviewctrl.h */

The problem is when I setup a breakpoint on CMyTreeViewCtrl::OnPaint -
it never reaches this function at all.

So as I think CMyTreeViewCtrl does not ever receive WM_PAINT message. So
how to do what I want?

-- 
Andrey Sergienko
http://erazer.org


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/