Call this member function to display a floating pop-up menu at the specified location, and track the selection of items on the pop-up menu.
BOOL TrackPopupMenu ( UINT nFlags, int x, int y, CWnd* pWnd, LPCRECT lpRect = 0 );
nFlags
Specifies a screen-position flag and a mouse-button flag. The screen-position flag can be one of the following:
The mouse-button flag can be either of the following:
//菜單跟蹤鼠標右鍵
x: 設置菜單的X軸位置(屏幕坐標)
y:設置菜單的Y軸位置(屏幕坐標)
pWnd 指定菜單的父窗口。
lpRect 設置一個(gè)Rect結構或者一個(gè)CRect對象,在改矩形區域那按鼠標鍵,菜單不會(huì )消失;如果設為
NULL,只要在菜單以外的位置按鼠標鍵,菜單就會(huì )消失。
聯(lián)系客服