
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