- Allocate the MDI client context structure only once (and don't create a second one in WM_CREATE and leak the first one).

- Don't call SetScrollInfo with SB_BOTH.
- Don't add empty system icon to the client menu.

svn path=/trunk/; revision=11941
This commit is contained in:
Filip Navara 2004-12-05 03:50:47 +00:00
parent abd0ead395
commit bddec4f91a

View file

@ -1137,7 +1137,8 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
hSysMenuBitmap = hBmpClose;
#endif
if( !InsertMenuA(menu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP,
if( hSysMenuBitmap != NULL &&
!InsertMenuA(menu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP,
(UINT_PTR)hSysPopup, (LPSTR)hSysMenuBitmap))
{
TRACE("not inserted\n");
@ -1307,7 +1308,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
{
MDICLIENTINFO *ci = NULL;
if (WM_NCCREATE != message && WM_CREATE != message
if (WM_NCCREATE != message
&& NULL == (ci = get_client_info(hwnd)))
{
return 0;
@ -1332,12 +1333,6 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
#ifndef __REACTOS__
WND *wndPtr = WIN_GetPtr( hwnd );
#endif
ci = HeapAlloc(GetProcessHeap(), 0, sizeof(MDICLIENTINFO));
if (NULL == ci)
{
return -1;
}
SetWindowLongPtr(hwnd, 0, (LONG_PTR) ci);
/* Translation layer doesn't know what's in the cs->lpCreateParams
* so we have to keep track of what environment we're in. */
@ -2139,14 +2134,14 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
info.nMin = childRect.left;
info.nMax = childRect.right - clientRect.right;
info.nPos = clientRect.left - childRect.left;
SetScrollInfo(hwnd, scroll, &info, TRUE);
SetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
if (scroll == SB_HORZ) break;
/* fall through */
case SB_VERT:
info.nMin = childRect.top;
info.nMax = childRect.bottom - clientRect.bottom;
info.nPos = clientRect.top - childRect.top;
SetScrollInfo(hwnd, scroll, &info, TRUE);
SetScrollInfo(hwnd, SB_VERT, &info, TRUE);
break;
}
}