}
// DesktopHeapFree(Wnd->head.rpdesk, Wnd);
-// WindowObject->Wnd = NULL;
+// WindowObject->hWnd = NULL;
}
/***********************************************************************
HWND *Children;
HWND *ChildHandle;
PWND Child;
- PMENU_OBJECT Menu;
+ PMENU Menu;
BOOLEAN BelongsToThreadData;
ASSERT(Window);
HMENU Menu,
BOOL *Changed)
{
- PMENU_OBJECT OldMenu, NewMenu = NULL;
+ PMENU OldMenu, NewMenu = NULL;
if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
if (Wnd->IDMenu)
{
OldMenu = IntGetMenuObject((HMENU) Wnd->IDMenu);
- ASSERT(NULL == OldMenu || OldMenu->MenuInfo.Wnd == Wnd->head.h);
+ ASSERT(NULL == OldMenu || OldMenu->hWnd == Wnd->head.h);
}
else
{
EngSetLastError(ERROR_INVALID_MENU_HANDLE);
return FALSE;
}
- if (NULL != NewMenu->MenuInfo.Wnd)
+ if (NULL != NewMenu->hWnd)
{
/* Can't use the same menu for two windows */
if (NULL != OldMenu)
Wnd->IDMenu = (UINT) Menu;
if (NULL != NewMenu)
{
- NewMenu->MenuInfo.Wnd = Wnd->head.h;
+ NewMenu->hWnd = Wnd->head.h;
IntReleaseMenuObject(NewMenu);
}
if (NULL != OldMenu)
{
- OldMenu->MenuInfo.Wnd = NULL;
+ OldMenu->hWnd = NULL;
IntReleaseMenuObject(OldMenu);
}
}
}
-PMENU_OBJECT FASTCALL
+PMENU FASTCALL
IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
{
- PMENU_OBJECT Menu, NewMenu = NULL, SysMenu = NULL, ret = NULL;
+ PMENU Menu, NewMenu = NULL, SysMenu = NULL, ret = NULL;
PTHREADINFO W32Thread;
HMENU hNewMenu, hSysMenu;
- ROSMENUITEMINFO ItemInfo;
+ ROSMENUITEMINFO ItemInfo = {0};
if(bRevert)
{
NewMenu = IntCloneMenu(Menu);
if(NewMenu)
- {
- Window->SystemMenu = NewMenu->MenuInfo.Self;
- NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN;
- NewMenu->MenuInfo.Wnd = Window->head.h;
+ { // Use spmenuSys
+ Window->SystemMenu = NewMenu->head.h;
+ NewMenu->fFlags |= MNF_SYSDESKMN;
+ NewMenu->hWnd = Window->head.h;
ret = NewMenu;
//IntReleaseMenuObject(NewMenu);
}
UserDestroyMenu(hSysMenu);
return NULL;
}
- SysMenu->MenuInfo.Flags |= MNF_SYSDESKMN;
- SysMenu->MenuInfo.Wnd = Window->head.h;
+ SysMenu->fFlags |= MNF_SYSDESKMN;
+ SysMenu->hWnd = Window->head.h;
hNewMenu = co_IntLoadSysMenuTemplate();
+ //if ( Window->ExStyle & WS_EX_MDICHILD )
+ //hNewMenu = co_IntCallLoadMenu( NULL, L"SYSMENUMDI");
+ // else
+ //hNewMenu = co_IntCallLoadMenu( NULL, L"SYSMENU");
+ // Do the rest in here.
if(!hNewMenu)
{
IntReleaseMenuObject(SysMenu);
NewMenu = IntCloneMenu(Menu);
if(NewMenu)
{
- NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN | MNF_POPUP;
- NewMenu->MenuInfo.dwStyle = MNS_CHECKORBMP;
+ NewMenu->fFlags |= MNF_SYSDESKMN | MNF_POPUP;
+ // Do not set MNS_CHECKORBMP it breaks menus, also original code destroyed the style anyway.
IntReleaseMenuObject(NewMenu);
UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE);
+ if (Window->pcls->style & CS_NOCLOSE)
+ IntRemoveMenuItem(NewMenu, SC_CLOSE, MF_BYCOMMAND, TRUE);
+
ItemInfo.cbSize = sizeof(MENUITEMINFOW);
ItemInfo.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_STATE | MIIM_SUBMENU;
ItemInfo.fType = 0;
ItemInfo.fState = MFS_ENABLED;
ItemInfo.dwTypeData = NULL;
ItemInfo.cch = 0;
- ItemInfo.hSubMenu = NewMenu->MenuInfo.Self;
- IntInsertMenuItem(SysMenu, (UINT) -1, TRUE, &ItemInfo);
+ ItemInfo.hSubMenu = NewMenu->head.h;
+ IntInsertMenuItem(SysMenu, (UINT) -1, TRUE, &ItemInfo, NULL);
- Window->SystemMenu = SysMenu->MenuInfo.Self;
+ Window->SystemMenu = SysMenu->head.h;
ret = SysMenu;
}
co_WinPosSetWindowPos( Wnd,
(0 == (Wnd->ExStyle & WS_EX_TOPMOST) ? HWND_TOP : HWND_TOPMOST),
pt.x, pt.y, 0, 0, swFlags);
- //ERR("IntSetParent SetWindowPos 2\n");
+ //ERR("IntSetParent SetWindowPos 2 X %d Y %d\n",pt.x, pt.y);
if (WasVisible) co_WinPosShowWindow(Wnd, SW_SHOWNORMAL);
return WndOldParent;
}
BOOL FASTCALL
-IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu)
+IntSetSystemMenu(PWND Window, PMENU Menu)
{
- PMENU_OBJECT OldMenu;
+ PMENU OldMenu;
if(Window->SystemMenu)
{
OldMenu = IntGetMenuObject(Window->SystemMenu);
if(OldMenu)
{
- OldMenu->MenuInfo.Flags &= ~ MNF_SYSDESKMN;
+ OldMenu->fFlags &= ~ MNF_SYSDESKMN;
IntReleaseMenuObject(OldMenu);
}
}
if(Menu)
{
/* FIXME: Check window style, propably return FALSE? */
- Window->SystemMenu = Menu->MenuInfo.Self;
- Menu->MenuInfo.Flags |= MNF_SYSDESKMN;
+ Window->SystemMenu = Menu->head.h;
+ Menu->fFlags |= MNF_SYSDESKMN;
}
- else
+ else // Use spmenuSys too!
Window->SystemMenu = (HMENU)0;
return TRUE;
/* Allocates and initializes a window */
PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
- PLARGE_STRING WindowName,
- PCLS Class,
- PWND ParentWindow,
- PWND OwnerWindow,
- PVOID acbiBuffer,
- PDESKTOP pdeskCreated)
+ PLARGE_STRING WindowName,
+ PCLS Class,
+ PWND ParentWindow,
+ PWND OwnerWindow,
+ PVOID acbiBuffer,
+ PDESKTOP pdeskCreated)
{
PWND pWnd = NULL;
HWND hWnd;
PTHREADINFO pti = NULL;
- PMENU_OBJECT SystemMenu;
+ PMENU SystemMenu;
BOOL MenuChanged;
BOOL bUnicodeWindow;
pti = pdeskCreated ? gptiDesktopThread : GetW32ThreadInfo();
if (!(Cs->dwExStyle & WS_EX_LAYOUTRTL))
- {
- if (ParentWindow)
+ { // Need both here for wine win.c test_CreateWindow.
+ //if (Cs->hwndParent && ParentWindow)
+ if (ParentWindow) // It breaks more tests..... WIP.
{
if ( (Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD &&
ParentWindow->ExStyle & WS_EX_LAYOUTRTL &&
*/
if ( Class->fnid != FNID_DIALOG )
{
- ERR("No parent and not a dialog Fix HACK\n");
if (pti->ppi->dwLayout & LAYOUT_RTL)
{
Cs->dwExStyle |= WS_EX_LAYOUTRTL;
{
SystemMenu = IntGetSystemMenu(pWnd, TRUE, TRUE);
if(SystemMenu)
- {
- pWnd->SystemMenu = SystemMenu->MenuInfo.Self;
+ { // spmenuSys
+ pWnd->SystemMenu = SystemMenu->head.h;
IntReleaseMenuObject(SystemMenu);
}
}
}
/* Now find the parent and the owner window */
- ///////////////
- // FIXME!!!! Breaks wine win.c test_CreateWindow line 5470!
hWndParent = pti->rpdesk->pDeskInfo->spwnd->head.h;
- ///////////////
hWndOwner = NULL;
if (Cs->hwndParent == HWND_MESSAGE)
NtUserGetSystemMenu(HWND hWnd, BOOL bRevert)
{
PWND Window;
- PMENU_OBJECT Menu;
+ PMENU Menu;
DECLARE_RETURN(HMENU);
TRACE("Enter NtUserGetSystemMenu\n");
RETURN(NULL);
}
- RETURN(Menu->MenuInfo.Self);
+ RETURN(Menu->head.h);
CLEANUP:
TRACE("Leave NtUserGetSystemMenu, ret=%p\n", _ret_);
{
BOOL Result = FALSE;
PWND Window;
- PMENU_OBJECT Menu;
+ PMENU Menu;
DECLARE_RETURN(BOOL);
TRACE("Enter NtUserSetSystemMenu\n");