如何在ActiveX控件中启用popoup菜单项 [英] How to enable popoup menu items in an ActiveX control
问题描述
你好,
我创建了一个简单的AxctiveX控件,它会改变颜色以响应弹出菜单。我在控件的函数
Hello,
I created a simple AxctiveX control which would change its color in response to popup menu. I dynamically created a menu in the function
OnContextMenu
中动态创建了一个菜单。问题是,如果我调用
of the control. The problem is, if i call
TrackPopupMenu()
,将此
作为
Cwnd*
,弹出命令未启用。有人可以解释我哪里出错吗?
, the popup commands are not enabled. Can someone please explain where I am going wrong? Is there something in the implementation of
COleControl
的实现中是否存在覆盖
CWnd
$ b的行为的内容$ b允许Popup运行?如果是这样 - 我可以更改它吗?
我使用的是VC 2008
提前感谢任何人谁可以提供帮助...
Pani
that allows a Popup to function? If so - can i change it?
I am using VC 2008
Thanks in advance to anyone who can help ...
Pani
推荐答案
TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,point.x, point.y, this, NULL );
我认为你必须传递一个窗口句柄,而不是这个。
参见。
查看: [ ^ ]
这篇关于如何在ActiveX控件中启用popoup菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!