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