Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ MFC ActiveX
I am using the CMfcBrowseEditCtrl on an ActiveX control property page. The property page base class is COleProperty page.
 
The ALT+Down and ALT+Right key combos (VK_DOWN or VK_RIGHT) are handled in the CMfcBrowseEditCtrl::PreTranslateMsg method in response to a WM_SYSKEYDOWN message. The response is to invoke the virtual OnBrowse method.
 
At any rate, in this scenario, the PreTranslateMsg is not being called when the down or right arrows are pressed, so the OnBrowse method is never called.
 
I have used the CMfcBrowseEdit control on CPropertyPage derived classes with no trouble.
 
Thanks in advance for you reply.
Posted 21-Apr-11 14:56pm
Edited 21-Apr-11 20:05pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try this: catch WM_KEYDOWN in PreTranslateMessage() and check for an arrow key. Then, check if the ALT key is pressed:
    if (GetAsyncKeyState(VK_MENU) < 0)
    {
        // ALT + arrow key

    }
  Permalink  
v3
Comments
Randy Garacci at 22-Apr-11 14:06pm
   
Thank you for the reply. Unfortunately, PreTranslateMessage() does not get called for that message either. As a matter of fact, I only get a call to PreTranslateMessage with a WM_PAINT (0x000f) message when the button is clicked with the mouse.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 184
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,665


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 22 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100