Re: How to catch WM_PAINT use Hook in Dialog?
m_pParentWnd -----------is a static member of the class,
and my CALLBACK function is static member of the class,
And I have send you my test hook code to email@example.com ,if you have
"Joseph M. Newcomer" <firstname.lastname@example.org>
On Tue, 5 Jun 2007 12:47:06 +0800, "green" <email@example.com> wrote:
LRESULT C***::CallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
presumably this is declared as
static LRESULT CALLBACK CallWndProc(int, WPARAM, LPARAM);
so why is the word CALLBACK missing in the above declaration?
CWPSTRUCT* cwps = (CWPSTRUCT*)lParam;
if ( cwps->hwnd != m_pParentWnd->m_hWnd ) //if is not the Dialog
What is m_pParentWnd? It can't be a class member of the class because
cannot be a class member function, so what is it?
Likewise, m_hCallWndhook cannot be a class member because the callback
cannot have access
to any member variable, because it must be static.
I have a suspicion that you have deeper problems here. Fix all the above
str.Format("nCode:%d ,wParam:%d ,lParam:%d ,
if( cwps->message == WM_PAINT )
if( cwps->message == WM_ERASEBKGND )
return CallNextHookEx(m_hCallWndhook, nCode, wParam, lParam);
"Tom Serface" <firstname.lastname@example.org>
Could you post a bit of the code? Why are you trying to hook WM_PAINT
rather than just putting you code into the OnPaint() routine?
"green" <email@example.com> wrote in message
I used WH_CALLWNDPROC,
but in the hook function, WM_PAINT can only catch once (only when
Create'), Then OnPaint is called ,but in Hook function ,I do not
Joseph M. Newcomer [MVP]
MVP Tips: http://www.flounder.com/mvp_tips.htm