https://git.reactos.org/?p=reactos.git;a=commitdiff;h=75c0dc0cd850a50341317…
commit 75c0dc0cd850a503413175d24fab3b23c1360ec0
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Mar 15 09:31:15 2025 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Mar 15 09:31:15 2025 +0900
[EXPLORER][COMCTL32][SHELL32] Enable SPI_SETICONTITLELOGFONT (#7783)
Enable desktop icon title font setting.
JIRA issue: CORE-13601
- Forward WM_SETTINGCHANGE message up to
ListView.
- ListView accepts WM_SETTINGCHANGE message.
- Enable icon spacing.
---
base/shell/explorer/traywnd.cpp | 3 +++
dll/win32/comctl32/listview.c | 29 +++++++++++++++++++++++++++++
dll/win32/shell32/CDefView.cpp | 1 +
3 files changed, 33 insertions(+)
diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp
index f853609077f..d5695c7411c 100644
--- a/base/shell/explorer/traywnd.cpp
+++ b/base/shell/explorer/traywnd.cpp
@@ -2454,6 +2454,9 @@ ChangePos:
CheckTrayWndPosition();
}
+ if (m_DesktopWnd)
+ ::SendMessageW(m_DesktopWnd, uMsg, wParam, lParam);
+
if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam,
L"TraySettings") == 0)
{
HideStartMenu();
diff --git a/dll/win32/comctl32/listview.c b/dll/win32/comctl32/listview.c
index eb165e835c4..f50e32847fb 100644
--- a/dll/win32/comctl32/listview.c
+++ b/dll/win32/comctl32/listview.c
@@ -12001,7 +12001,36 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
}
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
+#ifdef __REACTOS__
+ case WM_SETTINGCHANGE: /* Same as WM_WININICHANGE */
+ if (wParam == SPI_SETICONMETRICS ||
+ wParam == SPI_SETICONTITLELOGFONT ||
+ wParam == SPI_SETNONCLIENTMETRICS ||
+ (!wParam && !lParam))
+ {
+ BOOL bDefaultOrNullFont = (infoPtr->hDefaultFont == infoPtr->hFont ||
!infoPtr->hFont);
+ LOGFONTW logFont;
+ SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
+
+ if (infoPtr->autoSpacing)
+ LISTVIEW_SetIconSpacing(infoPtr, -1, -1);
+
+ if (infoPtr->hDefaultFont)
+ DeleteObject(infoPtr->hDefaultFont);
+ infoPtr->hDefaultFont = CreateFontIndirectW(&logFont);
+
+ if (bDefaultOrNullFont)
+ infoPtr->hFont = infoPtr->hDefaultFont;
+
+ LISTVIEW_SaveTextMetrics(infoPtr);
+ LISTVIEW_UpdateItemSize(infoPtr);
+ LISTVIEW_UpdateScroll(infoPtr);
+ LISTVIEW_InvalidateRect(infoPtr, NULL);
+ }
+ return 0;
+#else
/* case WM_WININICHANGE: */
+#endif
default:
if ((uMsg >= WM_USER) && (uMsg < WM_APP) &&
!COMCTL32_IsReflectedMessage(uMsg))
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 46322dfec26..60301182694 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -3008,6 +3008,7 @@ LRESULT CDefView::OnSettingChange(UINT uMsg, WPARAM wParam, LPARAM
lParam, BOOL
if (wParam == SPI_SETDESKWALLPAPER || wParam == 0)
UpdateListColors();
+ m_ListView.SendMessage(uMsg, wParam, lParam);
return S_OK;
}