mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
- Reclaculate window client size in NtUserSetMenu even if the window isn't visible
- Properly move child windows in NtUserSetWindowPos. svn path=/trunk/; revision=8089
This commit is contained in:
parent
7715328fc5
commit
af3e717b32
2 changed files with 46 additions and 47 deletions
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: window.c,v 1.181 2004/02/04 23:01:07 gvg Exp $
|
||||
/* $Id: window.c,v 1.182 2004/02/08 10:53:17 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -1405,7 +1405,6 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
|||
MaxPos.x - WindowObject->WindowRect.left,
|
||||
MaxPos.y - WindowObject->WindowRect.top);
|
||||
|
||||
|
||||
if (NULL != ParentWindow)
|
||||
{
|
||||
/* link the window into the parent's child list */
|
||||
|
@ -3039,52 +3038,53 @@ NtUserSetLogonNotifyWindow(DWORD Unknown0)
|
|||
*/
|
||||
BOOL STDCALL
|
||||
NtUserSetMenu(
|
||||
HWND hWnd,
|
||||
HMENU hMenu,
|
||||
BOOL bRepaint)
|
||||
HWND hWnd,
|
||||
HMENU hMenu,
|
||||
BOOL bRepaint)
|
||||
{
|
||||
PWINDOW_OBJECT WindowObject;
|
||||
PMENU_OBJECT MenuObject;
|
||||
BOOL Changed = FALSE;
|
||||
WindowObject = IntGetWindowObject((HWND)hWnd);
|
||||
if(!WindowObject)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
PWINDOW_OBJECT WindowObject;
|
||||
PMENU_OBJECT MenuObject;
|
||||
BOOL Changed = FALSE;
|
||||
|
||||
if(hMenu)
|
||||
{
|
||||
/* assign new menu handle */
|
||||
MenuObject = IntGetMenuObject((HWND)hMenu);
|
||||
if(!MenuObject)
|
||||
{
|
||||
IntReleaseWindowObject(WindowObject);
|
||||
SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
|
||||
WindowObject = IntGetWindowObject((HWND)hWnd);
|
||||
if (!WindowObject)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
Changed = (WindowObject->IDMenu != (UINT)hMenu);
|
||||
WindowObject->IDMenu = (UINT)hMenu;
|
||||
if (hMenu)
|
||||
{
|
||||
/* assign new menu handle */
|
||||
MenuObject = IntGetMenuObject((HWND)hMenu);
|
||||
if (!MenuObject)
|
||||
{
|
||||
IntReleaseWindowObject(WindowObject);
|
||||
SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
IntReleaseMenuObject(MenuObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* remove the menu handle */
|
||||
Changed = (WindowObject->IDMenu != 0);
|
||||
WindowObject->IDMenu = 0;
|
||||
}
|
||||
Changed = (WindowObject->IDMenu != (UINT)hMenu);
|
||||
WindowObject->IDMenu = (UINT)hMenu;
|
||||
|
||||
IntReleaseWindowObject(WindowObject);
|
||||
IntReleaseMenuObject(MenuObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* remove the menu handle */
|
||||
Changed = (WindowObject->IDMenu != 0);
|
||||
WindowObject->IDMenu = 0;
|
||||
}
|
||||
|
||||
if(Changed && bRepaint && IntIsWindowVisible(hWnd))
|
||||
{
|
||||
WinPosSetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
|
||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||
}
|
||||
IntReleaseWindowObject(WindowObject);
|
||||
|
||||
return TRUE;
|
||||
if (Changed && bRepaint)
|
||||
{
|
||||
WinPosSetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
|
||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: winpos.c,v 1.87 2004/02/04 22:59:04 gvg Exp $
|
||||
/* $Id: winpos.c,v 1.88 2004/02/08 10:53:17 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -849,13 +849,12 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
|||
|
||||
/* FIXME: Actually do something with WVR_VALIDRECTS */
|
||||
|
||||
if (! (WinPos.flags & SWP_NOMOVE)
|
||||
&& (NewWindowRect.left != OldWindowRect.left
|
||||
|| NewWindowRect.top != OldWindowRect.top))
|
||||
if (NewClientRect.left != OldClientRect.left ||
|
||||
NewClientRect.top != OldClientRect.top)
|
||||
{
|
||||
WinPosInternalMoveWindow(Window,
|
||||
NewWindowRect.left - OldWindowRect.left,
|
||||
NewWindowRect.top - OldWindowRect.top);
|
||||
NewClientRect.left - OldClientRect.left,
|
||||
NewClientRect.top - OldClientRect.top);
|
||||
}
|
||||
|
||||
Window->WindowRect = NewWindowRect;
|
||||
|
|
Loading…
Reference in a new issue