comctl32/treeview: Do not draw client edge without WS_EX_CLIENTEDGE.

Fix foobar2000 having an extra edge around tree view non-client size box.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2022-02-10 14:57:29 +08:00 committed by Alexandre Julliard
parent 19a77a8b6a
commit 8ce869f40b
1 changed files with 10 additions and 3 deletions

View File

@ -5498,18 +5498,25 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam)
/* Draw themed border */
static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM lParam)
{
HTHEME theme = GetWindowTheme (infoPtr->hwnd);
int cxEdge, cyEdge;
LONG ex_style;
HTHEME theme;
HDC dc;
RECT r;
HRGN cliprgn;
int cxEdge = GetSystemMetrics (SM_CXEDGE),
cyEdge = GetSystemMetrics (SM_CYEDGE);
ex_style = GetWindowLongW(infoPtr->hwnd, GWL_EXSTYLE);
if (!(ex_style & WS_EX_CLIENTEDGE))
return DefWindowProcW(infoPtr->hwnd, WM_NCPAINT, (WPARAM)region, lParam);
theme = GetWindowTheme(infoPtr->hwnd);
if (!theme)
return DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)region, lParam);
GetWindowRect(infoPtr->hwnd, &r);
cxEdge = GetSystemMetrics(SM_CXEDGE);
cyEdge = GetSystemMetrics(SM_CYEDGE);
cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge,
r.right - cxEdge, r.bottom - cyEdge);
if (region != (HRGN)1)