mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 06:53:37 +00:00
- Fix menu window callback. Only use it when the menu name is not null.
svn path=/trunk/; revision=42643
This commit is contained in:
parent
10b13ed7c9
commit
904739a70b
2 changed files with 15 additions and 24 deletions
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Window classes
|
* PURPOSE: Window classes
|
||||||
|
@ -694,7 +675,10 @@ co_IntCallLoadMenu( HINSTANCE hModule,
|
||||||
|
|
||||||
|
|
||||||
Common->hModule = 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;
|
ResultPointer = NULL;
|
||||||
ResultLength = sizeof(LRESULT);
|
ResultLength = sizeof(LRESULT);
|
||||||
|
|
|
@ -1837,12 +1837,19 @@ AllocErr:
|
||||||
{
|
{
|
||||||
if (hMenu)
|
if (hMenu)
|
||||||
IntSetMenu(Window, hMenu, &MenuChanged);
|
IntSetMenu(Window, hMenu, &MenuChanged);
|
||||||
else // Take it from the parent.
|
else if (Wnd->pcls->lpszMenuName) // Take it from the parent.
|
||||||
{
|
{
|
||||||
UNICODE_STRING MenuName;
|
UNICODE_STRING MenuName;
|
||||||
|
if (IS_INTRESOURCE(Wnd->pcls->lpszMenuName))
|
||||||
RtlInitUnicodeString( &MenuName, 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);
|
hMenu = co_IntCallLoadMenu( Wnd->pcls->hModule, &MenuName);
|
||||||
if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);
|
if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue