Link to home
Start Free TrialLog in
Avatar of Mindo
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::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.
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mindo
Mindo

ASKER

Thanks, man, it works. Tell me, how do you learn these things? Win32 is still a pain in the butt for me :-)
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.
Avatar of Mindo

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.
Avatar of Mindo

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.