Author: jimtabor
Date: Sat Aug 18 21:35:35 2012
New Revision: 57100
URL:
http://svn.reactos.org/svn/reactos?rev=57100&view=rev
Log:
[Win32SS]
- Do not register classes in case of errors at startup.
- Fix desktop background.
Modified:
trunk/reactos/win32ss/user/ntuser/class.c
trunk/reactos/win32ss/user/user32/windows/class.c
Modified: trunk/reactos/win32ss/user/ntuser/class.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/class.…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/class.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/class.c [iso-8859-1] Sat Aug 18 21:35:35 2012
@@ -13,10 +13,10 @@
{
{ ((PWSTR)((ULONG_PTR)(WORD)(0x8001))),
CS_GLOBALCLASS|CS_DBLCLKS,
- NULL,
- 0,
+ NULL, // Use User32 procs
+ sizeof(ULONG)*2,
(HICON)IDC_ARROW,
- (HBRUSH)(COLOR_BACKGROUND + 1),
+ (HBRUSH)(COLOR_BACKGROUND),
FNID_DESKTOP,
ICLS_DESKTOP
},
@@ -47,6 +47,17 @@
FNID_SCROLLBAR,
ICLS_SCROLLBAR
},
+#if 0
+ { ((PWSTR)((ULONG_PTR)(WORD)(0x8006))), // Tooltips
+ CS_PARENTDC|CS_DBLCLKS,
+ NULL, // Use User32 procs
+ 0,
+ (HICON)IDC_ARROW,
+ 0,
+ FNID_TOOLTIPS,
+ ICLS_TOOLTIPS
+ },
+#endif
{ ((PWSTR)((ULONG_PTR)(WORD)(0x8004))), // IconTitle is here for now...
0,
NULL, // Use User32 procs
@@ -1948,6 +1959,7 @@
WNDCLASSEXW wc;
PCLS Class;
BOOL Ret = TRUE;
+ HBRUSH hBrush;
DWORD Flags = 0;
if (ppi->W32PF_flags & W32PF_CLASSESREGISTERED)
@@ -1992,7 +2004,12 @@
wc.cbWndExtra = DefaultServerClasses[i].ExtraBytes;
wc.hIcon = NULL;
wc.hCursor = DefaultServerClasses[i].hCursor;
- wc.hbrBackground = DefaultServerClasses[i].hBrush;
+ hBrush = DefaultServerClasses[i].hBrush;
+ if (hBrush <= (HBRUSH)COLOR_MENUBAR)
+ {
+ hBrush = IntGetSysColorBrush((INT)hBrush);
+ }
+ wc.hbrBackground = hBrush;
wc.lpszMenuName = NULL;
wc.lpszClassName = ClassName.Buffer;
wc.hIconSm = NULL;
Modified: trunk/reactos/win32ss/user/user32/windows/class.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/class.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/class.c [iso-8859-1] Sat Aug 18 21:35:35
2012
@@ -210,24 +210,24 @@
return FALSE;
}
+ if (IS_ATOM(lpszClass))
+ {
+ ClassName.Buffer = (PWSTR)((ULONG_PTR)lpszClass);
+ }
+ else
+ {
+ if (!RtlCreateUnicodeStringFromAsciiz(&ClassName,
+ lpszClass))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
+ }
+
if (!RegisterDefaultClasses)
{
ERR("GetClassInfoExA RegisterSystemControls\n");
RegisterSystemControls();
- }
-
- if (IS_ATOM(lpszClass))
- {
- ClassName.Buffer = (PWSTR)((ULONG_PTR)lpszClass);
- }
- else
- {
- if (!RtlCreateUnicodeStringFromAsciiz(&ClassName,
- lpszClass))
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return FALSE;
- }
}
Ret = NtUserGetClassInfo(hInstance,
@@ -289,20 +289,20 @@
return FALSE;
}
+ if (IS_ATOM(lpszClass))
+ {
+ ClassName.Buffer = (PWSTR)((ULONG_PTR)lpszClass);
+ }
+ else
+ {
+ RtlInitUnicodeString(&ClassName,
+ lpszClass);
+ }
+
if (!RegisterDefaultClasses)
{
ERR("GetClassInfoExW RegisterSystemControls\n");
RegisterSystemControls();
- }
-
- if (IS_ATOM(lpszClass))
- {
- ClassName.Buffer = (PWSTR)((ULONG_PTR)lpszClass);
- }
- else
- {
- RtlInitUnicodeString(&ClassName,
- lpszClass);
}
Ret = NtUserGetClassInfo( hInstance,