Menu::BeginPopup

Description

instantiates a popup nest

Syntax

BOOL BeginPopup( LPCSTR lpcszTxt )

Parameters

lpcszTxt
the name of the popup menu

Return

returns true when successful else false

Examples

EX1

#include <control.h>
class CTest : public Menu
{
    
public:
    
    CTest()
    {
        Add(_L("&Insert"), Command);
        Add(_L("&Add"),    Command); 
        Add(_L("&Delete"), Command);
        BeginPopup("Popup");
            Add(_L("&P1"), Command);
            Add(_L("&P2"), Command);
            Add(_L("&P3"), Command);
            BeginPopup("Popup");
                Add(_L("&P1"), Command);
                Add(_L("&P2"), Command);
                Add(_L("&P3"), Command);
            EndPopup();
        EndPopup();
        Add(_L("&Rename"), Command);
        Add(_L("&Move"), Command);
        Add(_L("&Change Parameters"), Command);
    }
    void Command(uint nCmd)
    {
        string str;
        str.Format("Clicked %d", nCmd);
        MessageBox(GetWindow(), str);
    }
};

void Menu_BeginPopup()
{
    CTest test;
    test.TrackPopupMenu(0,  100, 100, GetWindow());
}

Remark

See Also

header to Include

Control.h