Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - I want to trap accelerator keys bef menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

I want to trap accelerator keys bef menu

 Post Reply Post Reply
Author
Message
deepghosh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 March 2006
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote deepghosh Quote  Post ReplyReply Direct Link To This Post Topic: I want to trap accelerator keys bef menu
    Posted: 18 April 2006 at 1:45am

I am using an application for which my main framewindowis derived from CXTPFrameWnd (The usual way).

I have some menu items with accel key e.g. &Session.

In the application  I have some CView derived class (with window) which is a childwindow of CXTPFrameWnd.

This class has buttons with alt key as S (Lets say &Save).

If this button is on the screen , I want to process this button and ignore the &Session on the menu.

Is there anyway to achieve this?

Back to Top
deepghosh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 March 2006
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote deepghosh Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2006 at 1:46am

Just on more piece of info.

If I can get an exit, I know how to process my group if buttons. So the issue is which function I should override.

Back to Top
deepghosh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 March 2006
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote deepghosh Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2006 at 9:45am

Oleg,

Could you please respond to this?

I have a licensed userid.

I will provide any information you need.

I really need an answer to this one.

Thanks in Advance.

Deep

Back to Top
deepghosh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 March 2006
Location: United States
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote deepghosh Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2006 at 5:51pm

I myself sorted it out.

BOOL CiMainFrame::PreTranslateMessage(MSG* pMsg)
{
    if ((pMsg->message == WM_SYSKEYDOWN) && (HIWORD(pMsg->lParam) & KF_ALTDOWN))
    {
 TCHAR chAccel = (TCHAR)(UINT)pMsg->wParam;
 CvBaseView *pView = (CvBaseView *) GetActiveView();
 chAccel = toupper(chAccel);
 if (chAccel && pView -> ProcessAccelerator(chAccel))
     return TRUE;

    }
    return CXTPFrameWnd::PreTranslateMessage(pMsg);
}

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.