• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
git&Android
博客园    首页    新随笔    联系   管理    订阅  订阅

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

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显示一个缺省的上下文菜单。

版权声明:本文为博主原创文章,未经博主允许不得转载。

posted @ 2012-08-28 23:05  李元静  阅读(277)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3