Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e9587399
Commit
e9587399
authored
Nov 04, 2019
by
Fabian Maurer
Committed by
Alexandre Julliard
Nov 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add combo tests for WM_CTLCOLOR*.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
89ef98ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
combo.c
dlls/comctl32/tests/combo.c
+98
-0
No files found.
dlls/comctl32/tests/combo.c
View file @
e9587399
...
...
@@ -46,6 +46,8 @@ static HWND hComboExParentWnd, hMainWnd;
static
HINSTANCE
hMainHinst
;
static
const
char
ComboExTestClass
[]
=
"ComboExTestClass"
;
static
HBRUSH
brush_red
;
static
BOOL
(
WINAPI
*
pSetWindowSubclass
)(
HWND
,
SUBCLASSPROC
,
UINT_PTR
,
DWORD_PTR
);
#define MAX_CHARS 100
...
...
@@ -507,6 +509,8 @@ static BOOL init(void)
wc
.
lpfnWndProc
=
ComboExTestWndProc
;
RegisterClassA
(
&
wc
);
brush_red
=
CreateSolidBrush
(
RGB
(
255
,
0
,
0
));
hMainWnd
=
CreateWindowA
(
WC_STATICA
,
"Test"
,
WS_OVERLAPPEDWINDOW
,
10
,
10
,
300
,
300
,
NULL
,
NULL
,
NULL
,
0
);
ShowWindow
(
hMainWnd
,
SW_SHOW
);
...
...
@@ -533,6 +537,7 @@ static void cleanup(void)
UnregisterClassA
(
ComboExTestClass
,
GetModuleHandleA
(
NULL
));
DestroyWindow
(
hMainWnd
);
DeleteObject
(
brush_red
);
}
static
void
test_comboex_subclass
(
void
)
...
...
@@ -717,6 +722,7 @@ static LRESULT (CALLBACK *old_parent_proc)(HWND hwnd, UINT msg, WPARAM wparam, L
static
LPCSTR
expected_edit_text
;
static
LPCSTR
expected_list_text
;
static
BOOL
selchange_fired
;
static
HWND
lparam_for_WM_CTLCOLOR
;
static
LRESULT
CALLBACK
parent_wnd_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
...
...
@@ -748,6 +754,20 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPAR
break
;
}
break
;
case
WM_CTLCOLOR
:
case
WM_CTLCOLORMSGBOX
:
case
WM_CTLCOLOREDIT
:
case
WM_CTLCOLORLISTBOX
:
case
WM_CTLCOLORBTN
:
case
WM_CTLCOLORDLG
:
case
WM_CTLCOLORSCROLLBAR
:
case
WM_CTLCOLORSTATIC
:
if
(
lparam_for_WM_CTLCOLOR
)
{
ok
(
lparam_for_WM_CTLCOLOR
==
(
HWND
)
lparam
,
"Expected %p, got %p
\n
"
,
lparam_for_WM_CTLCOLOR
,
(
HWND
)
lparam
);
return
(
LRESULT
)
brush_red
;
}
break
;
}
return
CallWindowProcA
(
old_parent_proc
,
hwnd
,
msg
,
wparam
,
lparam
);
...
...
@@ -1254,6 +1274,83 @@ static void test_combo_dropdown_size(DWORD style)
}
}
static
void
test_combo_ctlcolor
(
void
)
{
static
const
int
messages
[]
=
{
WM_CTLCOLOR
,
WM_CTLCOLORMSGBOX
,
WM_CTLCOLOREDIT
,
WM_CTLCOLORLISTBOX
,
WM_CTLCOLORBTN
,
WM_CTLCOLORDLG
,
WM_CTLCOLORSCROLLBAR
,
WM_CTLCOLORSTATIC
,
};
HBRUSH
brush
,
global_brush
;
COMBOBOXINFO
info
;
unsigned
int
i
;
HWND
combo
;
combo
=
create_combobox
(
CBS_DROPDOWN
);
ok
(
!!
combo
,
"Failed to create combo window.
\n
"
);
old_parent_proc
=
(
void
*
)
SetWindowLongPtrA
(
hMainWnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
parent_wnd_proc
);
get_combobox_info
(
combo
,
&
info
);
lparam_for_WM_CTLCOLOR
=
info
.
hwndItem
;
/* Parent returns valid brush handle. */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
messages
);
++
i
)
{
brush
=
(
HBRUSH
)
SendMessageA
(
combo
,
messages
[
i
],
0
,
(
LPARAM
)
info
.
hwndItem
);
todo_wine
ok
(
brush
==
brush_red
,
"%u: unexpected brush %p, expected got %p.
\n
"
,
i
,
brush
,
brush_red
);
}
/* Parent returns NULL brush. */
global_brush
=
brush_red
;
brush_red
=
NULL
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
messages
);
++
i
)
{
brush
=
(
HBRUSH
)
SendMessageA
(
combo
,
messages
[
i
],
0
,
(
LPARAM
)
info
.
hwndItem
);
todo_wine
ok
(
!
brush
,
"%u: unexpected brush %p.
\n
"
,
i
,
brush
);
}
brush_red
=
global_brush
;
lparam_for_WM_CTLCOLOR
=
0
;
/* Parent does default processing. */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
messages
);
++
i
)
{
brush
=
(
HBRUSH
)
SendMessageA
(
combo
,
messages
[
i
],
0
,
(
LPARAM
)
info
.
hwndItem
);
ok
(
!!
brush
&&
brush
!=
brush_red
,
"%u: unexpected brush %p.
\n
"
,
i
,
brush
);
}
SetWindowLongPtrA
(
hMainWnd
,
GWLP_WNDPROC
,
(
ULONG_PTR
)
old_parent_proc
);
DestroyWindow
(
combo
);
/* Combo without a parent. */
combo
=
CreateWindowA
(
WC_COMBOBOXA
,
"Combo"
,
CBS_DROPDOWN
,
5
,
5
,
100
,
100
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
!!
combo
,
"Failed to create combo window.
\n
"
);
get_combobox_info
(
combo
,
&
info
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
messages
);
++
i
)
{
brush
=
(
HBRUSH
)
SendMessageA
(
combo
,
messages
[
i
],
0
,
(
LPARAM
)
info
.
hwndItem
);
todo_wine
ok
(
!
brush
,
"%u: unexpected brush %p.
\n
"
,
i
,
brush
);
}
DestroyWindow
(
combo
);
}
START_TEST
(
combo
)
{
ULONG_PTR
ctx_cookie
;
...
...
@@ -1297,6 +1394,7 @@ START_TEST(combo)
test_combo_listbox_styles
(
CBS_DROPDOWNLIST
);
test_combo_dropdown_size
(
0
);
test_combo_dropdown_size
(
CBS_NOINTEGRALHEIGHT
);
test_combo_ctlcolor
();
cleanup
();
unload_v6_module
(
ctx_cookie
,
hCtx
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment