473,378 Members | 1,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 5271

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ayiiq180 | last post by:
my hook already in a dll and the handle is shared,but the hook cant work well,when i run the application,My mouse click the application's view,the hook work well,but when i click the other...
5
by: carl bloc | last post by:
Has any body got any code for this brief that a friend has to do, its for the uk version of the lottery i.e 6 balls and a bouns ball. 1. a control loop is required to determine the operation...
13
by: Buck Rogers | last post by:
Hi guys! I am trying to do an excercise from my C book, which coincidently is very similar to the one in the recent "program" thread. Task: Write a program that uses redirection to accept...
2
by: Just Me | last post by:
I have two situations: 1) a form with a picturebox on it This picturebox does NOT gets WM_KEYDOWN messages if the key is an arrow key. Works OK if Num Lock is on so those keys are numerals. ...
0
by: DotNetBBK | last post by:
Hi, I am using a custom text box, where I need to override TabSelection, as I have to generate an event and based on that event, I need to do some processing in other class, who is listening to...
2
by: Christian Blackburn | last post by:
Hi Gang, I would like to send the Alt+A keystroke to a Window. What's the best way to go about that? This didn't seem to work. What message should I work with WM_KEYDOWN and WM_KEYUP are...
2
by: Just Me | last post by:
I do not get WM_KEYDOWN messages for arrow keys presses in my overridden WndProc for a picturebox control. Something must be eating them - anyone familiar with what's going on? Thanks
17
by: vj | last post by:
Hi All, I am using C++Builder V5.0 to run my C programs. I am not an expert in C. Normally, I run the C program with these steps: 'Compile', 'Make Project', 'Build Project' and then 'Run'. Many...
0
by: fabien.lyon | last post by:
-----Message d'origine----- De : fabien.lyon Envoyé : mercredi 30 mai 2007 20:16 À : 'python-list@python.org' Objet : RE: embeded python progam into visual C++ application crash 2.5.1 is...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.