mirror of
https://github.com/reactos/reactos.git
synced 2024-08-04 18:40:59 +00:00
work on system menus
svn path=/trunk/; revision=5729
This commit is contained in:
parent
2a0a6362e3
commit
6a048dddff
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: menu.c,v 1.24 2003/08/21 20:29:43 weiden Exp $
|
/* $Id: menu.c,v 1.25 2003/08/21 21:52:06 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -289,16 +289,16 @@ BOOL FASTCALL
|
||||||
IntCloneMenuItems(PMENU_OBJECT Destination, PMENU_OBJECT Source)
|
IntCloneMenuItems(PMENU_OBJECT Destination, PMENU_OBJECT Source)
|
||||||
{
|
{
|
||||||
PMENU_ITEM MenuItem, NewMenuItem, Old = NULL;
|
PMENU_ITEM MenuItem, NewMenuItem, Old = NULL;
|
||||||
DbgPrint("IntCloneMenuItems(1) = %d\n", Source->MenuItemCount);
|
|
||||||
if(!Source->MenuItemCount)
|
if(!Source->MenuItemCount)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
DbgPrint("IntCloneMenuItems(2)\n");
|
|
||||||
ExAcquireFastMutexUnsafe(&Destination->MenuItemsLock);
|
ExAcquireFastMutexUnsafe(&Destination->MenuItemsLock);
|
||||||
ExAcquireFastMutexUnsafe(&Source->MenuItemsLock);
|
ExAcquireFastMutexUnsafe(&Source->MenuItemsLock);
|
||||||
DbgPrint("IntCloneMenuItems(3)\n");
|
|
||||||
MenuItem = Source->MenuItemList;
|
MenuItem = Source->MenuItemList;
|
||||||
while(MenuItem)
|
while(MenuItem)
|
||||||
{DbgPrint("IntCloneMenuItems(%d)\n", Source->MenuItemCount + 1);
|
{
|
||||||
Old = NewMenuItem;
|
Old = NewMenuItem;
|
||||||
NewMenuItem = ExAllocatePool(PagedPool, sizeof(MENU_ITEM));
|
NewMenuItem = ExAllocatePool(PagedPool, sizeof(MENU_ITEM));
|
||||||
if(!NewMenuItem)
|
if(!NewMenuItem)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: window.c,v 1.100 2003/08/21 20:29:44 weiden Exp $
|
/* $Id: window.c,v 1.101 2003/08/21 21:52:06 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -302,11 +302,11 @@ IntReleaseWindowObject(PWINDOW_OBJECT Window)
|
||||||
}
|
}
|
||||||
|
|
||||||
HMENU FASTCALL
|
HMENU FASTCALL
|
||||||
IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert)
|
IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert, BOOL RetMenu)
|
||||||
{
|
{
|
||||||
PMENU_OBJECT MenuObject, NewMenuObject;
|
PMENU_OBJECT MenuObject, NewMenuObject;
|
||||||
PW32PROCESS W32Process;
|
PW32PROCESS W32Process;
|
||||||
HMENU NewMenu;
|
HMENU NewMenu, ret = (HMENU)0;
|
||||||
|
|
||||||
if(bRevert)
|
if(bRevert)
|
||||||
{
|
{
|
||||||
|
@ -336,6 +336,7 @@ IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert)
|
||||||
{
|
{
|
||||||
WindowObject->SystemMenu = NewMenuObject->Self;
|
WindowObject->SystemMenu = NewMenuObject->Self;
|
||||||
NewMenuObject->IsSystemMenu = TRUE;
|
NewMenuObject->IsSystemMenu = TRUE;
|
||||||
|
ret = NewMenuObject->Self;
|
||||||
IntReleaseMenuObject(NewMenuObject);
|
IntReleaseMenuObject(NewMenuObject);
|
||||||
}
|
}
|
||||||
IntReleaseMenuObject(MenuObject);
|
IntReleaseMenuObject(MenuObject);
|
||||||
|
@ -354,11 +355,15 @@ IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert)
|
||||||
{
|
{
|
||||||
WindowObject->SystemMenu = NewMenuObject->Self;
|
WindowObject->SystemMenu = NewMenuObject->Self;
|
||||||
NewMenuObject->IsSystemMenu = TRUE;
|
NewMenuObject->IsSystemMenu = TRUE;
|
||||||
|
ret = NewMenuObject->Self;
|
||||||
IntReleaseMenuObject(NewMenuObject);
|
IntReleaseMenuObject(NewMenuObject);
|
||||||
}
|
}
|
||||||
IntDestroyMenuObject(MenuObject, FALSE, TRUE);
|
IntDestroyMenuObject(MenuObject, FALSE, TRUE);
|
||||||
}
|
}
|
||||||
return (HMENU)0;
|
if(RetMenu)
|
||||||
|
return ret;
|
||||||
|
else
|
||||||
|
return (HMENU)0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -766,7 +771,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
WindowObject->Style = dwStyle & ~WS_VISIBLE;
|
WindowObject->Style = dwStyle & ~WS_VISIBLE;
|
||||||
DbgPrint("1: Style is now %d\n", WindowObject->Style);
|
DbgPrint("1: Style is now %d\n", WindowObject->Style);
|
||||||
|
|
||||||
SystemMenu = IntGetSystemMenu(WindowObject, TRUE);
|
SystemMenu = IntGetSystemMenu(WindowObject, TRUE, TRUE);
|
||||||
|
|
||||||
WindowObject->x = x;
|
WindowObject->x = x;
|
||||||
WindowObject->y = y;
|
WindowObject->y = y;
|
||||||
|
@ -1012,6 +1017,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
DbgPrint("Setting Active Window to %d\n\n\n",WindowObject->Self);
|
DbgPrint("Setting Active Window to %d\n\n\n",WindowObject->Self);
|
||||||
NtUserSetActiveWindow(WindowObject->Self);
|
NtUserSetActiveWindow(WindowObject->Self);
|
||||||
DPRINT("NtUserCreateWindow(): = %X\n", Handle);
|
DPRINT("NtUserCreateWindow(): = %X\n", Handle);
|
||||||
|
DbgPrint("WindowObject->SystemMenu = 0x%x\n", WindowObject->SystemMenu);
|
||||||
return((HWND)Handle);
|
return((HWND)Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2687,7 +2693,7 @@ NtUserGetSystemMenu(
|
||||||
return (HMENU)0;
|
return (HMENU)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = IntGetSystemMenu(WindowObject, bRevert);
|
res = IntGetSystemMenu(WindowObject, bRevert, FALSE);
|
||||||
|
|
||||||
IntReleaseWindowObject(WindowObject);
|
IntReleaseWindowObject(WindowObject);
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in a new issue