Here is the code I'm using in my current project to create a menu:
Code:
/* Create the menu */
{
HMENU hFileMenu, hWindowMenu, hViewMenu;
/* Create the "File" menu, and its selections */
hFileMenu = CreateMenu();
AppendMenu(hFileMenu,0,IDMENU_FILE_NEW,_T("New"));
AppendMenu(hFileMenu,0,IDMENU_FILE_CLOSE,_T("Close"));
AppendMenu(hFileMenu,0,IDMENU_FILE_CLOSEALL,_T("Close All"));
AppendMenu(hFileMenu,MF_SEPARATOR,0,0);
AppendMenu(hFileMenu,0,IDMENU_FILE_CONNECT,_T("Connect"));
AppendMenu(hFileMenu,MF_SEPARATOR,0,0);
AppendMenu(hFileMenu,0,IDMENU_FILE_EXIT,_T("Exit"));
/* Create the "View" menu */
hViewMenu = CreateMenu();
AppendMenu(hViewMenu,0,IDMENU_VIEW_SETTINGS,_T("Settings"));
/* Create the "Window" menu */
hWindowMenu = CreateMenu();
/* Create the Frame menu, and add all the sub menus to it */
g_hMenuFrame = CreateMenu();
AppendMenu(g_hMenuFrame,MF_POPUP,(UINT_PTR)hFileMenu,_T("File"));
AppendMenu(g_hMenuFrame,MF_POPUP,(UINT_PTR)hViewMenu,_T("View"));
AppendMenu(g_hMenuFrame,MF_POPUP,(UINT_PTR)hWindowMenu,_T("Window"));
}
All the IDMENU_* identifiers need to be defined somewhere in your project. Once you have the menu created (g_hMenuFrame in my example code), you then pass that menu handle to CreateWindow().