Re: How to catch WM_PAINT use Hook in Dialog?
- From: "green" <greenabc300@xxxxxxx>
- Date: Tue, 5 Jun 2007 12:47:06 +0800
m_hCallWndhook =
SetWindowsHookEx(WH_CALLWNDPROC,CallWndProc,/*NULL*/AfxGetApp()->m_hInstance
,GetCurrentThreadId());
LRESULT C***::CallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
{
CWPSTRUCT* cwps = (CWPSTRUCT*)lParam;
if ( cwps->hwnd != m_pParentWnd->m_hWnd ) //if is not the Dialog ,
return.
return CallNextHookEx(m_hCallWndhook,nCode,wParam,lParam);
CString str;
str.Format("nCode:%d ,wParam:%d ,lParam:%d ,
message:0x%04X.\r\n",nCode,wParam,lParam,cwps->message);
//OutputDebugString(str);
if( cwps->message == WM_PAINT )
OutputDebugString(_T("----------------WM_PAINT .\r\n"));
if( cwps->message == WM_ERASEBKGND )
OutputDebugString(_T("----------------WM_ERASEBKGND
..\r\n"));
return CallNextHookEx(m_hCallWndhook, nCode, wParam, lParam);
}
"Tom Serface" <tom.nospam@xxxxxxxxxxxxx>
??????:64390268-6EE2-4970-88EF-5814EB0F4A63@xxxxxxxxxxxxxxxx
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?
Tom
"green" <greenabc300@xxxxxxx> wrote in message
news:%23zbVbdypHHA.4120@xxxxxxxxxxxxxxxxxxxxxxx
Dear all,
I used WH_CALLWNDPROC,
but in the hook function, WM_PAINT can only catch once (only when dialog
Create'), Then OnPaint is called ,but in Hook function ,I do not catch
WM_PAINT.
Thanks
green
2007-06-05
.
- Follow-Ups:
- Re: How to catch WM_PAINT use Hook in Dialog?
- From: Joseph M . Newcomer
- Re: How to catch WM_PAINT use Hook in Dialog?
- References:
- How to catch WM_PAINT use Hook in Dialog?
- From: green
- How to catch WM_PAINT use Hook in Dialog?
- Prev by Date: Re: Problem with linker
- Next by Date: Re: GetOpenFileName + Using own dialog template
- Previous by thread: How to catch WM_PAINT use Hook in Dialog?
- Next by thread: Re: How to catch WM_PAINT use Hook in Dialog?
- Index(es):
Relevant Pages
|