some more work on system menus

svn path=/trunk/; revision=5723
This commit is contained in:
Thomas Bluemel 2003-08-21 16:04:26 +00:00
parent f7b82c11f2
commit 6d6caffd7d
5 changed files with 46 additions and 23 deletions

View file

@ -177,6 +177,7 @@ NtUserCallOneParam(
#define TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW 0x56
#define TWOPARAM_ROUTINE_VALIDATERGN 0x57
#define TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID 0x58
#define TWOPARAM_ROUTINE_SETWINSTASYSMENU 0x59
DWORD
STDCALL
NtUserCallTwoParam(

View file

@ -1,4 +1,4 @@
/* $Id: winsta.c,v 1.9 2003/08/07 04:03:24 royce Exp $
/* $Id: winsta.c,v 1.10 2003/08/21 16:04:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -67,13 +67,29 @@ CreateWindowStationW(LPWSTR lpwinsta,
ACCESS_MASK dwDesiredAccess,
LPSECURITY_ATTRIBUTES lpsa)
{
HWINSTA res;
UNICODE_STRING WindowStationName;
HMENU SysMenuTemplate;
HMODULE hUser32;
RtlInitUnicodeString(&WindowStationName, lpwinsta);
return NtUserCreateWindowStation(&WindowStationName,
res = NtUserCreateWindowStation(&WindowStationName,
dwDesiredAccess,
lpsa, 0, 0, 0);
hUser32 = GetModuleHandleW(L"user32.dll");
SysMenuTemplate = LoadMenuW(hUser32, L"SYSMENU");
if(SysMenuTemplate)
{
NtUserCallTwoParam((DWORD)res, (DWORD)SysMenuTemplate,
TWOPARAM_ROUTINE_SETWINSTASYSMENU);
/* we don't need the menu anymore, it's been cloned */
DestroyMenu(SysMenuTemplate);
}
return res;
}

View file

@ -85,15 +85,18 @@ EDITMENU MENU LOADONCALL MOVEABLE DISCARDABLE
SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
MENUITEM "&Restore", 61728
MENUITEM "&Move", 61456
MENUITEM "&Size", 61440
MENUITEM "Mi&nimize", 61472
MENUITEM "Ma&ximize", 61488
MENUITEM SEPARATOR
MENUITEM "&Close\tAlt-F4", 61536
POPUP ""
BEGIN
MENUITEM "&Restore", 61728
MENUITEM "&Move", 61456
MENUITEM "&Size", 61440
MENUITEM "Mi&nimize", 61472
MENUITEM "Ma&ximize", 61488
MENUITEM SEPARATOR
MENUITEM "&Close\tAlt-F4", 61536
// MENUITEM SEPARATOR
// MENUITEM "&Switch to ...\tCtrl-Esc", 61744
// MENUITEM SEPARATOR
// MENUITEM "&About ReactOS ...", 61761
END
}

View file

@ -1,4 +1,4 @@
/* $Id: misc.c,v 1.7 2003/08/19 11:48:49 weiden Exp $
/* $Id: misc.c,v 1.8 2003/08/21 16:04:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -130,13 +130,19 @@ NtUserCallTwoParam(
if(!WindowObject)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
return (DWORD)FALSE;
}
WindowObject->ContextHelpId = Param2;
IntReleaseWindowObject(WindowObject);
return TRUE;
return (DWORD)TRUE;
case TWOPARAM_ROUTINE_SETWINSTASYSMENU:
if(!Param1 || !Param2)
return (DWORD)FALSE;
/* FIXME clone menu and assign it to the window station */
return (DWORD)TRUE;
}
DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam()\n Param1=0x%x Parm2=0x%x\n",

View file

@ -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.98 2003/08/21 15:26:19 weiden Exp $
/* $Id: window.c,v 1.99 2003/08/21 16:04:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -304,7 +304,7 @@ IntReleaseWindowObject(PWINDOW_OBJECT Window)
HMENU FASTCALL
IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert)
{
PMENU_OBJECT MenuObject;
PMENU_OBJECT MenuObject, NewMenuObject;
PW32PROCESS W32Process;
if(bRevert)
@ -325,18 +325,15 @@ IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert)
if(!MenuObject)
return (HMENU)0;
MenuObject = IntCloneMenu(MenuObject);
if(MenuObject)
NewMenuObject = IntCloneMenu(MenuObject);
if(NewMenuObject)
{
WindowObject->SystemMenu = MenuObject->Self;
MenuObject->IsSystemMenu = TRUE;
WindowObject->SystemMenu = NewMenuObject->Self;
NewMenuObject->IsSystemMenu = TRUE;
IntReleaseMenuObject(NewMenuObject);
}
IntReleaseMenuObject(MenuObject);
}
/* FIXME Load system menu here?
else
{
}*/
return (HMENU)0;
}
else