BeginPopup
instantiates a popup nest
BOOL BeginPopup( LPCSTR lpcszTxt )
returns true when successful else false
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()); }
Control.h