- Fix menu window callback. Only use it when the menu name is not null.

svn path=/trunk/; revision=42643
This commit is contained in:
James Tabor 2009-08-12 23:37:26 +00:00
parent 10b13ed7c9
commit 904739a70b
2 changed files with 15 additions and 24 deletions

View file

@ -1,23 +1,4 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Window classes
@ -694,7 +675,10 @@ co_IntCallLoadMenu( HINSTANCE hModule,
Common->hModule = hModule;
RtlCopyMemory(&Common->MenuName, pMenuName->Buffer, pMenuName->Length);
if (pMenuName->Length)
RtlCopyMemory(&Common->MenuName, pMenuName->Buffer, pMenuName->Length);
else
RtlCopyMemory(&Common->MenuName, &pMenuName->Buffer, sizeof(WCHAR));
ResultPointer = NULL;
ResultLength = sizeof(LRESULT);

View file

@ -1837,12 +1837,19 @@ AllocErr:
{
if (hMenu)
IntSetMenu(Window, hMenu, &MenuChanged);
else // Take it from the parent.
else if (Wnd->pcls->lpszMenuName) // Take it from the parent.
{
UNICODE_STRING MenuName;
RtlInitUnicodeString( &MenuName, Wnd->pcls->lpszMenuName);
if (IS_INTRESOURCE(Wnd->pcls->lpszMenuName))
{
MenuName.Length = 0;
MenuName.MaximumLength = 0;
MenuName.Buffer = Wnd->pcls->lpszMenuName;
}
else
{
RtlInitUnicodeString( &MenuName, Wnd->pcls->lpszMenuName);
}
hMenu = co_IntCallLoadMenu( Wnd->pcls->hModule, &MenuName);
if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);
}