mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 22:46:43 +00:00
- 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:
parent
abd0ead395
commit
bddec4f91a
1 changed files with 5 additions and 10 deletions
|
@ -1137,7 +1137,8 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
|
||||||
hSysMenuBitmap = hBmpClose;
|
hSysMenuBitmap = hBmpClose;
|
||||||
#endif
|
#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))
|
(UINT_PTR)hSysPopup, (LPSTR)hSysMenuBitmap))
|
||||||
{
|
{
|
||||||
TRACE("not inserted\n");
|
TRACE("not inserted\n");
|
||||||
|
@ -1307,7 +1308,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
|
||||||
{
|
{
|
||||||
MDICLIENTINFO *ci = NULL;
|
MDICLIENTINFO *ci = NULL;
|
||||||
|
|
||||||
if (WM_NCCREATE != message && WM_CREATE != message
|
if (WM_NCCREATE != message
|
||||||
&& NULL == (ci = get_client_info(hwnd)))
|
&& NULL == (ci = get_client_info(hwnd)))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1332,12 +1333,6 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
WND *wndPtr = WIN_GetPtr( hwnd );
|
WND *wndPtr = WIN_GetPtr( hwnd );
|
||||||
#endif
|
#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
|
/* Translation layer doesn't know what's in the cs->lpCreateParams
|
||||||
* so we have to keep track of what environment we're in. */
|
* 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.nMin = childRect.left;
|
||||||
info.nMax = childRect.right - clientRect.right;
|
info.nMax = childRect.right - clientRect.right;
|
||||||
info.nPos = clientRect.left - childRect.left;
|
info.nPos = clientRect.left - childRect.left;
|
||||||
SetScrollInfo(hwnd, scroll, &info, TRUE);
|
SetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
|
||||||
if (scroll == SB_HORZ) break;
|
if (scroll == SB_HORZ) break;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case SB_VERT:
|
case SB_VERT:
|
||||||
info.nMin = childRect.top;
|
info.nMin = childRect.top;
|
||||||
info.nMax = childRect.bottom - clientRect.bottom;
|
info.nMax = childRect.bottom - clientRect.bottom;
|
||||||
info.nPos = clientRect.top - childRect.top;
|
info.nPos = clientRect.top - childRect.top;
|
||||||
SetScrollInfo(hwnd, scroll, &info, TRUE);
|
SetScrollInfo(hwnd, SB_VERT, &info, TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue