Nikolay Sivov : comctl32/button: Keep control style.
Alexandre Julliard
julliard at winehq.org
Mon Apr 2 16:32:52 CDT 2018
Module: wine
Branch: master
Commit: b442a5c0f02817e005a6a90c184487d1ec255b9b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b442a5c0f02817e005a6a90c184487d1ec255b9b
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Apr 1 11:33:38 2018 +0300
comctl32/button: Keep control style.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/comctl32/button.c | 8 +++++++-
dlls/comctl32/tests/button.c | 2 ++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 7d48fe7..1e339ef 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -91,6 +91,7 @@ typedef struct _BUTTON_INFO
{
HWND hwnd;
HWND parent;
+ LONG style;
LONG state;
HFONT font;
WCHAR *note;
@@ -340,11 +341,16 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
break;
case WM_NCCREATE:
+ {
+ CREATESTRUCTW *cs = (CREATESTRUCTW *)lParam;
+
infoPtr = heap_alloc_zero( sizeof(*infoPtr) );
SetWindowLongPtrW( hWnd, 0, (LONG_PTR)infoPtr );
infoPtr->hwnd = hWnd;
- infoPtr->parent = GetParent(hWnd);
+ infoPtr->parent = cs->hwndParent;
+ infoPtr->style = cs->style;
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
+ }
case WM_NCDESTROY:
SetWindowLongPtrW( hWnd, 0, 0 );
diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c
index 0aacfa5..7bd73de 100644
--- a/dlls/comctl32/tests/button.c
+++ b/dlls/comctl32/tests/button.c
@@ -1004,6 +1004,7 @@ static void test_button_data(void)
{
HWND self;
HWND parent;
+ LONG style;
};
unsigned int i;
HWND parent;
@@ -1027,6 +1028,7 @@ static void test_button_data(void)
{
ok(desc->self == hwnd, "Unexpected 'self' field.\n");
ok(desc->parent == parent, "Unexpected 'parent' field.\n");
+ ok(desc->style == (WS_CHILD | BS_NOTIFY | styles[i]), "Unexpected 'style' field.\n");
}
DestroyWindow(hwnd);
More information about the wine-cvs
mailing list