From 45bee9d135f0b766ab4bd1ecdaa3cdfe8a810444 Mon Sep 17 00:00:00 2001 From: YX Hao Date: Tue, 13 Feb 2024 11:55:30 +0800 Subject: [PATCH] fix item width for AutoSizeAllColumns excluding the vertical scroll bar --- src/SearchDlg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SearchDlg.cpp b/src/SearchDlg.cpp index 844f84a6..06fad869 100644 --- a/src/SearchDlg.cpp +++ b/src/SearchDlg.cpp @@ -4525,7 +4525,8 @@ void CSearchDlg::AutoSizeAllColumns() { RECT rc{}; ListView_GetItemRect(hListControl, 0, &rc, LVIR_BOUNDS); - auto itemWidth = rc.right - rc.left; + int cxVScroll = GetSystemMetrics(SM_CXVSCROLL); + auto itemWidth = rc.right - rc.left - cxVScroll; if (nItemCount > 0) { GetClientRect(hListControl, &rc);