M
Michael Grabelkovsky
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;
}
}
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;
}
}