Mindo
asked on
ActiveX control ALT+DOWN arrow key processing
I'm writing an ActiveX control. I must process the ALT+DOWN key combination. Anybody knows how to do it?
I can receive the ALT key in the OnSysKeyDown() message. Also, i can receive the VK_DOWN message by doing the following:
BOOL CNMComboBoxCtrl::PreTransl ateMessage (MSG* lpmsg)
{
BOOL bHandleNow = FALSE;
switch (lpmsg->message)
{
case WM_KEYDOWN:
switch (lpmsg->wParam)
{
case VK_DOWN:
bHandleNow = TRUE;
break;
break;
}
if (bHandleNow)
OnKeyDown(lpmsg->wParam, LOWORD(lpmsg
->lParam), HIWORD(lpmsg->lParam));
break;
}
return bHandleNow;
return COleControl::PreTranslateM essage(lpm sg);
}
This way i get the DOWN key in the OnKeyDown message.
If i press the DOWN key while holding the ALT key, i do not get the DOWN message in the OnKeyDown. It's handled anywhere else.
So i have the problem of handling this key combination. I'll be very thankful for your help.
I can receive the ALT key in the OnSysKeyDown() message. Also, i can receive the VK_DOWN message by doing the following:
BOOL CNMComboBoxCtrl::PreTransl
{
BOOL bHandleNow = FALSE;
switch (lpmsg->message)
{
case WM_KEYDOWN:
switch (lpmsg->wParam)
{
case VK_DOWN:
bHandleNow = TRUE;
break;
break;
}
if (bHandleNow)
OnKeyDown(lpmsg->wParam, LOWORD(lpmsg
->lParam), HIWORD(lpmsg->lParam));
break;
}
return bHandleNow;
return COleControl::PreTranslateM
}
This way i get the DOWN key in the OnKeyDown message.
If i press the DOWN key while holding the ALT key, i do not get the DOWN message in the OnKeyDown. It's handled anywhere else.
So i have the problem of handling this key combination. I'll be very thankful for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I find that searching the MFC code is a great source of finding out how things work. It helps to know sort of what to look for, but you develop that over time.
ASKER
You mean you're reading the Microsoft MFC source code? Is it freely available? Hmm, i haven't found how the CEdit control is drawn. Tell me if you have it's source code.
They give it to you when you buy VC++.
\Program Files\Microsoft Visual Studio\VC98\MFC\SRC
- and -
\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE
I do text searches for what I'm interested in using "findstr" on NT in a DOS box.
\Program Files\Microsoft Visual Studio\VC98\MFC\SRC
- and -
\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE
I do text searches for what I'm interested in using "findstr" on NT in a DOS box.
ASKER
Of course, i know this source directory. Unfortunately, i haven't found how the CEdit is drawn. This source is incomplete!
Well, you are right about that.
ASKER