|
-
Oct 10th, 2000, 11:14 AM
#1
How do i do a popup menu?
-
Oct 10th, 2000, 12:59 PM
#2
Frenzied Member
Try this(only for MFC):
Put This Under The WM_CONTEXTMENU handler
Code:
CMenu *m_lMenu;
CPoint m_pPoint;
m_pPoint = point;
ClientToScreen(&m_pPoint);
m_lMenu->GetMenu();
m_lMenu = m_lMenu->GetSubMenu(0);
m_lMenu->TrackPopupMenu(TPM_CENTERALIGN + TPM_LEFTBUTTON,m_pPoint.x,m_pPoint.y,this,NULL);
-
Oct 10th, 2000, 01:23 PM
#3
I forgot to mention, i dont use MFC, i only use the API.
-
Oct 10th, 2000, 02:29 PM
#4
Frenzied Member
Well it is preety much the same thing.I think (not sure) this will do.
Code:
case WM_CONTEXTMENU:
{
HMENU *m_lMenu;
POINT m_pPoint;
m_pPoint.x = LOWORD(lParam);
m_pPoint.y = HIWORD(lParam);
ClientToScreen(&m_pPoint);
m_lMenu->GetMenu();
m_lMenu = m_lMenu->GetSubMenu(0);
m_lMenu->TrackPopupMenu(TPM_CENTERALIGN + TPM_LEFTBUTTON,m_pPoint.x,m_pPoint.y,this,NULL);
}
You will need to make some small modifications(regarding the menu API's ).
[Edited by Vlatko on 10-10-2000 at 03:33 PM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|