CWnd::OnContextMenu函数(右键单击弹出快捷菜单)

举报
择城终老 发表于 2021/07/26 23:22:44 2021/07/26
【摘要】 CWnd::OnContextMenu afx_msg void OnContextMenu( CWnd* pWnd, CPoint pos ); 参数说明 pWnd Handle to the window in which the user right clicked the mouse. This can be a child window of the wi...

CWnd::OnContextMenu

afx_msg void OnContextMenu( CWnd* pWnd, CPoint pos );

参数说明

pWnd

Handle to the window in which the user right clicked the mouse. This can be a child window of the window receiving the message. For more information about processing this message, see the Remarks section.

用户右击鼠标的窗口的句柄。这可以是接收到消息的窗口的一个子窗口。有关处理这个消息的更多信息参见说明部分。

pos

Position of the cursor, in screen coordinates, at the time of the mouse click.

点击鼠标时光标的位置,用屏幕坐标表示

备注

Called by the framework when the user has clicked the right mouse button (right clicked) in the window. You can process this message by displaying a context menu using theTrackPopupMenu.

当用户在窗口中点击鼠标右键(右击)时,框架调用这个函数。你可以处理这个消息,使用TrackPopupMenu显示上下文菜单。

If you do not display a context menu you should pass this message onto theDefWindowProc function. If your window is a child window,DefWindowProc sends the message to the parent. Otherwise, DefWindowProc displays a default context menu if the specified position is in the window's caption.

如果你没有显示上下文菜单,你必须将这个消息传递给DefWindowProc函数。如果你的窗口是一个子窗口,DefWindowProc将这个消息发送给父窗口;否则,如果指定的位置是在窗口的标题上,则DefWindowProc显示一个缺省的上下文菜单。

文章来源: liyuanjinglyj.blog.csdn.net,作者:李元静,版权归原作者所有,如需转载,请联系作者。

原文链接:liyuanjinglyj.blog.csdn.net/article/details/7918059

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。