CMenu menu; menu.CreatePopupMenu(); menu.AppendMenu(MF_STRING, 1, "File"); menu.AppendMenu(MF_STRING, 2, "Edit"); menu.AppendMenu(MF_SEPARATOR); menu.AppendMenu(MF_STRING, 3, "Help"); menu.AppendMenu(MF_STRING, 4, "About"); menu.AddText("This is the Textbox."); menu.TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, this);In this example, the CMenu object is created and several menu items are added using the AppendMenu function. The AddText function is then used to add a text item to the menu. Finally, the TrackPopupMenu function is used to display the menu on the screen. The package library used in this example is MFC (Microsoft Foundation Classes).