15,979
社区成员
发帖
与我相关
我的任务
分享
case WM_RBUTTONDOWN:
CMenu menu,*pSubMenu;
menu.LoadMenu(IDR_CONTEXTMENU);
pSubMenu = menu.GetSubMenu(0);
this->SetForegroundWindow();
CPoint pos;
GetCursorPos(&pos);
pSubMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,pos.x,pos.y,this,NULL);
::PostMessage(ni.nid.hWnd,WM_NULL,0,0);
menu.DestroyMenu();
this->SetForegroundWindow();
Sleep(50);
CPoint pos;
GetCursorPos(&pos);