放弃 CMainFrame 中的 ALT 键按下
我有以下代码:
CMainFrame* pFrame = new CMainFrame;
if (!pFrame)
return FALSE;
m_pMainWnd = pFrame;
// create and load the frame with its resources
pFrame->LoadFrame(IDR_APP_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
// The one and only window has been initialized, so show and update it
pFrame->ShowWindow(SW_SHOWMAXIMIZED);
问题是,当我按
时,将弹出菜单(IDR_APP_MAINFRAME)。 如何才能始终隐藏菜单并且不响应按键?
我听说这是由于 MFC 中的加速器控件造成的,但我在使用 VS2008 的项目解决方案中看不到该控件。
I'm having the following code:
CMainFrame* pFrame = new CMainFrame;
if (!pFrame)
return FALSE;
m_pMainWnd = pFrame;
// create and load the frame with its resources
pFrame->LoadFrame(IDR_APP_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
// The one and only window has been initialized, so show and update it
pFrame->ShowWindow(SW_SHOWMAXIMIZED);
The problem is, when I press <ALT>
, the menu(IDR_APP_MAINFRAME) will popup.
How can I always hide the menu and do not response to presss?
I had heard this is due to an accelerator control in MFC, but I couldn't see the control in my project solution which is using VS2008..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的
CMainFrame
中覆盖PreCreateWindow
并销毁菜单。尝试这样的事情:In your
CMainFrame
overridePreCreateWindow
and destroy the menu. Try something like this: