- ok = ::AppendMenu(GetHmenu(), flags, id, pData);
+ HWND hMenuBar;
+ if (m_menuBar)
+ hMenuBar = GetWinHwnd(m_menuBar);
+ else
+ hMenuBar = HWND_DESKTOP;
+ HWND hSubMenu = ::WinCreateWindow( hMenuBar // parent
+ ,WC_MENU // type
+ ,"Menu" // a generic name
+ ,0L // no style flag
+ ,0L,0L,0L,0L // no position
+ ,hMenuBar // no owner
+ ,HWND_TOP // always on top
+ ,0L // no ID needed for dynamic creation
+ ,NULL // no control data
+ ,NULL // no presentation params
+ );
+
+ m_vMenuData.iPosition = 0;
+ m_vMenuData.hwndSubMenu = hSubMenu;
+ m_vMenuData.hItem = NULLHANDLE;
+
+ bOk = (bool)::WinSendMsg(GetHmenu(), MM_INSERTITEM, (MPARAM)&m_vMenuData, (MPARAM)pItem->GetText().c_str());