mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Move hBmpClose to the MDICLIENTINFO structure and modified MDI_RestoreFrameMenu to support the change.
svn path=/trunk/; revision=22813
This commit is contained in:
parent
6d2332c2fb
commit
f985e4b908
1 changed files with 10 additions and 8 deletions
|
@ -110,14 +110,15 @@ typedef struct
|
||||||
UINT nTotalCreated;
|
UINT nTotalCreated;
|
||||||
UINT mdiFlags;
|
UINT mdiFlags;
|
||||||
UINT sbRecalc; /* SB_xxx flags for scrollbar fixup */
|
UINT sbRecalc; /* SB_xxx flags for scrollbar fixup */
|
||||||
|
HBITMAP hBmpClose; /* ReactOS modification */
|
||||||
} MDICLIENTINFO;
|
} MDICLIENTINFO;
|
||||||
|
|
||||||
static HBITMAP hBmpClose = 0;
|
//static HBITMAP hBmpClose = 0;
|
||||||
|
|
||||||
/* ----------------- declarations ----------------- */
|
/* ----------------- declarations ----------------- */
|
||||||
static void MDI_UpdateFrameText( HWND, HWND, LPCWSTR);
|
static void MDI_UpdateFrameText( HWND, HWND, LPCWSTR);
|
||||||
static BOOL MDI_AugmentFrameMenu( HWND, HWND );
|
static BOOL MDI_AugmentFrameMenu( HWND, HWND );
|
||||||
static BOOL MDI_RestoreFrameMenu( HWND, HWND );
|
static BOOL MDI_RestoreFrameMenu( HWND, HWND, HBITMAP );
|
||||||
static LONG MDI_ChildActivate( HWND, HWND );
|
static LONG MDI_ChildActivate( HWND, HWND );
|
||||||
static LRESULT MDI_RefreshMenu(MDICLIENTINFO *);
|
static LRESULT MDI_RefreshMenu(MDICLIENTINFO *);
|
||||||
|
|
||||||
|
@ -357,7 +358,7 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
|
||||||
if (hmenuFrame == ci->hFrameMenu) return (LRESULT)hmenuFrame;
|
if (hmenuFrame == ci->hFrameMenu) return (LRESULT)hmenuFrame;
|
||||||
|
|
||||||
if (IsZoomed(ci->hwndActiveChild))
|
if (IsZoomed(ci->hwndActiveChild))
|
||||||
MDI_RestoreFrameMenu( hwndFrame, ci->hwndActiveChild );
|
MDI_RestoreFrameMenu( hwndFrame, ci->hwndActiveChild, ci->hBmpClose );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( hmenuWindow && hmenuWindow != ci->hWindowMenu )
|
if( hmenuWindow && hmenuWindow != ci->hWindowMenu )
|
||||||
|
@ -588,7 +589,7 @@ static LRESULT MDIDestroyChild( HWND client, MDICLIENTINFO *ci,
|
||||||
ShowWindow(child, SW_HIDE);
|
ShowWindow(child, SW_HIDE);
|
||||||
if (IsZoomed(child))
|
if (IsZoomed(child))
|
||||||
{
|
{
|
||||||
MDI_RestoreFrameMenu(GetParent(client), child);
|
MDI_RestoreFrameMenu(GetParent(client), child, ci->hBmpClose);
|
||||||
MDI_UpdateFrameText(GetParent(client), client, NULL);
|
MDI_UpdateFrameText(GetParent(client), client, NULL);
|
||||||
}
|
}
|
||||||
MDI_ChildActivate(client, 0);
|
MDI_ChildActivate(client, 0);
|
||||||
|
@ -931,7 +932,7 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild )
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* MDI_RestoreFrameMenu
|
* MDI_RestoreFrameMenu
|
||||||
*/
|
*/
|
||||||
static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild )
|
static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild, HBITMAP hBmpClose )
|
||||||
{
|
{
|
||||||
MENUITEMINFOW menuInfo;
|
MENUITEMINFOW menuInfo;
|
||||||
HMENU menu = GetMenu( frame );
|
HMENU menu = GetMenu( frame );
|
||||||
|
@ -1077,6 +1078,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
|
||||||
if (!(ci = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ci))))
|
if (!(ci = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ci))))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
SetWindowLongPtrW( hwnd, 0, (LONG_PTR)ci );
|
SetWindowLongPtrW( hwnd, 0, (LONG_PTR)ci );
|
||||||
|
ci->hBmpClose = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1118,7 +1120,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
|
||||||
ci->mdiFlags = 0;
|
ci->mdiFlags = 0;
|
||||||
ci->hFrameMenu = GetMenu(cs->hwndParent);
|
ci->hFrameMenu = GetMenu(cs->hwndParent);
|
||||||
|
|
||||||
if (!hBmpClose) hBmpClose = CreateMDIMenuBitmap();
|
if (!ci->hBmpClose) ci->hBmpClose = CreateMDIMenuBitmap();
|
||||||
|
|
||||||
TRACE("Client created: hwnd %p, Window menu %p, idFirst = %04x\n",
|
TRACE("Client created: hwnd %p, Window menu %p, idFirst = %04x\n",
|
||||||
hwnd, ci->hWindowMenu, ci->idFirstChild );
|
hwnd, ci->hWindowMenu, ci->idFirstChild );
|
||||||
|
@ -1128,7 +1130,7 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
{
|
{
|
||||||
if( IsZoomed(ci->hwndActiveChild) )
|
if( IsZoomed(ci->hwndActiveChild) )
|
||||||
MDI_RestoreFrameMenu(GetParent(hwnd), ci->hwndActiveChild);
|
MDI_RestoreFrameMenu(GetParent(hwnd), ci->hwndActiveChild, ci->hBmpClose);
|
||||||
|
|
||||||
ci->nActiveChildren = 0;
|
ci->nActiveChildren = 0;
|
||||||
MDI_RefreshMenu(ci);
|
MDI_RefreshMenu(ci);
|
||||||
|
@ -1588,7 +1590,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
|
||||||
MDI_AugmentFrameMenu( GetParent(client), hwnd );
|
MDI_AugmentFrameMenu( GetParent(client), hwnd );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
MDI_RestoreFrameMenu( GetParent(client), hwnd );
|
MDI_RestoreFrameMenu( GetParent(client), hwnd , ci->hBmpClose);
|
||||||
}
|
}
|
||||||
|
|
||||||
MDI_UpdateFrameText( GetParent(client), client, NULL );
|
MDI_UpdateFrameText( GetParent(client), client, NULL );
|
||||||
|
|
Loading…
Reference in a new issue