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
733a3ec1
Commit
733a3ec1
authored
Mar 30, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/button: Improve button data layout compatibility.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52df130d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
button.c
dlls/comctl32/button.c
+2
-0
button.c
dlls/comctl32/tests/button.c
+57
-0
No files found.
dlls/comctl32/button.c
View file @
733a3ec1
...
...
@@ -90,6 +90,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(button);
typedef
struct
_BUTTON_INFO
{
HWND
hwnd
;
HWND
parent
;
LONG
state
;
HFONT
font
;
WCHAR
*
note
;
...
...
@@ -342,6 +343,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
infoPtr
=
heap_alloc_zero
(
sizeof
(
*
infoPtr
)
);
SetWindowLongPtrW
(
hWnd
,
0
,
(
LONG_PTR
)
infoPtr
);
infoPtr
->
hwnd
=
hWnd
;
infoPtr
->
parent
=
GetParent
(
hWnd
);
return
DefWindowProcW
(
hWnd
,
uMsg
,
wParam
,
lParam
);
case
WM_NCDESTROY
:
...
...
dlls/comctl32/tests/button.c
View file @
733a3ec1
...
...
@@ -979,6 +979,62 @@ static void register_parent_class(void)
RegisterClassA
(
&
cls
);
}
static
void
test_button_data
(
void
)
{
static
const
DWORD
styles
[]
=
{
BS_PUSHBUTTON
,
BS_DEFPUSHBUTTON
,
BS_CHECKBOX
,
BS_AUTOCHECKBOX
,
BS_RADIOBUTTON
,
BS_3STATE
,
BS_AUTO3STATE
,
BS_GROUPBOX
,
BS_USERBUTTON
,
BS_AUTORADIOBUTTON
,
BS_OWNERDRAW
,
BS_SPLITBUTTON
,
BS_DEFSPLITBUTTON
,
BS_COMMANDLINK
,
BS_DEFCOMMANDLINK
,
};
struct
button_desc
{
HWND
self
;
HWND
parent
;
};
unsigned
int
i
;
HWND
parent
;
parent
=
CreateWindowExA
(
0
,
"TestParentClass"
,
"Test parent"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
parent
!=
0
,
"Failed to create parent window
\n
"
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
styles
);
i
++
)
{
struct
button_desc
*
desc
;
HWND
hwnd
;
hwnd
=
create_button
(
styles
[
i
],
parent
);
ok
(
hwnd
!=
NULL
,
"Failed to create a button.
\n
"
);
desc
=
(
void
*
)
GetWindowLongPtrA
(
hwnd
,
0
);
ok
(
desc
!=
NULL
,
"Expected window data.
\n
"
);
if
(
desc
)
{
ok
(
desc
->
self
==
hwnd
,
"Unexpected 'self' field.
\n
"
);
ok
(
desc
->
parent
==
parent
,
"Unexpected 'parent' field.
\n
"
);
}
DestroyWindow
(
hwnd
);
}
DestroyWindow
(
parent
);
}
START_TEST
(
button
)
{
ULONG_PTR
ctx_cookie
;
...
...
@@ -995,6 +1051,7 @@ START_TEST(button)
test_button_class
();
test_button_messages
();
test_note
();
test_button_data
();
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