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::PreTranslateMessage(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::PreTranslateMessage(lpmsg);
}

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.
LVL 2
MindoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SteveGTRCommented:
Try this:


if (lpmsg->message == WM_SYSKEYDOWN)
  {
  if ((lpmsg->wParam == VK_DOWN && GetKeyState(VK_MENU) & 0x8000) ||
      (lpmsg->wParam == VK_MENU && GetKeyState(VK_DOWN) & 0x8000))
    MessageBox("ALT-VK_DOWN pressed");

Good luck,
Steve


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MindoAuthor Commented:
Thanks, man, it works. Tell me, how do you learn these things? Win32 is still a pain in the butt for me :-)
0
SteveGTRCommented:
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.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

MindoAuthor Commented:
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.
0
SteveGTRCommented:
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.
0
MindoAuthor Commented:
Of course, i know this source directory. Unfortunately, i haven't found how the CEdit is drawn. This source is incomplete!
0
SteveGTRCommented:
Well, you are right about that.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.