Print Page | Close Window

I want to trap accelerator keys bef menu

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=4021
Printed Date: 04 October 2024 at 11:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: I want to trap accelerator keys bef menu
Posted By: deepghosh
Subject: I want to trap accelerator keys bef menu
Date 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?




Replies:
Posted By: deepghosh
Date 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.



Posted By: deepghosh
Date 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



Posted By: deepghosh
Date 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);
}




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net