本文介绍了关于使用ctrl的快捷键的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个关于ctrl键的问题,现在我创建了一个vc演示,我使用快捷键O将工具栏更改为Ooobal,如果弹出了主菜单视图,则按o小键盘就会响应或Ctrl + O组合小键盘,并且在文件主菜单中使用了ctrl + o,如果不使用,则不响应按ctrl + o.现在,即使其他子菜单项中使用了ctrl + o,我也只希望o字母具有响应,而不是ctrl + o.
Windows默认演示都是这样,我发现foxit阅读器不喜欢这样,没关系.我要他们怎么做?

有人听懂吗?如果您知道,请回答问题.
非常感谢您.

Hey , everyone, I have a question about ctrl key, now I created a vc demo, i changed Toolbar to Ooobal with shortcut key O, if the view main-menu has pop up, it will response either you press o keypad or Ctrl+O combination keypad, and the ctrl+o is used in file main-menu, if not used, press ctrl+o is not responsed. Now, I want only o letter has a response, not ctrl+o, even if the ctrl+o is used in other sub-menu item.
The windows default demo all like this, I found that the foxit reader did not like this, it’s OK. I want how they did it?

Anyone understand it? If u know, please reply the questions.
thank you very much

推荐答案


if (pMsg->message == WM_COMMAND)
    {
        if (ID_ZOOMIN == LOWORD(pMsg->wParam))
        {
            if (::GetKeyState(VK_CONTROL) < 0)
            {
                if (m_pMainMenu)
                {
                    UINT n = m_pMainMenu->gt;GetMenuItemID(1);
                    ::SendMessage((HWND)m_pMainMenu->GetSubMenu(1)->gt,GetSafeHmenu(),WM_COMMAND,MAKEWPARAM(0, m_pMainMenu->GetMenuItemID(1)),0);

                }

                return TRUE;
            }
        }


    }




ID_ZOOMIN是快捷键为"O"的子菜单ID.现在,之前的代码可以禁止ctrl + o键盘,但是如果按ctrl + o,则该子菜单消失了,失去了焦点.我正在寻找原因.
OriginalGriff或任何男孩都可以告诉我完成此小功能的原因或其他方法吗?

谢谢,
等待回复




the ID_ZOOMIN is the sub-menu ID which short-key is "O". Now the before codes can forbid the ctrl+o keypad, but if press ctrl+o, this sub-menu has disappeared, lost focus. I am finding the reason.
Could OriginalGriff or anyboy tell me the reason or the other approach to finish this little funtion?

thanks,
waiting the reply


这篇关于关于使用ctrl的快捷键的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 18:13