comctl32: Proper fix redrawing the trackbar background with themes enabled.
[wine] / dlls / comctl32 / tests / tooltips.c
1 /*
2  * Copyright 2005 Dmitry Timoshkov
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #include <assert.h>
20 #include <windows.h>
21 #include <commctrl.h>
22
23 #include "wine/test.h"
24
25 static void test_create_tooltip(void)
26 {
27     HWND parent, hwnd;
28     DWORD style, exp_style;
29
30     parent = CreateWindowEx(0, "static", NULL, WS_POPUP,
31                           0, 0, 0, 0,
32                           NULL, NULL, NULL, 0);
33     assert(parent);
34
35     hwnd = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, 0x7fffffff | WS_POPUP,
36                           10, 10, 300, 100,
37                           parent, NULL, NULL, 0);
38     assert(hwnd);
39
40     style = GetWindowLong(hwnd, GWL_STYLE);
41     trace("style = %08x\n", style);
42     exp_style = 0x7fffffff | WS_POPUP;
43     exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME);
44     ok(style == exp_style,"wrong style %08x/%08x\n", style, exp_style);
45
46     DestroyWindow(hwnd);
47
48     hwnd = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, 0,
49                           10, 10, 300, 100,
50                           parent, NULL, NULL, 0);
51     assert(hwnd);
52
53     style = GetWindowLong(hwnd, GWL_STYLE);
54     trace("style = %08x\n", style);
55     ok(style == (WS_POPUP | WS_CLIPSIBLINGS | WS_BORDER),
56        "wrong style %08x\n", style);
57
58     DestroyWindow(hwnd);
59
60     DestroyWindow(parent);
61 }
62
63 START_TEST(tooltips)
64 {
65     InitCommonControls();
66
67     test_create_tooltip();
68 }