mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 18:24:24 +00:00
fix bug 838 (Sol.exe is missing it's menubar)
svn path=/trunk/; revision=19480
This commit is contained in:
parent
348e9f5f3d
commit
7588129e24
|
@ -1170,7 +1170,8 @@ NtUserRegisterClassExWOW(
|
|||
PUNICODE_STRING MenuName,
|
||||
WNDPROC wpExtra,
|
||||
DWORD Flags,
|
||||
DWORD Unknown7);
|
||||
DWORD Unknown7,
|
||||
HMENU hMenu);
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
|
|
|
@ -51,6 +51,7 @@ static void RegisterBuiltinClass(const struct builtin_class_descr *Descr)
|
|||
&MenuName,
|
||||
Descr->procA,
|
||||
REGISTERCLASS_SYSTEM,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
|
||||
|
|
|
@ -574,8 +574,9 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
|
|||
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 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
|
|||
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 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
|
|||
&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 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
|
|||
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 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
|
|||
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 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
|
|||
&MenuName,
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
0,
|
||||
hMenu);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -17,6 +17,7 @@ typedef struct _WNDCLASS_OBJECT
|
|||
HICON hIcon;
|
||||
HCURSOR hCursor;
|
||||
HBRUSH hbrBackground;
|
||||
HMENU hMenu;
|
||||
UNICODE_STRING lpszMenuName;
|
||||
RTL_ATOM Atom;
|
||||
HICON hIconSm;
|
||||
|
|
|
@ -69,6 +69,8 @@ VOID FASTCALL DestroyClass(PWNDCLASS_OBJECT Class)
|
|||
ASSERT(Class->refs == 0);
|
||||
|
||||
RemoveEntryList(&Class->ListEntry);
|
||||
if (Class->hMenu)
|
||||
UserDestroyMenu(Class->hMenu);
|
||||
RtlDeleteAtomFromAtomTable(gAtomTable, Class->Atom);
|
||||
ExFreePool(Class);
|
||||
}
|
||||
|
@ -149,7 +151,8 @@ IntRegisterClass(
|
|||
DWORD Flags,
|
||||
WNDPROC wpExtra,
|
||||
PUNICODE_STRING MenuName,
|
||||
RTL_ATOM Atom)
|
||||
RTL_ATOM Atom,
|
||||
HMENU hMenu)
|
||||
{
|
||||
PWNDCLASS_OBJECT Class;
|
||||
ULONG objectSize;
|
||||
|
@ -188,6 +191,7 @@ IntRegisterClass(
|
|||
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 @@ NtUserRegisterClassExWOW(
|
|||
PUNICODE_STRING MenuName,
|
||||
WNDPROC wpExtra,
|
||||
DWORD Flags,
|
||||
DWORD Unknown7)
|
||||
DWORD Unknown7,
|
||||
HMENU hMenu)
|
||||
|
||||
/*
|
||||
* FUNCTION:
|
||||
|
@ -495,7 +500,7 @@ NtUserRegisterClassExWOW(
|
|||
RETURN(0);
|
||||
}
|
||||
|
||||
if (!IntRegisterClass(&SafeClass, Flags, wpExtra, MenuName, Atom))
|
||||
if (!IntRegisterClass(&SafeClass, Flags, wpExtra, MenuName, Atom, hMenu))
|
||||
{
|
||||
if (ClassName->Length)
|
||||
{
|
||||
|
|
|
@ -1462,6 +1462,10 @@ co_IntCreateWindowEx(DWORD dwExStyle,
|
|||
Window->IDMenu = 0;
|
||||
Window->Instance = hInstance;
|
||||
Window->hSelf = hWnd;
|
||||
|
||||
if (!hMenu)
|
||||
hMenu = Class->hMenu;
|
||||
|
||||
if (0 != (dwStyle & WS_CHILD))
|
||||
{
|
||||
Window->IDMenu = (UINT) hMenu;
|
||||
|
|
|
@ -458,7 +458,7 @@ NtUserQueryWindow 2
|
|||
NtUserReleaseDC 2
|
||||
NtUserRealChildWindowFromPoint 3
|
||||
NtUserRedrawWindow 4
|
||||
NtUserRegisterClassExWOW 7
|
||||
NtUserRegisterClassExWOW 8
|
||||
NtUserRegisterHotKey 4
|
||||
NtUserRegisterTasklist 1
|
||||
NtUserRegisterWindowMessage 1
|
||||
|
|
Loading…
Reference in a new issue