fix for MSWDetachWindowMenu when "&Window" string is translated
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2304,15 +2304,13 @@ void wxWindow::MSWDetachWindowMenu()
|
||||
{
|
||||
if ( m_hMenu )
|
||||
{
|
||||
wxChar buf[1024];
|
||||
HMENU hMenu = (HMENU)m_hMenu;
|
||||
|
||||
int N = ::GetMenuItemCount(hMenu);
|
||||
int i;
|
||||
for (i = 0; i < N; i++)
|
||||
for ( int i = 0; i < N; i++ )
|
||||
{
|
||||
wxChar buf[100];
|
||||
int chars = GetMenuString(hMenu, i, buf, 100, MF_BYPOSITION);
|
||||
if ( !chars )
|
||||
if ( !::GetMenuString(hMenu, i, buf, WXSIZEOF(buf), MF_BYPOSITION) )
|
||||
{
|
||||
wxLogLastError(wxT("GetMenuString"));
|
||||
|
||||
@@ -2321,7 +2319,10 @@ void wxWindow::MSWDetachWindowMenu()
|
||||
|
||||
if ( wxStrcmp(buf, wxT("&Window")) == 0 )
|
||||
{
|
||||
RemoveMenu(hMenu, i, MF_BYPOSITION);
|
||||
if ( !::RemoveMenu(hMenu, i, MF_BYPOSITION) )
|
||||
{
|
||||
wxLogLastError(wxT("RemoveMenu"));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user