fix bug 838 (Sol.exe is missing it's menubar)
Modified: trunk/reactos/include/win32k/ntuser.h
Modified: trunk/reactos/lib/user32/controls/regcontrol.c
Modified: trunk/reactos/lib/user32/windows/class.c
Modified: trunk/reactos/subsys/win32k/include/class.h
Modified: trunk/reactos/subsys/win32k/ntuser/class.c
Modified: trunk/reactos/subsys/win32k/ntuser/window.c
Modified: trunk/reactos/tools/nci/w32ksvc.db
_____
Modified: trunk/reactos/include/win32k/ntuser.h
--- trunk/reactos/include/win32k/ntuser.h 2005-11-23 04:31:58 UTC
(rev 19479)
+++ trunk/reactos/include/win32k/ntuser.h 2005-11-23 06:00:41 UTC
(rev 19480)
@@ -1170,7 +1170,8 @@
PUNICODE_STRING MenuName,
WNDPROC wpExtra,
DWORD Flags,
- DWORD Unknown7);
+ DWORD Unknown7,
+ HMENU hMenu);
BOOL
STDCALL
_____
Modified: trunk/reactos/lib/user32/controls/regcontrol.c
--- trunk/reactos/lib/user32/controls/regcontrol.c 2005-11-23
04:31:58 UTC (rev 19479)
+++ trunk/reactos/lib/user32/controls/regcontrol.c 2005-11-23
06:00:41 UTC (rev 19480)
@@ -51,6 +51,7 @@
&MenuName,
Descr->procA,
REGISTERCLASS_SYSTEM,
+ 0,
0);
}
_____
Modified: trunk/reactos/lib/user32/windows/class.c
--- trunk/reactos/lib/user32/windows/class.c 2005-11-23 04:31:58 UTC
(rev 19479)
+++ trunk/reactos/lib/user32/windows/class.c 2005-11-23 06:00:41 UTC
(rev 19480)
@@ -574,8 +574,9 @@
WNDCLASSEXA WndClass;
UNICODE_STRING ClassName;
UNICODE_STRING MenuName;
+ HMENU hMenu;
- if (lpwcx == NULL || lpwcx->cbSize != sizeof(WNDCLASSEXW) ||
+ if (lpwcx == NULL || lpwcx->cbSize != sizeof(WNDCLASSEXA) ||
lpwcx->cbClsExtra < 0 || lpwcx->cbWndExtra < 0 ||
lpwcx->lpszClassName == NULL)
{
@@ -601,31 +602,34 @@
if (lpwcx->hInstance == NULL)
((WNDCLASSEXA*)lpwcx)->hInstance = GetModuleHandleW(NULL);
- RtlCopyMemory(&WndClass, lpwcx, sizeof(WNDCLASSEXW));
+ RtlCopyMemory(&WndClass, lpwcx, sizeof(WNDCLASSEXA));
if (NULL == WndClass.hIconSm)
{
WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon);
}
- if (IS_ATOM(lpwcx->lpszMenuName) || lpwcx->lpszMenuName == 0)
+ if HIWORD(lpwcx->lpszMenuName)
{
+ hMenu = 0;
+ RtlCreateUnicodeStringFromAsciiz(&MenuName,
WndClass.lpszMenuName);
+ }
+ else
+ {
MenuName.Length =
MenuName.MaximumLength = 0;
- MenuName.Buffer = (LPWSTR)lpwcx->lpszMenuName;
- } else
- {
- RtlCreateUnicodeStringFromAsciiz(&MenuName, lpwcx->lpszMenuName);
+ MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName;
+ hMenu = LoadMenuA(WndClass.hInstance, lpwcx->lpszMenuName);
}
-
- if (IS_ATOM(lpwcx->lpszClassName))
+
+ if (IS_ATOM(WndClass.lpszClassName))
{
ClassName.Length =
ClassName.MaximumLength = 0;
- ClassName.Buffer = (LPWSTR)lpwcx->lpszClassName;
+ ClassName.Buffer = (LPWSTR)WndClass.lpszClassName;
} else
{
- RtlCreateUnicodeStringFromAsciiz(&ClassName,
lpwcx->lpszClassName);
+ RtlCreateUnicodeStringFromAsciiz(&ClassName,
WndClass.lpszClassName);
}
Atom = NtUserRegisterClassExWOW(
@@ -635,11 +639,12 @@
&MenuName,
NULL,
REGISTERCLASS_ANSI,
- 0);
+ 0,
+ hMenu);
- if (!IS_ATOM(lpwcx->lpszMenuName))
+ if (!IS_ATOM(WndClass.lpszMenuName))
RtlFreeUnicodeString(&MenuName);
- if (!IS_ATOM(lpwcx->lpszClassName))
+ if (!IS_ATOM(WndClass.lpszClassName))
RtlFreeUnicodeString(&ClassName);
return (ATOM)Atom;
@@ -654,6 +659,7 @@
WNDCLASSEXW WndClass;
UNICODE_STRING ClassName;
UNICODE_STRING MenuName;
+ HMENU hMenu;
if (lpwcx == NULL || lpwcx->cbSize != sizeof(WNDCLASSEXW) ||
lpwcx->cbClsExtra < 0 || lpwcx->cbWndExtra < 0 ||
@@ -688,24 +694,27 @@
WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon);
}
- if (IS_ATOM(lpwcx->lpszMenuName))
+ if HIWORD(lpwcx->lpszMenuName)
{
+ hMenu = 0;
+ RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName);
+ }
+ else
+ {
MenuName.Length =
MenuName.MaximumLength = 0;
- MenuName.Buffer = (LPWSTR)lpwcx->lpszMenuName;
- } else
- {
- RtlInitUnicodeString(&MenuName, lpwcx->lpszMenuName);
+ MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName;
+ hMenu = LoadMenuW(WndClass.hInstance, lpwcx->lpszMenuName);
}
- if (IS_ATOM(lpwcx->lpszClassName))
+ if (IS_ATOM(WndClass.lpszClassName))
{
ClassName.Length =
ClassName.MaximumLength = 0;
- ClassName.Buffer = (LPWSTR)lpwcx->lpszClassName;
+ ClassName.Buffer = (LPWSTR)WndClass.lpszClassName;
} else
{
- RtlInitUnicodeString(&ClassName, lpwcx->lpszClassName);
+ RtlInitUnicodeString(&ClassName, WndClass.lpszClassName);
}
return (ATOM)NtUserRegisterClassExWOW(
@@ -715,7 +724,8 @@
&MenuName,
NULL,
0,
- 0);
+ 0,
+ hMenu);
}
/*
_____
Modified: trunk/reactos/subsys/win32k/include/class.h
--- trunk/reactos/subsys/win32k/include/class.h 2005-11-23 04:31:58 UTC
(rev 19479)
+++ trunk/reactos/subsys/win32k/include/class.h 2005-11-23 06:00:41 UTC
(rev 19480)
@@ -17,6 +17,7 @@
HICON hIcon;
HCURSOR hCursor;
HBRUSH hbrBackground;
+ HMENU hMenu;
UNICODE_STRING lpszMenuName;
RTL_ATOM Atom;
HICON hIconSm;
_____
Modified: trunk/reactos/subsys/win32k/ntuser/class.c
--- trunk/reactos/subsys/win32k/ntuser/class.c 2005-11-23 04:31:58 UTC
(rev 19479)
+++ trunk/reactos/subsys/win32k/ntuser/class.c 2005-11-23 06:00:41 UTC
(rev 19480)
@@ -69,6 +69,8 @@
ASSERT(Class->refs == 0);
RemoveEntryList(&Class->ListEntry);
+ if (Class->hMenu)
+ UserDestroyMenu(Class->hMenu);
RtlDeleteAtomFromAtomTable(gAtomTable, Class->Atom);
ExFreePool(Class);
}
@@ -149,7 +151,8 @@
DWORD Flags,
WNDPROC wpExtra,
PUNICODE_STRING MenuName,
- RTL_ATOM Atom)
+ RTL_ATOM Atom,
+ HMENU hMenu)
{
PWNDCLASS_OBJECT Class;
ULONG objectSize;
@@ -188,6 +191,7 @@
Class->hInstance = lpwcx->hInstance;
Class->hIcon = lpwcx->hIcon;
Class->hCursor = lpwcx->hCursor;
+ Class->hMenu = hMenu;
Class->hbrBackground = lpwcx->hbrBackground;
Class->Unicode = !(Flags & REGISTERCLASS_ANSI);
Class->Global = Global;
@@ -414,7 +418,8 @@
PUNICODE_STRING MenuName,
WNDPROC wpExtra,
DWORD Flags,
- DWORD Unknown7)
+ DWORD Unknown7,
+ HMENU hMenu)
/*
* FUNCTION:
@@ -495,7 +500,7 @@
RETURN(0);
}
- if (!IntRegisterClass(&SafeClass, Flags, wpExtra, MenuName, Atom))
+ if (!IntRegisterClass(&SafeClass, Flags, wpExtra, MenuName, Atom,
hMenu))
{
if (ClassName->Length)
{
_____
Modified: trunk/reactos/subsys/win32k/ntuser/window.c
--- trunk/reactos/subsys/win32k/ntuser/window.c 2005-11-23 04:31:58 UTC
(rev 19479)
+++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-11-23 06:00:41 UTC
(rev 19480)
@@ -1462,6 +1462,10 @@
Window->IDMenu = 0;
Window->Instance = hInstance;
Window->hSelf = hWnd;
+
+ if (!hMenu)
+ hMenu = Class->hMenu;
+
if (0 != (dwStyle & WS_CHILD))
{
Window->IDMenu = (UINT) hMenu;
_____
Modified: trunk/reactos/tools/nci/w32ksvc.db
--- trunk/reactos/tools/nci/w32ksvc.db 2005-11-23 04:31:58 UTC (rev
19479)
+++ trunk/reactos/tools/nci/w32ksvc.db 2005-11-23 06:00:41 UTC (rev
19480)
@@ -458,7 +458,7 @@
NtUserReleaseDC 2
NtUserRealChildWindowFromPoint 3
NtUserRedrawWindow 4
-NtUserRegisterClassExWOW 7
+NtUserRegisterClassExWOW 8
NtUserRegisterHotKey 4
NtUserRegisterTasklist 1
NtUserRegisterWindowMessage 1