Treba takhle, je to s pomoci MFC:
Kód:
// Get the cursor position
POINT p;
::GetCursorPos(&p);					
m_menPopup.GetSubMenu(0)->TrackPopupMenu(		TPM_BOTTOMALIGN | TPM_RIGHTALIGN | TPM_RIGHTBUTTON,	p.x, p.y, AfxGetMainWnd(), NULL);