RE: CTreeViewCtrl and WM_PAINT

"Michael Stephenson" <[email protected]> Fri, 4 Feb 2011 10:06:41 -0500
Newsgroups gmane.comp.windows.wtl
Message-ID <040701cbc47d$21f26180$65d72480$@com>
Odd stuff.  Based just on what you've shown, you should see your handler
being called.

Does the TreeView actually paint okay?

What's the declaration of your CMyTreeViewCtrl?

It should be something like:

Class CMyTreeViewCtrl : public CWindowImpl<CMyTreeViewCtrl>
{
}

Do you have WS_CLIPCHILDREN in the main frame's window styles?

What if you add handlers for WM_PRINT and WM_PRINTCLIENT, do those get
called?

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Andrey
Sergienko
Sent: Friday, February 04, 2011 7:56 AM
To: [email protected]
Subject: [wtl] CTreeViewCtrl and WM_PAINT


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





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

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/