Commit 0f2f1958 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

comctl32/tests: Fix a treeview test failure when theming is on.

parent 8f6a4438
......@@ -27,12 +27,17 @@
#include "winuser.h"
#include "winnls.h"
#include "winreg.h"
#include "commctrl.h"
#include "commctrl.h"
#include "uxtheme.h"
#include "vsstyle.h"
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
static HTHEME (WINAPI *pGetWindowTheme)(HWND);
static BOOL (WINAPI *pIsThemeBackgroundPartiallyTransparent)(HTHEME, int, int);
static BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
static const char *TEST_CALLBACK_TEXT = "callback_text";
......@@ -2121,6 +2126,8 @@ static void test_TVS_SINGLEEXPAND(void)
static void test_WM_PAINT(void)
{
BOOL is_glyph_transparent;
HTHEME htheme;
HWND hTree;
COLORREF clr;
LONG ret;
......@@ -2144,7 +2151,11 @@ static void test_WM_PAINT(void)
ok(ret == 0, "got %d\n", ret);
clr = GetPixel(hdc, 1, 1);
ok(clr == RGB(255, 0, 0) || broken(clr == RGB(0, 0, 0)) /* win98 */,
htheme = pGetWindowTheme(hTree);
is_glyph_transparent = htheme && pIsThemeBackgroundPartiallyTransparent(htheme, TVP_GLYPH, 0);
ok(clr == RGB(255, 0, 0) || broken(clr == RGB(0, 0, 0)) /* win98 */
/* When theming is on and treeview glyphs are transparent, parent window needs to be repainted */
|| (is_glyph_transparent && clr == GetSysColor(COLOR_WINDOW)),
"got 0x%x\n", clr);
ReleaseDC(hMainWnd, hdc);
......@@ -2945,9 +2956,13 @@ static void test_right_click(void)
static void init_functions(void)
{
HMODULE hComCtl32 = LoadLibraryA("comctl32.dll");
HMODULE hUxtheme = LoadLibraryA("uxtheme.dll");
#define X(module, f) p##f = (void*)GetProcAddress(module, #f);
X(hComCtl32, InitCommonControlsEx);
#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
X(InitCommonControlsEx);
X(hUxtheme, GetWindowTheme);
X(hUxtheme, IsThemeBackgroundPartiallyTransparent);
#undef X
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment