加速键不起作用 [英] accelerator keys don't work

查看:78
本文介绍了加速键不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 8(它是一个资源管理器样式的应用程序)中创建了一个MFC SDI项目.它具有在Accelerator文件夹的资源视图中定义的加速键.分配给加速键的ID与它们相应的菜单项具有的ID匹配.

选择菜单项时,消息ID会导致调用正确的方法.但是,当按下加速键时,什么也没发生.

为什么是这样?我缺少什么吗?

I have an MFC SDI project vreated within Visual Studio 8 (it is an explorer style app). It has accelerator keys defined in the resource view within the Accelerator folder. The IDs assigned to the accelerator keys match the IDs that their corresponding menu items have.

When the menu items are chosen, the message ID causes the correct method to be called. But when the accelerator keys are pressed, nothing happens.

Why is this? Am I missing something?

推荐答案

case WM_COMMAND:
{
  int idCommand = LOWORD(wParam);
  int iNotifyCode = HIWORD(wParam); // 1==accelerator
  switch(idCommand)
  {
    case ID_QUIT: /* do anything */ break;
    /* do something else */
  }
}
break;


问候.


这篇关于加速键不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆