Dmitry Timoshkov : comctl32: Add a test for the initial tooltip window style settings,

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 19 14:22:01 CST 2005


Module: wine
Branch: refs/heads/master
Commit: f15abf08ac0f9b04b55b23ef556e4cbbf3f6f984
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=f15abf08ac0f9b04b55b23ef556e4cbbf3f6f984

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Mon Dec 19 17:43:10 2005 +0100

comctl32: Add a test for the initial tooltip window style settings,
make it pass under Wine.

---

 dlls/comctl32/tests/.gitignore  |    1 +
 dlls/comctl32/tests/Makefile.in |    1 +
 dlls/comctl32/tests/tooltips.c  |   68 +++++++++++++++++++++++++++++++++++++++
 dlls/comctl32/tooltips.c        |    2 +
 4 files changed, 71 insertions(+), 1 deletions(-)
 create mode 100644 dlls/comctl32/tests/tooltips.c

diff --git a/dlls/comctl32/tests/.gitignore b/dlls/comctl32/tests/.gitignore
index 207da2c..5ed31bc 100644
--- a/dlls/comctl32/tests/.gitignore
+++ b/dlls/comctl32/tests/.gitignore
@@ -9,5 +9,6 @@ subclass.ok
 tab.ok
 testlist.c
 toolbar.ok
+tooltips.ok
 treeview.ok
 updown.ok
diff --git a/dlls/comctl32/tests/Makefile.in b/dlls/comctl32/tests/Makefile.in
index fc9881d..1528964 100644
--- a/dlls/comctl32/tests/Makefile.in
+++ b/dlls/comctl32/tests/Makefile.in
@@ -15,6 +15,7 @@ CTESTS = \
 	subclass.c \
 	tab.c \
 	toolbar.c \
+	tooltips.c \
 	treeview.c \
 	updown.c
 
diff --git a/dlls/comctl32/tests/tooltips.c b/dlls/comctl32/tests/tooltips.c
new file mode 100644
index 0000000..ee935b4
--- /dev/null
+++ b/dlls/comctl32/tests/tooltips.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005 Dmitry Timoshkov
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <assert.h>
+#include <windows.h>
+#include <commctrl.h>
+
+#include "wine/test.h"
+
+static void test_create_tooltip(void)
+{
+    HWND parent, hwnd;
+    DWORD style, exp_style;
+
+    parent = CreateWindowEx(0, "static", NULL, WS_POPUP,
+                          0, 0, 0, 0,
+                          NULL, NULL, NULL, 0);
+    assert(parent);
+
+    hwnd = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, 0x7fffffff | WS_POPUP,
+                          10, 10, 300, 100,
+                          parent, NULL, NULL, 0);
+    assert(hwnd);
+
+    style = GetWindowLong(hwnd, GWL_STYLE);
+    trace("style = %08lx\n", style);
+    exp_style = 0x7fffffff | WS_POPUP;
+    exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME);
+    ok(style == exp_style,"wrong style %08lx/%08lx\n", style, exp_style);
+
+    DestroyWindow(hwnd);
+
+    hwnd = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, 0,
+                          10, 10, 300, 100,
+                          parent, NULL, NULL, 0);
+    assert(hwnd);
+
+    style = GetWindowLong(hwnd, GWL_STYLE);
+    trace("style = %08lx\n", style);
+    ok(style == (WS_POPUP | WS_CLIPSIBLINGS | WS_BORDER),
+       "wrong style %08lx\n", style);
+
+    DestroyWindow(hwnd);
+
+    DestroyWindow(parent);
+}
+
+START_TEST(tooltips)
+{
+    InitCommonControls();
+
+    test_create_tooltip();
+}
diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c
index 39d981b..c16fd7e 100644
--- a/dlls/comctl32/tooltips.c
+++ b/dlls/comctl32/tooltips.c
@@ -2400,7 +2400,7 @@ TOOLTIPS_NCCreate (HWND hwnd, WPARAM wPa
     DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
     DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
 
-    dwStyle &= 0x0000FFFF;
+    dwStyle &= ~(WS_CHILD | /*WS_MAXIMIZE |*/ WS_BORDER | WS_DLGFRAME);
     dwStyle |= (WS_POPUP | WS_BORDER | WS_CLIPSIBLINGS);
 
     /* WS_BORDER only draws a border round the window rect, not the




More information about the wine-cvs mailing list