本文介绍了如何以编程方式将焦点设置在弹出菜单(在cpp应用程序中)的菜单项上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要以编程方式展开弹出菜单,现在,我想在此菜单上选择第n个菜单项.

I want programmatically expand a pop-up menu and now, I want to select 'n'th menu item on this menu.

我正在使用TrackPopUpMenu展开菜单.直到关闭菜单,TrackPopUpMenu才返回.因此,我必须设置一个消息挂钩来调用HiliteMenuItem,它将使菜单项处于高亮状态.

I am using TrackPopUpMenu to expand the menu. TrackPopUpMenu doesn't return until menu is closed. So I had to setup a message hook to call HiliteMenuItem which will hilite the menu item.

但是,此调用不会将焦点放在菜单项上.含义:菜单在视觉上被加亮,但是菜单不接受诸如向下箭头"之类的键盘输入.

However, this call doesn't setfocus on the menu item. Meaning: the menu is hilited visually but menu doesn't accept the keyboard inputs like "down arrow", etc.

如何将焦点设置在隐藏菜单项上?

How can i set up the focus on the hilited menu item?

 

推荐答案

hilite是什么意思?

What is the meaning of hilite?

要让菜单项成为焦点,我们可以使用菜单项的处理程序作为参数来调用SetFocus API.

To let a menu item get focus, we can call the SetFocus API with the handler of the menu item as parameter.

此致,
李亚伦

Regards,
Aland Li


这篇关于如何以编程方式将焦点设置在弹出菜单(在cpp应用程序中)的菜单项上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 00:59