Re: how to catch WM_CTLCOLOR message use a hook?
oh, I write a application ,and i call the SetwindowHookEx when it starts.
and the registered hook procedure is HookProc .
my problem is that i want to catch WM_CTLCOLOR in HookProc,
for example if i want to catch WM_CREATE, i will do this like bellow.
LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
LONG lReturn = 0;
if( nCode == HC_ACTION )
{
PCWPSTRUCT pcwps=(PCWPSTRUCT)lParam;
switch(pcwps->message)
{
case WM_CTLCOLOR:
{
//But here never reached.
}break;
case WM_CREATE:
{
//Here i catch the message WM_CREATE
}break;
}
}
return CallNextHookEx(g_hHook, nCode, wParam, lParam);
}
"Ajay Kalra" <ajaykalra@yahoo.com>
??????:eee45cea-721b-4713-9431-311b0f311c35@p2g2000prn.googlegroups.com...
Not clear what you are asking. There is nothing special about this
message in a hook. What exactly is the problem that you are having
when you use a hook.
Also, a Cbutton doesnt respond to WM_CTLCOLOR. It needs to be owner
drawn.
--
Ajay
On Jan 5, 11:34 pm, "Sunny" <sound_of_nat...@hotmail.com> wrote:
Thanks your answer .
I use a hook inorder to change a control 's face , for example use
CButtonEx
replace all CButton, including the button on system dialog, e.g
CFileDialog.
"Jonathan Wood" <jw...@softcircuits.com>
??????:evjJzU7bJHA.1...@TK2MSFTNGP05.phx.gbl...
I think you need to be a bit more specific. If you want your window to
handle WM_CTLCOLOR, no hook is needed.
Can you explain more about what you are doing?
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
http://www.softcircuits.com/blog/
"Sunny" <sound_of_nat...@hotmail.com> wrote in message
news:%23ZIT5N7bJHA.572@TK2MSFTNGP02.phx.gbl...
Can someone help me.
Any attention is appreciate.