OnPaint override on CListViewCtrl? 
Author Message
 OnPaint override on CListViewCtrl?

I have a ATL/WTL SDI application. I am trying to write a message on the
initial display of a derived class of CListViewCtrl
(CWindowImpl<MyListCtrl, CListViewCtrl>). Yet the WM_PAINT message never
gets to the OnPaint override.

I created MyListCtrl using the CMainFrame view as the parent window
handle:

MyListCtrl     list_view;
   .
   .
   .
   RECT rect;
   ::GetClientRect(hWnd, &rect);

   HWND h = list_view.Create(hWnd, _U_RECT(rect),
CListViewCtrl::GetWndClassName(),
                                                WS_CHILD        |
                                                WS_VISIBLE      |
                                                WS_CLIPSIBLINGS |
                                                WS_CLIPCHILDREN |
                                                LVS_REPORT,
                                                WS_EX_CLIENTEDGE);

class MyListCtrl : public CWindowImpl<MyListCtrl, CListViewCtrl>
{
public:
 MyListCtrl();
 virtual ~MyListCtrl();

public:
   BEGIN_MSG_MAP(MyListCtrl)
      MESSAGE_HANDLER(WM_PAINT, OnPaint);
   END_MSG_MAP()

public:
 LRESULT OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/,
BOOL& /*bHandled*/);

Quote:
};

I would have thought that the Message Map would have could the WM_PAINT
and process it according. Any suggestions on how to handle this or why
this approach is invalid?

Thanks for your help...

    R



Sat, 20 Mar 2004 09:40:30 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. About override the OnPaint function.

2. About override the OnPaint function!

3. Override OnPaint in ATL/WTL

4. CListView - Overriding OnPaint()

5. Overriding OnPaint of CListView

6. OnPaint() override

7. Can we override a control's OnPaint ?

8. CListBox -- Owner Drawn - (override OnPaint) - Need help, please!

9. Overriding the OnPaint method for button controls

10. overriding events (OnPaint, OnClick, etc.)

11. CListViewCtrl and DragAndDrop

12. WTL CListViewCtrl

 

 
Powered by phpBB® Forum Software