Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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
Updated 21-Apr-11 19:05pm
v2

1 solution

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

}
 
Share this answer
 
v3
Comments
Randy Garacci 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900