IDR_MENU SHMENUBAR DISCARDABLE
BEGIN
IDR_MENU,
2,
I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE,
IDS_OK, 0, NOMENU,
I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
IDS_HELP, 0, 0,
END
IDR_MENU SHMENUBAR DISCARDABLE
BEGIN
IDR_MENU_POPUP,
2,
I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE,
IDS_OK, 0, NOMENU,
I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
IDS_HELP, 0, 0,
END
IDR_MENU_POPUP MENU
BEGIN
POPUP ""
BEGIN
MENUITEM "System Metric", IDM_SYSTEM_METRIC
MENUITEM "About", IDM_HELP_ABOUT
END
END
IDR_MENU_POPUP MENU
BEGIN
POPUP "Menu L"
BEGIN
MENUITEM "Menu Item1", 0
MENUITEM "Menu Item2", 0
END
POPUP "Menu R"
BEGIN
MENUITEM "System Metric", IDM_SYSTEM_METRIC
MENUITEM "About", IDM_HELP_ABOUT
END
END
case WM_CREATE:
SHMENUBARINFO mbi;
memset(&mbi, 0, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = hWnd;
mbi.nToolBarId = IDR_MENU_POPUP;
mbi.hInstRes = g_hInst;
mbi.dwFlags = SHCMBF_HMENU;
if (!SHCreateMenuBar(&mbi))
{
g_hWndMenuBar = NULL;
}
else
{
g_hWndMenuBar = mbi.hwndMB;
}
IDR_MENU_POPUP MENU
BEGIN
POPUP "File"
BEGIN
MENUITEM "&Open", 0
MENUITEM "&Save", 0
MENUITEM "E&xit", 0
END
POPUP "Edit"
BEGIN
MENUITEM "&Copy", 0
MENUITEM "C&ut", 0
MENUITEM "&Paste", 0
END
POPUP "View"
BEGIN
MENUITEM "&Full Screen", 0
MENUITEM "&Options", 0
END
POPUP "Help"
BEGIN
MENUITEM "Abou&t", 0
MENUITEM "He&lp", 0
END
END
here’s what is does,
and,
Update:
You might also be interested in this post, Fun with menus – part II