fixed the hMenu parameter in CreateWindowEx so that this parameter changes the child windows' ID

svn path=/trunk/; revision=6060
This commit is contained in:
Thomas Bluemel 2003-09-13 13:58:38 +00:00
parent 5d3579faab
commit 9b298429d8
7 changed files with 21 additions and 27 deletions

View file

@ -1,4 +1,4 @@
/* $Id: scrollbar.c,v 1.15 2003/09/12 12:54:26 weiden Exp $
/* $Id: scrollbar.c,v 1.16 2003/09/13 13:58:38 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -453,7 +453,7 @@ GetScrollInfo (HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
SCROLLINFO si;
if(!lpsi ||
((lpsi->cbSize != sizeof(SCROLLINFO)) && (lpsi->cbSize != sizeof(SCROLLINFO))))
((lpsi->cbSize != sizeof(SCROLLINFO)) && (lpsi->cbSize != sizeof(SCROLLINFO) - sizeof(si.nTrackPos))))
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
@ -529,7 +529,8 @@ SetScrollInfo (HWND hwnd, int fnBar, LPCSCROLLINFO lpsi, WINBOOL fRedraw)
{
SCROLLINFO si;
if(!lpsi)
if(!lpsi ||
((lpsi->cbSize != sizeof(SCROLLINFO)) && (lpsi->cbSize != sizeof(SCROLLINFO) - sizeof(si.nTrackPos))))
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;

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: messagebox.c,v 1.17 2003/08/30 18:38:08 weiden Exp $
/* $Id: messagebox.c,v 1.18 2003/09/13 13:58:38 weiden Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/messagebox.c
@ -76,13 +76,8 @@ typedef UINT *LPUINT;
static HWND MSGBOX_CreateButton(HWND hwnd, LONG ID, LPWSTR Caption)
{
HWND btn = CreateWindowExW(0, L"BUTTON", Caption, WS_CHILD | WS_TABSTOP | WS_VISIBLE,
0, 0, 10, 10, hwnd, 0, 0, NULL);
if(btn)
{
SetWindowLongW(btn, GWL_ID, ID);
}
return btn;
return CreateWindowExW(0, L"BUTTON", Caption, WS_CHILD | WS_TABSTOP | WS_VISIBLE,
0, 0, 10, 10, hwnd, (HMENU)ID, 0, NULL);
}
static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMS lpmb)

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.71 2003/08/28 13:38:23 gvg Exp $
/* $Id: window.c,v 1.72 2003/09/13 13:58:38 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -567,7 +567,7 @@ CreateWindowExA(DWORD dwExStyle,
}
}
if(!hMenu)
if(!hMenu && (dwStyle & (WS_OVERLAPPEDWINDOW | WS_POPUP)))
{
wce.cbSize = sizeof(WNDCLASSEXA);
if(GetClassInfoExA(hInstance, lpClassName, &wce) && wce.lpszMenuName)
@ -697,7 +697,7 @@ CreateWindowExW(DWORD dwExStyle,
}
}
if(!hMenu)
if(!hMenu && (dwStyle & (WS_OVERLAPPEDWINDOW | WS_POPUP)))
{
wce.cbSize = sizeof(WNDCLASSEXW);
if(GetClassInfoExW(hInstance, lpClassName, &wce) && wce.lpszMenuName)

View file

@ -41,8 +41,6 @@ typedef struct _WINDOW_OBJECT
DWORD ContextHelpId;
/* Parent window handle. */
HWND ParentHandle;
/* Window menu handle. */
HMENU Menu;
/* system menu handle. */
HMENU SystemMenu;
/* Handle of the module that created the window. */
@ -63,7 +61,7 @@ typedef struct _WINDOW_OBJECT
HANDLE Self;
/* Window flags. */
ULONG Flags;
/* FIXME: Don't know. */
/* Window menu handle or window id */
UINT IDMenu;
/* Handle of region of the window to be updated. */
HANDLE UpdateRegion;

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: menu.c,v 1.29 2003/08/28 10:39:44 weiden Exp $
/* $Id: menu.c,v 1.30 2003/09/13 13:58:38 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -1341,7 +1341,7 @@ NtUserHiliteMenuItem(
SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
return res;
}
if(WindowObject->Menu == hmenu)
if(WindowObject->IDMenu == (UINT)hmenu)
{
ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
res = IntHiliteMenuItem(WindowObject, MenuObject, uItemHilite, uHilite);

View file

@ -1,4 +1,4 @@
/* $Id: misc.c,v 1.16 2003/09/12 12:54:26 weiden Exp $
/* $Id: misc.c,v 1.17 2003/09/13 13:58:38 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -68,7 +68,7 @@ NtUserCallOneParam(
return FALSE;
}
Result = (DWORD)WindowObject->Menu;
Result = (DWORD)WindowObject->IDMenu;
IntReleaseWindowObject(WindowObject);
return Result;

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.107 2003/09/07 09:55:52 weiden Exp $
/* $Id: window.c,v 1.108 2003/09/13 13:58:38 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -325,7 +325,7 @@ IntCreateDesktopWindow(PWINSTATION_OBJECT WindowStation,
WindowObject->Height = Height;
WindowObject->ParentHandle = NULL;
WindowObject->Parent = NULL;
WindowObject->Menu = NULL;
WindowObject->IDMenu = 0;
WindowObject->Instance = NULL;
WindowObject->Parameters = NULL;
WindowObject->Self = Handle;
@ -754,7 +754,7 @@ IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
if (!(Wnd->Style & WS_CHILD))
{
//if ( Wnd->Menu ) DestroyMenu ( Wnd->menu );
Wnd->Menu = NULL;
Wnd->IDMenu = 0;
}
}
}
@ -1180,7 +1180,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
WindowObject->Height = nHeight;
WindowObject->ContextHelpId = 0;
WindowObject->ParentHandle = hWndParent;
WindowObject->Menu = hMenu;
WindowObject->IDMenu = (UINT)hMenu;
if(SystemMenu)
WindowObject->SystemMenu = SystemMenu->Self;
else
@ -2596,14 +2596,14 @@ NtUserSetMenu(
return FALSE;
}
WindowObject->Menu = hMenu;
WindowObject->IDMenu = (UINT)hMenu;
IntReleaseMenuObject(MenuObject);
}
else
{
/* remove the menu handle */
WindowObject->Menu = 0;
WindowObject->IDMenu = 0;
}
IntReleaseWindowObject(WindowObject);