Author: mjansen
Date: Sun Dec 4 16:52:22 2016
New Revision: 73424
URL:
http://svn.reactos.org/svn/reactos?rev=73424&view=rev
Log:
[DESK] Fix theme preview for Win7. Patch by Carlo Bramini. CORE-10076 #resolve #comment
Thanks!
Modified:
trunk/reactos/dll/cpl/desk/theme.c
Modified: trunk/reactos/dll/cpl/desk/theme.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/theme.c?rev=7…
==============================================================================
--- trunk/reactos/dll/cpl/desk/theme.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/theme.c [iso-8859-1] Sun Dec 4 16:52:22 2016
@@ -124,6 +124,9 @@
INT i, Result;
HKEY hKey;
BOOL ret;
+#if (WINVER >= 0x0600)
+ OSVERSIONINFO osvi;
+#endif
/* Load colors */
for (i = 0; i < NUM_COLORS; i++)
@@ -133,6 +136,20 @@
/* Load non client metrics */
scheme->ncMetrics.cbSize = sizeof(NONCLIENTMETRICSW);
+
+#if (WINVER >= 0x0600)
+ /* Size of NONCLIENTMETRICSA/W depends on current version of the OS.
+ * see:
+ *
https://msdn.microsoft.com/en-us/library/windows/desktop/ff729175%28v=vs.85…
+ */
+ if (GetVersionEx(&osvi))
+ {
+ /* Windows XP and earlier */
+ if (osvi.dwMajorVersion <= 5)
+ scheme->ncMetrics.cbSize -=
sizeof(scheme->ncMetrics.iPaddedBorderWidth);
+ }
+#endif
+
ret = SystemParametersInfoW(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICSW),
&scheme->ncMetrics,