15,978
社区成员
发帖
与我相关
我的任务
分享
// 加上这一句,点其它的地方,托盘菜单才会消失
::SetForegroundWindow( m_tnd.hWnd );
// 弹出菜单
CPoint pos;
GetCursorPos( &pos );
CWnd* pWnd = AfxGetMainWnd();
menu.TrackPopupMenu( TPM_RIGHTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON, pos.x, pos.y, AfxGetMainWnd(), NULL );
menu.DestroyMenu();