469,282 Members | 2,000 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

C# progam can't manage WM_KEYDOWN with VK_UP, VK_DOWN ?

I call ActiveX from my C# program.
ActiveX is 3D navigator that is successfully works from Browser.

The problem: if I call ActiveX from C#, I can't transmit keyboard management to it ( WM_KEYDOWN with VK_LEFT, VK_UP, VK_RIGHT, VK_DOWN).
But, ordinary keys ('A', 'B' etc.) are coming!

Additional info:
1. I try to override DefWndProc(...) (see bellow) and found, it doesn't receive management (VK_XXX) keys too.
2. SPY reports OK: ActiveX window receives all messages!?!

Where is the problem?

Regards,
Michael.


override protected void DefWndProc(ref System.Windows.Forms.Message m)
{
switch ((WM)m.Msg)
{
case WM.WM_LBUTTONDOWN:
//ShowPropertyPages();
break;
case WM.WM_SYSKEYDOWN:
break;
case WM.WM_KEYDOWN:
int wParam = m.WParam.ToInt32();
switch ((VK)wParam)
{
case VK.VK_LEFT:
case VK.VK_RIGHT:
aaaaa();
break;
case VK.VK_UP:
case VK.VK_DOWN:
if (LowerLimit <= Temperature && UpperLimit >= Temperature)
Temperature--;
break;
}
break;

default:
base.DefWndProc(ref m);
break;
}
}

Nov 16 '05 #1
0 5027

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by ayiiq180 | last post: by
5 posts views Thread by carl bloc | last post: by
13 posts views Thread by Buck Rogers | last post: by
2 posts views Thread by Just Me | last post: by
reply views Thread by DotNetBBK | last post: by
2 posts views Thread by Christian Blackburn | last post: by
17 posts views Thread by vj | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.