Results 1 to 4 of 4

Thread: Popup menus

  1. #1
    Guest

    Post

    How do i do a popup menu?

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    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);
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Guest
    I forgot to mention, i dont use MFC, i only use the API.

  4. #4
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    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]
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width