X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f23208caccf81b0b34c5c11b466c6bd64fdf0f9d..4a64bee465c0dbf3d97fbf290cb2fef4ad41ca34:/src/os2/menu.cpp?ds=inline diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index 8ff449298f..c90a5ebbdf 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -278,12 +278,17 @@ bool wxMenu::DoInsertOrAppend( // if (nPos == (size_t)-1) { - HWND hSubMenu = ::WinCreateWindow( GetWinHwnd(m_menuBar) // parent + 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 - ,GetWinHwnd(m_menuBar) // no owner + ,hMenuBar // no owner ,HWND_TOP // always on top ,0L // no ID needed for dynamic creation ,NULL // no control data