Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
231199bc
Commit
231199bc
authored
Mar 14, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Mar 17, 2023
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/treeview: Ignore the lParam to WM_PRINTCLIENT and add tests.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54640
parent
446da60e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
9 deletions
+63
-9
treeview.c
dlls/comctl32/tests/treeview.c
+61
-0
treeview.c
dlls/comctl32/treeview.c
+2
-9
No files found.
dlls/comctl32/tests/treeview.c
View file @
231199bc
...
@@ -2181,6 +2181,66 @@ static void test_WM_PAINT(void)
...
@@ -2181,6 +2181,66 @@ static void test_WM_PAINT(void)
DestroyWindow
(
hTree
);
DestroyWindow
(
hTree
);
}
}
static
void
test_WM_PRINTCLIENT
(
void
)
{
static
const
LPARAM
params
[]
=
{
0
,
PRF_CHECKVISIBLE
,
PRF_NONCLIENT
,
PRF_CLIENT
,
PRF_ERASEBKGND
,
PRF_CHILDREN
,
PRF_OWNED
};
BOOL
glyph_is_transparent
;
HTHEME
hTheme
;
HWND
hTree
;
COLORREF
clr
;
LONG
ret
;
RECT
rc
;
HDC
hdc
;
int
i
;
hTree
=
create_treeview_control
(
0
);
clr
=
SendMessageA
(
hTree
,
TVM_SETBKCOLOR
,
0
,
RGB
(
255
,
0
,
0
));
ok
(
clr
==
CLR_NONE
,
"got 0x%lx, expected 0x%lx
\n
"
,
clr
,
CLR_NONE
);
hdc
=
GetDC
(
hMainWnd
);
GetClientRect
(
hMainWnd
,
&
rc
);
hTheme
=
pGetWindowTheme
(
hTree
);
glyph_is_transparent
=
hTheme
&&
pIsThemeBackgroundPartiallyTransparent
(
hTheme
,
TVP_GLYPH
,
0
);
/* test parameters when the treeview is visible */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
params
);
i
++
)
{
winetest_push_context
(
"lParam=0x%Ix"
,
params
[
i
]);
FillRect
(
hdc
,
&
rc
,
GetStockObject
(
BLACK_BRUSH
));
clr
=
GetPixel
(
hdc
,
1
,
1
);
ok
(
clr
==
RGB
(
0
,
0
,
0
),
"got 0x%lx
\n
"
,
clr
);
ret
=
SendMessageA
(
hTree
,
WM_PRINTCLIENT
,
(
WPARAM
)
hdc
,
params
[
i
]);
ok
(
ret
==
0
,
"got %ld
\n
"
,
ret
);
clr
=
GetPixel
(
hdc
,
1
,
1
);
ok
(
clr
==
RGB
(
255
,
0
,
0
)
||
(
glyph_is_transparent
&&
clr
==
GetSysColor
(
COLOR_WINDOW
)),
"got 0x%lx
\n
"
,
clr
);
winetest_pop_context
();
}
/* test parameters when the treeview is hidden */
ShowWindow
(
hTree
,
SW_HIDE
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
params
);
i
++
)
{
winetest_push_context
(
"lParam=0x%Ix"
,
params
[
i
]);
FillRect
(
hdc
,
&
rc
,
GetStockObject
(
BLACK_BRUSH
));
clr
=
GetPixel
(
hdc
,
1
,
1
);
ok
(
clr
==
RGB
(
0
,
0
,
0
),
"got 0x%lx
\n
"
,
clr
);
ret
=
SendMessageA
(
hTree
,
WM_PRINTCLIENT
,
(
WPARAM
)
hdc
,
params
[
i
]);
ok
(
ret
==
0
,
"got %ld
\n
"
,
ret
);
clr
=
GetPixel
(
hdc
,
1
,
1
);
ok
(
clr
==
RGB
(
255
,
0
,
0
)
||
(
glyph_is_transparent
&&
clr
==
GetSysColor
(
COLOR_WINDOW
)),
"got 0x%lx
\n
"
,
clr
);
winetest_pop_context
();
}
ShowWindow
(
hTree
,
SW_SHOW
);
ReleaseDC
(
hMainWnd
,
hdc
);
DestroyWindow
(
hTree
);
}
static
void
test_delete_items
(
void
)
static
void
test_delete_items
(
void
)
{
{
const
struct
message
*
msg
;
const
struct
message
*
msg
;
...
@@ -3042,6 +3102,7 @@ START_TEST(treeview)
...
@@ -3042,6 +3102,7 @@ START_TEST(treeview)
test_expandnotify
();
test_expandnotify
();
test_TVS_SINGLEEXPAND
();
test_TVS_SINGLEEXPAND
();
test_WM_PAINT
();
test_WM_PAINT
();
test_WM_PRINTCLIENT
();
test_delete_items
();
test_delete_items
();
test_cchildren
();
test_cchildren
();
test_htreeitem_layout
(
FALSE
);
test_htreeitem_layout
(
FALSE
);
...
...
dlls/comctl32/treeview.c
View file @
231199bc
...
@@ -3114,20 +3114,13 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, HDC hdc_ref)
...
@@ -3114,20 +3114,13 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, HDC hdc_ref)
static
LRESULT
static
LRESULT
TREEVIEW_PrintClient
(
TREEVIEW_INFO
*
infoPtr
,
HDC
hdc
,
DWORD
options
)
TREEVIEW_PrintClient
(
TREEVIEW_INFO
*
infoPtr
,
HDC
hdc
,
DWORD
options
)
{
{
FIXME
(
"Partial Stub: (hdc=%p options=%#lx)
\n
"
,
hdc
,
options
)
;
RECT
rc
;
if
((
options
&
PRF_CHECKVISIBLE
)
&&
!
IsWindowVisible
(
infoPtr
->
hwnd
))
FIXME
(
"Partial Stub: (hdc=%p options=%#lx)
\n
"
,
hdc
,
options
);
return
0
;
if
(
options
&
PRF_ERASEBKGND
)
TREEVIEW_EraseBackground
(
infoPtr
,
hdc
);
TREEVIEW_EraseBackground
(
infoPtr
,
hdc
);
if
(
options
&
PRF_CLIENT
)
{
RECT
rc
;
GetClientRect
(
infoPtr
->
hwnd
,
&
rc
);
GetClientRect
(
infoPtr
->
hwnd
,
&
rc
);
TREEVIEW_Refresh
(
infoPtr
,
hdc
,
&
rc
);
TREEVIEW_Refresh
(
infoPtr
,
hdc
,
&
rc
);
}
return
0
;
return
0
;
}
}
...
...
Vitaly Lipatov
@lav
mentioned in commit
4e95553a
·
Feb 25, 2024
mentioned in commit
4e95553a
mentioned in commit 4e95553a2d1e442218cf94168b6258e3f5ba255b
Toggle commit list
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