Commit c448c5cf authored by Matthew Cline's avatar Matthew Cline Committed by Alexandre Julliard

Check that ci->hWindowMenu is not zero before using it.

parent 53ec9f32
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
* Copyright 1994, Bob Amstadt * Copyright 1994, Bob Amstadt
* 1995,1996 Alex Korobka * 1995,1996 Alex Korobka
* *
* This file contains routines to support MDI features. * This file contains routines to support MDI (Multiple Document
* Interface) features .
* *
* Notes: Fairly complete implementation. Any volunteers for * Notes: Fairly complete implementation. Any volunteers for
* "More windows..." stuff? * "More windows..." stuff?
...@@ -342,6 +343,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent, ...@@ -342,6 +343,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent,
} }
/* this menu is needed to set a check mark in MDI_ChildActivate */ /* this menu is needed to set a check mark in MDI_ChildActivate */
if (ci->hWindowMenu != 0)
AppendMenuA(ci->hWindowMenu ,MF_STRING ,wIDmenu, lpstrDef ); AppendMenuA(ci->hWindowMenu ,MF_STRING ,wIDmenu, lpstrDef );
ci->nActiveChildren++; ci->nActiveChildren++;
...@@ -1116,6 +1118,7 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam, ...@@ -1116,6 +1118,7 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
} }
MDI_UpdateFrameText(frameWnd, hwnd, MDI_NOFRAMEREPAINT,frameWnd->text); MDI_UpdateFrameText(frameWnd, hwnd, MDI_NOFRAMEREPAINT,frameWnd->text);
if (ci->hWindowMenu != 0)
AppendMenuA( ci->hWindowMenu, MF_SEPARATOR, 0, NULL ); AppendMenuA( ci->hWindowMenu, MF_SEPARATOR, 0, NULL );
GetClientRect(frameWnd->hwndSelf, &rect); GetClientRect(frameWnd->hwndSelf, &rect);
...@@ -1131,7 +1134,8 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam, ...@@ -1131,7 +1134,8 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
case WM_DESTROY: case WM_DESTROY:
if( ci->hwndChildMaximized ) if( ci->hwndChildMaximized )
MDI_RestoreFrameMenu(w->parent, ci->hwndChildMaximized); MDI_RestoreFrameMenu(w->parent, ci->hwndChildMaximized);
if((nItems = GetMenuItemCount(ci->hWindowMenu)) > 0) if((ci->hWindowMenu != 0) &&
(nItems = GetMenuItemCount(ci->hWindowMenu)) > 0)
{ {
ci->idFirstChild = nItems - 1; ci->idFirstChild = nItems - 1;
ci->nActiveChildren++; /* to delete a separator */ ci->nActiveChildren++; /* to delete a separator */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment