Initialize MENUITEMINFO structure before calling GetMenuItemInfo.

This commit is contained in:
Dmitry Timoshkov 2001-01-15 20:21:15 +00:00 committed by Alexandre Julliard
parent 50af4a381c
commit aab85d72bd
1 changed files with 4 additions and 3 deletions

View File

@ -1100,7 +1100,7 @@ static BOOL MDI_AugmentFrameMenu( MDICLIENTINFO* ci, WND *frame,
*/
static BOOL MDI_RestoreFrameMenu( WND *frameWnd, HWND hChild )
{
MENUITEMINFOA menuInfo;
MENUITEMINFOW menuInfo;
INT nItems = GetMenuItemCount(frameWnd->wIDmenu) - 1;
UINT iId = GetMenuItemID(frameWnd->wIDmenu,nItems) ;
@ -1114,10 +1114,11 @@ static BOOL MDI_RestoreFrameMenu( WND *frameWnd, HWND hChild )
* Remove the system menu, If that menu is the icon of the window
* as it is in win95, we have to delete the bitmap.
*/
menuInfo.cbSize = sizeof(MENUITEMINFOA);
memset(&menuInfo, 0, sizeof(menuInfo));
menuInfo.cbSize = sizeof(menuInfo);
menuInfo.fMask = MIIM_DATA | MIIM_TYPE;
GetMenuItemInfoA(frameWnd->wIDmenu,
GetMenuItemInfoW(frameWnd->wIDmenu,
0,
TRUE,
&menuInfo);