From 15082cc9fc91e231810c0b0b5efa0c9f2c8f35b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 28 May 2016 16:59:55 +0000 Subject: [PATCH] [SHELL32]: Always paint the desktop listview transparent. This allows explorer to display the default desktop background color set by win32k as well as the ReactOS version on the desktop. See also r66271 and r66752. svn path=/trunk/; revision=71441 --- reactos/dll/win32/shell32/CDefView.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/shell32/CDefView.cpp b/reactos/dll/win32/shell32/CDefView.cpp index 9780c11da18..1cbc191d587 100644 --- a/reactos/dll/win32/shell32/CDefView.cpp +++ b/reactos/dll/win32/shell32/CDefView.cpp @@ -582,20 +582,27 @@ void CDefView::UpdateListColors() DWORD cbDropShadow = sizeof(bDropShadow); WCHAR wszBuf[16] = L""; + /* + * The desktop ListView always take the default desktop colours, by + * remaining transparent and letting user32/win32k paint itself the + * desktop background color, if any. + */ + m_ListView.SetBkColor(CLR_NONE); + RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"ListviewShadow", RRF_RT_DWORD, NULL, &bDropShadow, &cbDropShadow); if (bDropShadow && SystemParametersInfoW(SPI_GETDESKWALLPAPER, _countof(wszBuf), wszBuf, 0) && wszBuf[0]) { + /* Set the icon background transparent */ m_ListView.SetTextBkColor(CLR_NONE); - m_ListView.SetBkColor(CLR_NONE); m_ListView.SetTextColor(RGB(255, 255, 255)); m_ListView.SetExtendedListViewStyle(LVS_EX_TRANSPARENTSHADOWTEXT, LVS_EX_TRANSPARENTSHADOWTEXT); } else { + /* Set the icon background as the same colour as the desktop */ COLORREF crDesktop = GetSysColor(COLOR_DESKTOP); m_ListView.SetTextBkColor(crDesktop); - m_ListView.SetBkColor(crDesktop); if (GetRValue(crDesktop) + GetGValue(crDesktop) + GetBValue(crDesktop) > 128 * 3) m_ListView.SetTextColor(RGB(0, 0, 0)); else