ReactOS 0.4.15-dev-5666-gc548b97
tooltips.c
Go to the documentation of this file.
1/*
2 * Copyright 2005 Dmitry Timoshkov
3 * Copyright 2008 Jason Edmeades
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include <windows.h>
21#include <commctrl.h>
22
23#include "resources.h"
24
25#include "wine/test.h"
26
27#include "v6util.h"
28#include "msg.h"
29
30#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
31
33{
36};
37
39
40static void test_create_tooltip(BOOL is_v6)
41{
43 DWORD style, exp_style;
44
45 parent = CreateWindowExA(0, "static", NULL, WS_POPUP,
46 0, 0, 0, 0,
47 NULL, NULL, NULL, 0);
48 ok(parent != NULL, "failed to create parent wnd\n");
49
51 10, 10, 300, 100,
52 parent, NULL, NULL, 0);
53 ok(hwnd != NULL, "failed to create tooltip wnd\n");
54
56 exp_style = 0x7fffffff | WS_POPUP;
57 exp_style &= ~(WS_CHILD | WS_MAXIMIZE | WS_BORDER | WS_DLGFRAME);
58 ok(style == exp_style || broken(style == (exp_style | WS_BORDER)), /* nt4 */
59 "wrong style %08x/%08x\n", style, exp_style);
60
62
64 10, 10, 300, 100,
65 parent, NULL, NULL, 0);
66 ok(hwnd != NULL, "failed to create tooltip wnd\n");
67
69 exp_style = WS_POPUP | WS_CLIPSIBLINGS;
70 if (!is_v6)
71 exp_style |= WS_BORDER;
72todo_wine_if(is_v6)
73 ok(style == exp_style || broken(style == (exp_style | WS_BORDER)) /* XP */,
74 "Unexpected window style %#x.\n", style);
75
77
79}
80
81/* try to make sure pending X events have been processed before continuing */
82static void flush_events(int waitTime)
83{
84 MSG msg;
85 int diff = waitTime;
86 DWORD time = GetTickCount() + waitTime;
87
88 while (diff > 0)
89 {
90 if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(100,diff), QS_ALLEVENTS) == WAIT_TIMEOUT) break;
91 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
92 diff = time - GetTickCount();
93 }
94}
95
96static int CD_Stages;
98static HWND g_hwnd;
99
100#define TEST_CDDS_PREPAINT 0x00000001
101#define TEST_CDDS_POSTPAINT 0x00000002
102#define TEST_CDDS_PREERASE 0x00000004
103#define TEST_CDDS_POSTERASE 0x00000008
104#define TEST_CDDS_ITEMPREPAINT 0x00000010
105#define TEST_CDDS_ITEMPOSTPAINT 0x00000020
106#define TEST_CDDS_ITEMPREERASE 0x00000040
107#define TEST_CDDS_ITEMPOSTERASE 0x00000080
108#define TEST_CDDS_SUBITEM 0x00000100
109
111{
112 switch(msg) {
113
114 case WM_DESTROY:
116 break;
117
118 case WM_NOTIFY:
119 if (((NMHDR *)lParam)->code == NM_CUSTOMDRAW) {
121 ok(ttcd->nmcd.hdr.hwndFrom == g_hwnd, "Unexpected hwnd source %p (%p)\n",
122 ttcd->nmcd.hdr.hwndFrom, g_hwnd);
123 ok(ttcd->nmcd.hdr.idFrom == 0x1234ABCD, "Unexpected id %x\n", (int)ttcd->nmcd.hdr.idFrom);
124
125 switch (ttcd->nmcd.dwDrawStage) {
135 default: CD_Stages = -1;
136 }
137
138 if (ttcd->nmcd.dwDrawStage == CDDS_PREPAINT) return CD_Result;
139 }
140 /* drop through */
141
142 default:
144 }
145
146 return 0L;
147}
148
149static void test_customdraw(void) {
150 static struct {
151 LRESULT FirstReturnValue;
152 int ExpectedCalls;
153 } expectedResults[] = {
154 /* Valid notification responses */
158
159 /* Invalid notification responses */
163 };
164
165 DWORD iterationNumber;
166 WNDCLASSA wc;
167 POINT orig_pos;
168 LRESULT ret;
169
170 /* Create a class to use the custom draw wndproc */
172 wc.cbClsExtra = 0;
173 wc.cbWndExtra = 0;
175 wc.hIcon = NULL;
178 wc.lpszMenuName = NULL;
179 wc.lpszClassName = "CustomDrawClass";
181 RegisterClassA(&wc);
182
183 GetCursorPos(&orig_pos);
184
185 for (iterationNumber = 0;
186 iterationNumber < ARRAY_SIZE(expectedResults);
187 iterationNumber++) {
188
189 HWND parent, hwndTip;
190 RECT rect;
191 TTTOOLINFOA toolInfo = { 0 };
192
193 /* Create a main window */
194 parent = CreateWindowExA(0, "CustomDrawClass", NULL,
197 50, 50,
198 300, 300,
199 NULL, NULL, NULL, 0);
200 ok(parent != NULL, "Creation of main window failed\n");
201
202 /* Make it show */
204 flush_events(100);
205
206 /* Create Tooltip */
212 ok(hwndTip != NULL, "Creation of tooltip window failed\n");
213
214 /* Set up parms for the wndproc to handle */
215 CD_Stages = 0;
216 CD_Result = expectedResults[iterationNumber].FirstReturnValue;
217 g_hwnd = hwndTip;
218
219 /* Make it topmost, as per the MSDN */
220 SetWindowPos(hwndTip, HWND_TOPMOST, 0, 0, 0, 0,
222
223 /* Create a tool */
224 toolInfo.cbSize = TTTOOLINFOA_V1_SIZE;
225 toolInfo.hwnd = parent;
226 toolInfo.hinst = GetModuleHandleA(NULL);
227 toolInfo.uFlags = TTF_SUBCLASS;
228 toolInfo.uId = 0x1234ABCD;
229 toolInfo.lpszText = (LPSTR)"This is a test tooltip";
230 toolInfo.lParam = 0xdeadbeef;
231 GetClientRect (parent, &toolInfo.rect);
232 ret = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo);
233 ok(ret, "Failed to add the tool.\n");
234
235 /* Make tooltip appear quickly */
237
238 /* Put cursor inside window, tooltip will appear immediately */
240 SetCursorPos( (rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2 );
241 flush_events(200);
242
243 if (CD_Stages)
244 {
245 /* Check CustomDraw results */
246 ok(CD_Stages == expectedResults[iterationNumber].ExpectedCalls ||
247 broken(CD_Stages == (expectedResults[iterationNumber].ExpectedCalls & ~TEST_CDDS_POSTPAINT)), /* nt4 */
248 "CustomDraw run %d stages %x, expected %x\n", iterationNumber, CD_Stages,
249 expectedResults[iterationNumber].ExpectedCalls);
250 }
251
252 ret = SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, 0);
253 ok(ret, "Failed to get current tool %#lx.\n", ret);
254
255 memset(&toolInfo, 0xcc, sizeof(toolInfo));
256 toolInfo.cbSize = sizeof(toolInfo);
257 toolInfo.lpszText = NULL;
258 toolInfo.lpReserved = (void *)0xdeadbeef;
259 SendMessageA(hwndTip, TTM_GETCURRENTTOOLA, 0, (LPARAM)&toolInfo);
260 ok(toolInfo.hwnd == parent, "Unexpected hwnd %p.\n", toolInfo.hwnd);
261 ok(toolInfo.hinst == GetModuleHandleA(NULL), "Unexpected hinst %p.\n", toolInfo.hinst);
262 ok(toolInfo.uId == 0x1234abcd, "Unexpected uId %lx.\n", toolInfo.uId);
263 ok(toolInfo.lParam == 0, "Unexpected lParam %lx.\n", toolInfo.lParam);
264 ok(toolInfo.lpReserved == (void *)0xdeadbeef, "Unexpected lpReserved %p.\n", toolInfo.lpReserved);
265
266 /* Clean up */
267 DestroyWindow(hwndTip);
269 }
270
271 SetCursorPos(orig_pos.x, orig_pos.y);
272}
273
274static const CHAR testcallbackA[] = "callback";
275
278{
279 static LONG defwndproc_counter = 0;
280 struct message msg;
281 LRESULT ret;
282
283 if (message == WM_NOTIFY && lParam)
284 {
286 NMHDR *hdr = (NMHDR *)lParam;
287 RECT rect;
288
289 if (hdr->code != NM_CUSTOMDRAW)
290 {
291 msg.message = message;
292 msg.flags = sent|wparam|lparam;
293 if (defwndproc_counter) msg.flags |= defwinproc;
294 msg.wParam = wParam;
295 msg.lParam = lParam;
296 msg.id = hdr->code;
298 }
299
300 switch (hdr->code)
301 {
302 case TTN_GETDISPINFOA:
304 break;
305 case TTN_SHOW:
306 GetWindowRect(hdr->hwndFrom, &rect);
307 ok(!EqualRect(&g_ttip_rect, &rect), "Unexpected window rectangle.\n");
308 break;
309 }
310 }
311
312 defwndproc_counter++;
315 else
317 defwndproc_counter--;
318
319 return ret;
320}
321
323{
324 WNDCLASSA cls;
325 BOOL ret;
326
327 cls.style = 0;
329 cls.cbClsExtra = 0;
330 cls.cbWndExtra = 0;
332 cls.hIcon = 0;
335 cls.lpszMenuName = NULL;
336 cls.lpszClassName = "Tooltips test parent class";
337 ret = RegisterClassA(&cls);
338 ok(ret, "Failed to register test parent class.\n");
339}
340
342{
343 return CreateWindowExA(0, "Tooltips test parent class",
344 "Tooltips test parent window",
347 0, 0, 100, 100,
349}
350
351static void test_gettext(void)
352{
353 static const CHAR testtip2A[] = "testtip\ttest2";
354 static const CHAR testtipA[] = "testtip";
356 TTTOOLINFOA toolinfoA;
357 TTTOOLINFOW toolinfoW;
358 LRESULT r;
359 CHAR bufA[16] = "";
360 WCHAR bufW[10] = { 0 };
362
364 ok(notify != NULL, "Expected notification window to be created\n");
365
366 /* For bug 14790 - lpszText is NULL */
368 10, 10, 300, 100,
369 NULL, NULL, NULL, 0);
370 ok(hwnd != NULL, "failed to create tooltip wnd\n");
371
372 /* use sizeof(TTTOOLINFOA) instead of TTTOOLINFOA_V1_SIZE so that adding it fails on Win9x */
373 /* otherwise it crashes on the NULL lpszText */
374 toolinfoA.cbSize = sizeof(TTTOOLINFOA);
375 toolinfoA.hwnd = NULL;
376 toolinfoA.hinst = GetModuleHandleA(NULL);
377 toolinfoA.uFlags = 0;
378 toolinfoA.uId = 0x1234ABCD;
379 toolinfoA.lpszText = NULL;
380 toolinfoA.lParam = 0xdeadbeef;
381 GetClientRect(hwnd, &toolinfoA.rect);
382 r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
383 ok(r, "got %ld\n", r);
384
385 toolinfoA.hwnd = NULL;
386 toolinfoA.uId = 0x1234abcd;
387 toolinfoA.lpszText = bufA;
388 r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
389 ok(!r, "got %ld\n", r);
390 ok(!*toolinfoA.lpszText, "lpszText should be empty, got %s\n", toolinfoA.lpszText);
391
392 toolinfoA.lpszText = bufA;
393 r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
395 ok(!r, "got %ld\n", r);
396 ok(toolinfoA.lpszText == NULL, "expected NULL, got %p\n", toolinfoA.lpszText);
397
398 /* NULL hinst, valid resource id for text */
399 toolinfoA.cbSize = sizeof(TTTOOLINFOA);
400 toolinfoA.hwnd = NULL;
401 toolinfoA.hinst = NULL;
402 toolinfoA.uFlags = 0;
403 toolinfoA.uId = 0x1233abcd;
405 toolinfoA.lParam = 0xdeadbeef;
406 GetClientRect(hwnd, &toolinfoA.rect);
407 r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
408 ok(r, "failed to add a tool\n");
409
410 toolinfoA.hwnd = NULL;
411 toolinfoA.uId = 0x1233abcd;
412 toolinfoA.lpszText = bufA;
413 r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
414 ok(!r, "got %ld\n", r);
415 ok(!strcmp(toolinfoA.lpszText, "abc"), "got wrong text, %s\n", toolinfoA.lpszText);
416
417 toolinfoA.hinst = (HINSTANCE)0xdeadbee;
418 r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
420 ok(!r, "got %ld\n", r);
421 ok(toolinfoA.hinst == NULL, "expected NULL, got %p\n", toolinfoA.hinst);
422
423 r = SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&toolinfoA);
424 ok(!r, "got %ld\n", r);
425
426 /* add another tool with text */
427 toolinfoA.cbSize = sizeof(TTTOOLINFOA);
428 toolinfoA.hwnd = NULL;
429 toolinfoA.hinst = GetModuleHandleA(NULL);
430 toolinfoA.uFlags = 0;
431 toolinfoA.uId = 0x1235ABCD;
432 strcpy(bufA, testtipA);
433 toolinfoA.lpszText = bufA;
434 toolinfoA.lParam = 0xdeadbeef;
435 GetClientRect(hwnd, &toolinfoA.rect);
436 r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
437 ok(r, "Adding the tool to the tooltip failed\n");
438
440 ok(length == 0, "Expected 0, got %d\n", length);
441
442 toolinfoA.hwnd = NULL;
443 toolinfoA.uId = 0x1235abcd;
444 toolinfoA.lpszText = bufA;
445 r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
446 ok(!r, "got %ld\n", r);
447 ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %p\n", testtipA, toolinfoA.lpszText);
448
449 memset(bufA, 0x1f, sizeof(bufA));
450 toolinfoA.lpszText = bufA;
451 r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
453 ok(!r, "got %ld\n", r);
454 ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %p\n", testtipA, toolinfoA.lpszText);
455
457 ok(length == 0, "Expected 0, got %d\n", length);
458
459 /* add another with callback text */
460 toolinfoA.cbSize = sizeof(TTTOOLINFOA);
461 toolinfoA.hwnd = notify;
462 toolinfoA.hinst = GetModuleHandleA(NULL);
463 toolinfoA.uFlags = 0;
464 toolinfoA.uId = 0x1236ABCD;
465 toolinfoA.lpszText = LPSTR_TEXTCALLBACKA;
466 toolinfoA.lParam = 0xdeadbeef;
467 GetClientRect(hwnd, &toolinfoA.rect);
468 r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
469 ok(r, "Adding the tool to the tooltip failed\n");
470
471 toolinfoA.hwnd = notify;
472 toolinfoA.uId = 0x1236abcd;
473 toolinfoA.lpszText = bufA;
474 r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
475 ok(!r, "got %ld\n", r);
476 ok(!strcmp(toolinfoA.lpszText, testcallbackA), "lpszText should be an (%s) string\n", testcallbackA);
477
478 toolinfoA.lpszText = bufA;
479 r = SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
481 ok(!r, "got %ld\n", r);
482 ok(toolinfoA.lpszText == LPSTR_TEXTCALLBACKA, "expected LPSTR_TEXTCALLBACKA, got %p\n", toolinfoA.lpszText);
483
486
488 10, 10, 300, 100,
489 NULL, NULL, NULL, 0);
490 ok(hwnd != NULL, "failed to create tooltip wnd\n");
491
492 toolinfoW.cbSize = TTTOOLINFOW_V2_SIZE + 1;
493 toolinfoW.hwnd = NULL;
494 toolinfoW.hinst = GetModuleHandleA(NULL);
495 toolinfoW.uFlags = 0;
496 toolinfoW.uId = 0x1234ABCD;
497 toolinfoW.lpszText = NULL;
498 toolinfoW.lParam = 0xdeadbeef;
499 GetClientRect(hwnd, &toolinfoW.rect);
500 r = SendMessageW(hwnd, TTM_ADDTOOLW, 0, (LPARAM)&toolinfoW);
501 /* Wine currently checks for V3 structure size, which matches what V6 control does.
502 Older implementation was never updated to support lpReserved field. */
504 ok(!r, "Adding the tool to the tooltip succeeded!\n");
505
506 if (0) /* crashes on NT4 */
507 {
508 toolinfoW.hwnd = NULL;
509 toolinfoW.uId = 0x1234ABCD;
510 toolinfoW.lpszText = bufW;
511 SendMessageW(hwnd, TTM_GETTEXTW, 0, (LPARAM)&toolinfoW);
512 ok(toolinfoW.lpszText[0] == 0, "lpszText should be an empty string\n");
513 }
514
515 /* text with embedded tabs */
516 toolinfoA.cbSize = sizeof(TTTOOLINFOA);
517 toolinfoA.hwnd = NULL;
518 toolinfoA.hinst = GetModuleHandleA(NULL);
519 toolinfoA.uFlags = 0;
520 toolinfoA.uId = 0x1235abce;
521 strcpy(bufA, testtip2A);
522 toolinfoA.lpszText = bufA;
523 toolinfoA.lParam = 0xdeadbeef;
524 GetClientRect(hwnd, &toolinfoA.rect);
525 r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
526 ok(r, "got %ld\n", r);
527
528 toolinfoA.hwnd = NULL;
529 toolinfoA.uId = 0x1235abce;
530 toolinfoA.lpszText = bufA;
531 r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
532 ok(!r, "got %ld\n", r);
533 ok(!strcmp(toolinfoA.lpszText, testtipA), "expected %s, got %s\n", testtipA, toolinfoA.lpszText);
534
535 /* enable TTS_NOPREFIX, original text is retained */
538
539 toolinfoA.hwnd = NULL;
540 toolinfoA.uId = 0x1235abce;
541 toolinfoA.lpszText = bufA;
542 r = SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
543 ok(!r, "got %ld\n", r);
544 ok(!strcmp(toolinfoA.lpszText, testtip2A), "expected %s, got %s\n", testtip2A, toolinfoA.lpszText);
545
547}
548
549static void test_ttm_gettoolinfo(void)
550{
551 TTTOOLINFOA ti;
552 TTTOOLINFOW tiW;
553 HWND hwnd;
554 DWORD r;
555
556 hwnd = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL, 0, 10, 10, 300, 100, NULL, NULL, NULL, 0);
557 ok(hwnd != NULL, "Failed to create tooltip control.\n");
558
560 ti.hwnd = NULL;
562 ti.uFlags = 0;
563 ti.uId = 0x1234ABCD;
564 ti.lpszText = NULL;
565 ti.lParam = 0x1abe11ed;
566 GetClientRect(hwnd, &ti.rect);
568 ok(r, "Adding the tool to the tooltip failed\n");
569
571 ti.lParam = 0xaaaaaaaa;
573 ok(r, "Getting tooltip info failed\n");
574 ok(0x1abe11ed == ti.lParam ||
575 broken(0x1abe11ed != ti.lParam), /* comctl32 < 5.81 */
576 "Expected 0x1abe11ed, got %lx\n", ti.lParam);
577
579 tiW.hwnd = NULL;
580 tiW.uId = 0x1234ABCD;
581 tiW.lParam = 0xaaaaaaaa;
582 tiW.lpszText = NULL;
584 ok(r, "Getting tooltip info failed\n");
585 ok(0x1abe11ed == tiW.lParam ||
586 broken(0x1abe11ed != tiW.lParam), /* comctl32 < 5.81 */
587 "Expected 0x1abe11ed, got %lx\n", tiW.lParam);
588
590 ti.uId = 0x1234ABCD;
591 ti.lParam = 0x55555555;
593
595 ti.lParam = 0xdeadbeef;
597 ok(r, "Getting tooltip info failed\n");
598 ok(0x55555555 == ti.lParam ||
599 broken(0x55555555 != ti.lParam), /* comctl32 < 5.81 */
600 "Expected 0x55555555, got %lx\n", ti.lParam);
601
603
604 /* 1. test size parameter validation rules (ansi messages) */
606 10, 10, 300, 100,
607 NULL, NULL, NULL, 0);
608
610 ti.hwnd = NULL;
612 ti.uFlags = 0;
613 ti.uId = 0x1234ABCD;
614 ti.lpszText = NULL;
615 ti.lParam = 0xdeadbeef;
616 GetClientRect(hwnd, &ti.rect);
618 ok(r, "Adding the tool to the tooltip failed\n");
620 expect(1, r);
621
623 ti.hwnd = NULL;
624 ti.uId = 0x1234ABCD;
627 expect(0, r);
628
630 ti.hwnd = NULL;
632 ti.uFlags = 0;
633 ti.uId = 0x1234ABCD;
634 ti.lpszText = NULL;
635 ti.lParam = 0xdeadbeef;
636 GetClientRect(hwnd, &ti.rect);
638 ok(r, "Adding the tool to the tooltip failed\n");
640 expect(1, r);
641
643 ti.hwnd = NULL;
644 ti.uId = 0x1234ABCD;
647 expect(0, r);
648
650 ti.hwnd = NULL;
652 ti.uFlags = 0;
653 ti.uId = 0x1234ABCD;
654 ti.lpszText = NULL;
655 ti.lParam = 0xdeadbeef;
656 GetClientRect(hwnd, &ti.rect);
658 ok(r, "Adding the tool to the tooltip failed\n");
660 expect(1, r);
661
663 ti.hwnd = NULL;
664 ti.uId = 0x1234ABCD;
667 expect(0, r);
668
670
671 /* 2. test size parameter validation rules (w-messages) */
673 10, 10, 300, 100,
674 NULL, NULL, NULL, 0);
675 ok(hwnd != NULL, "Failed to create tooltip window.\n");
676
677 tiW.cbSize = TTTOOLINFOW_V1_SIZE - 1;
678 tiW.hwnd = NULL;
680 tiW.uFlags = 0;
681 tiW.uId = 0x1234ABCD;
682 tiW.lpszText = NULL;
683 tiW.lParam = 0xdeadbeef;
684 GetClientRect(hwnd, &tiW.rect);
685 r = SendMessageW(hwnd, TTM_ADDTOOLW, 0, (LPARAM)&tiW);
686 ok(r, "Adding the tool to the tooltip failed\n");
688 expect(1, r);
689
690 tiW.cbSize = TTTOOLINFOW_V1_SIZE - 1;
691 tiW.hwnd = NULL;
692 tiW.uId = 0x1234ABCD;
695 expect(0, r);
696
697 tiW.cbSize = TTTOOLINFOW_V2_SIZE - 1;
698 tiW.hwnd = NULL;
700 tiW.uFlags = 0;
701 tiW.uId = 0x1234ABCD;
702 tiW.lpszText = NULL;
703 tiW.lParam = 0xdeadbeef;
704 GetClientRect(hwnd, &tiW.rect);
705 r = SendMessageW(hwnd, TTM_ADDTOOLW, 0, (LPARAM)&tiW);
706 ok(r, "Adding the tool to the tooltip failed\n");
708 expect(1, r);
709
710 tiW.cbSize = TTTOOLINFOW_V2_SIZE - 1;
711 tiW.hwnd = NULL;
712 tiW.uId = 0x1234ABCD;
715 expect(0, r);
716
717 tiW.cbSize = TTTOOLINFOW_V2_SIZE + 1;
718 tiW.hwnd = NULL;
720 tiW.uFlags = 0;
721 tiW.uId = 0x1234ABCD;
722 tiW.lpszText = NULL;
723 tiW.lParam = 0xdeadbeef;
724 GetClientRect(hwnd, &tiW.rect);
725 r = SendMessageW(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&tiW);
726 ok(r, "Adding the tool to the tooltip failed\n");
728 expect(1, r);
729 /* looks like TTM_DELTOOLW doesn't work with invalid size */
730 tiW.cbSize = TTTOOLINFOW_V2_SIZE + 1;
731 tiW.hwnd = NULL;
732 tiW.uId = 0x1234ABCD;
735 expect(1, r);
736
738 tiW.hwnd = NULL;
739 tiW.uId = 0x1234ABCD;
742 expect(0, r);
743
745}
746
747static void test_longtextA(void)
748{
749 static const char longtextA[] =
750 "According to MSDN, TTM_ENUMTOOLS claims that TOOLINFO's lpszText is maximum "
751 "80 chars including null. In fact, the buffer is not null-terminated.";
752 HWND hwnd;
753 TTTOOLINFOA toolinfoA = { 0 };
754 CHAR bufA[256];
755 LRESULT r;
756
758 10, 10, 300, 100,
759 NULL, NULL, NULL, 0);
760 toolinfoA.cbSize = sizeof(TTTOOLINFOA);
761 toolinfoA.hwnd = NULL;
762 toolinfoA.hinst = GetModuleHandleA(NULL);
763 toolinfoA.uFlags = 0;
764 toolinfoA.uId = 0x1234ABCD;
765 strcpy(bufA, longtextA);
766 toolinfoA.lpszText = bufA;
767 toolinfoA.lParam = 0xdeadbeef;
768 GetClientRect(hwnd, &toolinfoA.rect);
769 r = SendMessageA(hwnd, TTM_ADDTOOLA, 0, (LPARAM)&toolinfoA);
770 if (r)
771 {
772 int textlen;
773 memset(bufA, 0, sizeof(bufA));
774 toolinfoA.hwnd = NULL;
775 toolinfoA.uId = 0xABCD1234;
776 toolinfoA.lpszText = bufA;
777 SendMessageA(hwnd, TTM_ENUMTOOLSA, 0, (LPARAM)&toolinfoA);
778 textlen = lstrlenA(toolinfoA.lpszText);
779 ok(textlen == 80, "lpszText has %d chars\n", textlen);
780 ok(toolinfoA.uId == 0x1234ABCD,
781 "uId should be retrieved, got %p\n", (void*)toolinfoA.uId);
782
783 memset(bufA, 0, sizeof(bufA));
784 toolinfoA.hwnd = NULL;
785 toolinfoA.uId = 0x1234ABCD;
786 toolinfoA.lpszText = bufA;
787 SendMessageA(hwnd, TTM_GETTOOLINFOA, 0, (LPARAM)&toolinfoA);
788 textlen = lstrlenA(toolinfoA.lpszText);
789 ok(textlen == 80, "lpszText has %d chars\n", textlen);
790
791 memset(bufA, 0, sizeof(bufA));
792 toolinfoA.hwnd = NULL;
793 toolinfoA.uId = 0x1234ABCD;
794 toolinfoA.lpszText = bufA;
795 SendMessageA(hwnd, TTM_GETTEXTA, 0, (LPARAM)&toolinfoA);
796 textlen = lstrlenA(toolinfoA.lpszText);
797 ok(textlen == 80, "lpszText has %d chars\n", textlen);
798 }
799
801}
802
803static void test_longtextW(void)
804{
805 static const char longtextA[] =
806 "According to MSDN, TTM_ENUMTOOLS claims that TOOLINFO's lpszText is maximum "
807 "80 chars including null. Actually, this is not applied for wide version.";
808 HWND hwnd;
809 TTTOOLINFOW toolinfoW = { 0 };
810 WCHAR bufW[256];
811 LRESULT r;
812 int lenW;
813
815 10, 10, 300, 100,
816 NULL, NULL, NULL, 0);
817 ok(hwnd != NULL, "Failed to create tooltip window.\n");
818
819 toolinfoW.cbSize = TTTOOLINFOW_V2_SIZE;
820 toolinfoW.hwnd = NULL;
821 toolinfoW.hinst = GetModuleHandleW(NULL);
822 toolinfoW.uFlags = 0;
823 toolinfoW.uId = 0x1234ABCD;
824 MultiByteToWideChar(CP_ACP, 0, longtextA, -1, bufW, ARRAY_SIZE(bufW));
825 lenW = lstrlenW(bufW);
826 toolinfoW.lpszText = bufW;
827 toolinfoW.lParam = 0xdeadbeef;
828 GetClientRect(hwnd, &toolinfoW.rect);
829 r = SendMessageW(hwnd, TTM_ADDTOOLW, 0, (LPARAM)&toolinfoW);
830 if (r)
831 {
832 int textlen;
833 memset(bufW, 0, sizeof(bufW));
834 toolinfoW.hwnd = NULL;
835 toolinfoW.uId = 0xABCD1234;
836 toolinfoW.lpszText = bufW;
837 SendMessageW(hwnd, TTM_ENUMTOOLSW, 0, (LPARAM)&toolinfoW);
838 textlen = lstrlenW(toolinfoW.lpszText);
839 ok(textlen == lenW, "lpszText has %d chars\n", textlen);
840 ok(toolinfoW.uId == 0x1234ABCD,
841 "uId should be retrieved, got %p\n", (void*)toolinfoW.uId);
842
843 memset(bufW, 0, sizeof(bufW));
844 toolinfoW.hwnd = NULL;
845 toolinfoW.uId = 0x1234ABCD;
846 toolinfoW.lpszText = bufW;
847 SendMessageW(hwnd, TTM_GETTOOLINFOW, 0, (LPARAM)&toolinfoW);
848 textlen = lstrlenW(toolinfoW.lpszText);
849 ok(textlen == lenW, "lpszText has %d chars\n", textlen);
850
851 memset(bufW, 0, sizeof(bufW));
852 toolinfoW.hwnd = NULL;
853 toolinfoW.uId = 0x1234ABCD;
854 toolinfoW.lpszText = bufW;
855 SendMessageW(hwnd, TTM_GETTEXTW, 0, (LPARAM)&toolinfoW);
856 textlen = lstrlenW(toolinfoW.lpszText);
857 ok(textlen == lenW ||
858 broken(textlen == 0 && toolinfoW.lpszText == NULL), /* nt4, kb186177 */
859 "lpszText has %d chars\n", textlen);
860 }
861
863}
864
865static BOOL almost_eq(int a, int b)
866{
867 return a-5<b && a+5>b;
868}
869
870static void test_track(void)
871{
872 WCHAR textW[] = {'t','e','x','t',0};
873 TTTOOLINFOW info = { 0 };
874 HWND parent, tt;
875 LRESULT res;
876 RECT pos;
877
879 50, 50, 300, 300, NULL, NULL, NULL, 0);
880 ok(parent != NULL, "creation of parent window failed\n");
881
883 flush_events(100);
884
888 ok(tt != NULL, "creation of tooltip window failed\n");
889
890 info.cbSize = TTTOOLINFOW_V1_SIZE;
892 info.hwnd = parent;
893 info.hinst = GetModuleHandleW(NULL);
894 info.lpszText = textW;
895 info.uId = (UINT_PTR)parent;
896 GetClientRect(parent, &info.rect);
897
899 ok(res, "adding the tool to the tooltip failed\n");
900
904
905 GetWindowRect(tt, &pos);
906 ok(almost_eq(pos.left, 10), "pos.left = %d\n", pos.left);
907 ok(almost_eq(pos.top, 10), "pos.top = %d\n", pos.top);
908
909 info.uFlags = TTF_IDISHWND | TTF_ABSOLUTE;
912
913 GetWindowRect(tt, &pos);
914 ok(!almost_eq(pos.left, 10), "pos.left = %d\n", pos.left);
915 ok(!almost_eq(pos.top, 10), "pos.top = %d\n", pos.top);
916
917 DestroyWindow(tt);
919}
920
922{
923 switch(msg) {
924
925 case WM_DESTROY:
927 break;
928
929 default:
931 }
932 return 0;
933}
934
935static void test_setinfo(BOOL is_v6)
936{
937 WNDCLASSA wc;
938 LRESULT lResult;
939 HWND parent, parent2, hwndTip, hwndTip2;
940 TTTOOLINFOA toolInfo = { 0 };
941 TTTOOLINFOA toolInfo2 = { 0 };
943
944 /* Create a class to use the custom draw wndproc */
946 wc.cbClsExtra = 0;
947 wc.cbWndExtra = 0;
949 wc.hIcon = NULL;
952 wc.lpszMenuName = NULL;
953 wc.lpszClassName = "SetInfoClass";
955 RegisterClassA(&wc);
956
957 /* Create a main window */
958 parent = CreateWindowExA(0, "SetInfoClass", NULL,
961 50, 50,
962 300, 300,
963 NULL, NULL, NULL, 0);
964 ok(parent != NULL, "Creation of main window failed\n");
965
966 parent2 = CreateWindowExA(0, "SetInfoClass", NULL,
969 50, 50,
970 300, 300,
971 NULL, NULL, NULL, 0);
972 ok(parent2 != NULL, "Creation of main window failed\n");
973
974 /* Make it show */
975 ShowWindow(parent2, SW_SHOWNORMAL);
976 flush_events(100);
977
978 /* Create Tooltip */
984 ok(hwndTip != NULL, "Creation of tooltip window failed\n");
985
991 ok(hwndTip2 != NULL, "Creation of tooltip window failed\n");
992
993
994 /* Make it topmost, as per the MSDN */
995 SetWindowPos(hwndTip, HWND_TOPMOST, 0, 0, 0, 0,
997
998 /* Create a tool */
999 toolInfo.cbSize = TTTOOLINFOA_V1_SIZE;
1000 toolInfo.hwnd = parent;
1001 toolInfo.hinst = GetModuleHandleA(NULL);
1002 toolInfo.uFlags = TTF_SUBCLASS;
1003 toolInfo.uId = 0x1234ABCD;
1004 toolInfo.lpszText = (LPSTR)"This is a test tooltip";
1005 toolInfo.lParam = 0xdeadbeef;
1006 GetClientRect (parent, &toolInfo.rect);
1007 lResult = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo);
1008 ok(lResult, "Adding the tool to the tooltip failed\n");
1009
1010 toolInfo.cbSize = TTTOOLINFOA_V1_SIZE;
1011 toolInfo.hwnd = parent2;
1012 toolInfo.hinst = GetModuleHandleA(NULL);
1013 toolInfo.uFlags = 0;
1014 toolInfo.uId = 0x1234ABCE;
1015 toolInfo.lpszText = (LPSTR)"This is a test tooltip";
1016 toolInfo.lParam = 0xdeadbeef;
1017 GetClientRect (parent, &toolInfo.rect);
1018 lResult = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&toolInfo);
1019 ok(lResult, "Adding the tool to the tooltip failed\n");
1020
1021 /* Try to Remove Subclass */
1022 toolInfo2.cbSize = TTTOOLINFOA_V1_SIZE;
1023 toolInfo2.hwnd = parent;
1024 toolInfo2.uId = 0x1234ABCD;
1025 lResult = SendMessageA(hwndTip, TTM_GETTOOLINFOA, 0, (LPARAM)&toolInfo2);
1026 ok(lResult, "GetToolInfo failed\n");
1027 ok(toolInfo2.uFlags & TTF_SUBCLASS || broken(is_v6 && !(toolInfo2.uFlags & TTF_SUBCLASS)) /* XP */,
1028 "uFlags does not have subclass\n");
1030 ok (wndProc != info_wnd_proc, "Window Proc is wrong\n");
1031
1032 toolInfo2.uFlags &= ~TTF_SUBCLASS;
1033 SendMessageA(hwndTip, TTM_SETTOOLINFOA, 0, (LPARAM)&toolInfo2);
1034 lResult = SendMessageA(hwndTip, TTM_GETTOOLINFOA, 0, (LPARAM)&toolInfo2);
1035 ok(lResult, "GetToolInfo failed\n");
1036 ok(!(toolInfo2.uFlags & TTF_SUBCLASS), "uFlags has subclass\n");
1038 ok (wndProc != info_wnd_proc, "Window Proc is wrong\n");
1039
1040 /* Try to Add Subclass */
1041
1042 /* Make it topmost, as per the MSDN */
1043 SetWindowPos(hwndTip2, HWND_TOPMOST, 0, 0, 0, 0,
1045
1046 toolInfo2.cbSize = TTTOOLINFOA_V1_SIZE;
1047 toolInfo2.hwnd = parent2;
1048 toolInfo2.uId = 0x1234ABCE;
1049 lResult = SendMessageA(hwndTip, TTM_GETTOOLINFOA, 0, (LPARAM)&toolInfo2);
1050 ok(lResult, "GetToolInfo failed\n");
1051 ok(!(toolInfo2.uFlags & TTF_SUBCLASS), "uFlags has subclass\n");
1053 ok (wndProc == info_wnd_proc, "Window Proc is wrong\n");
1054
1055 toolInfo2.uFlags |= TTF_SUBCLASS;
1056 SendMessageA(hwndTip, TTM_SETTOOLINFOA, 0, (LPARAM)&toolInfo2);
1057 lResult = SendMessageA(hwndTip, TTM_GETTOOLINFOA, 0, (LPARAM)&toolInfo2);
1058 ok(lResult, "GetToolInfo failed\n");
1059 ok(toolInfo2.uFlags & TTF_SUBCLASS, "uFlags does not have subclass\n");
1061 ok (wndProc == info_wnd_proc, "Window Proc is wrong\n");
1062
1063 /* Clean up */
1064 DestroyWindow(hwndTip);
1065 DestroyWindow(hwndTip2);
1067 DestroyWindow(parent2);
1068}
1069
1070static void test_margin(void)
1071{
1072 RECT r, r1;
1073 HWND hwnd;
1074 DWORD ret;
1075
1077 10, 10, 300, 100,
1078 NULL, NULL, NULL, 0);
1079 ok(hwnd != NULL, "failed to create tooltip wnd\n");
1080
1082 ok(!ret, "got %d\n", ret);
1083
1084 SetRect(&r, -1, -1, 1, 1);
1086 ok(!ret, "got %d\n", ret);
1087
1088 SetRectEmpty(&r1);
1090 ok(!ret, "got %d\n", ret);
1091 ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));
1092
1094 ok(!ret, "got %d\n", ret);
1095
1096 SetRectEmpty(&r1);
1098 ok(!ret, "got %d\n", ret);
1099 ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));
1100
1102 ok(!ret, "got %d\n", ret);
1103
1105}
1106
1107static void test_TTM_ADDTOOL(BOOL is_v6)
1108{
1109 static const WCHAR testW[] = {'T','e','s','t',0};
1110 TTTOOLINFOW tiW;
1111 TTTOOLINFOA ti;
1112 int ret, size;
1113 HWND hwnd, parent;
1114 UINT max_size;
1115
1116 parent = CreateWindowExA(0, "Static", NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, 0);
1117 ok(parent != NULL, "failed to create parent wnd\n");
1118
1120 0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0);
1121 ok(hwnd != NULL, "Failed to create tooltip window.\n");
1122
1123 for (size = 0; size <= TTTOOLINFOW_V3_SIZE + 1; size++)
1124 {
1125 ti.cbSize = size;
1126 ti.hwnd = NULL;
1128 ti.uFlags = 0;
1129 ti.uId = 0x1234abce;
1130 ti.lpszText = (LPSTR)"Test";
1131 ti.lParam = 0xdeadbeef;
1132 GetClientRect(hwnd, &ti.rect);
1133
1135 ok(ret, "Failed to add a tool, size %d.\n", size);
1136
1138 ok(ret == 1, "Unexpected tool count %d, size %d.\n", ret, size);
1139
1141 ok(!ret, "Unexpected ret value %d.\n", ret);
1142
1144 ok(ret == 0, "Unexpected tool count %d, size %d.\n", ret, size);
1145 }
1146
1147 /* W variant checks cbSize. */
1149 for (size = 0; size <= max_size + 1; size++)
1150 {
1151 tiW.cbSize = size;
1152 tiW.hwnd = NULL;
1154 tiW.uFlags = 0;
1155 tiW.uId = 0x1234abce;
1156 tiW.lpszText = (LPWSTR)testW;
1157 tiW.lParam = 0xdeadbeef;
1158 GetClientRect(hwnd, &tiW.rect);
1159
1160 ret = SendMessageA(hwnd, TTM_ADDTOOLW, 0, (LPARAM)&tiW);
1161 todo_wine_if(!is_v6 && size > max_size)
1162 ok(size <= max_size ? ret : !ret, "%d: Unexpected ret value %d, size %d, max size %d.\n", is_v6, ret, size, max_size);
1163 if (ret)
1164 {
1166 ok(ret == 1, "Unexpected tool count %d.\n", ret);
1167
1168 ret = SendMessageA(hwnd, TTM_DELTOOLA, 0, (LPARAM)&tiW);
1169 ok(!ret, "Unexpected ret value %d.\n", ret);
1170
1172 ok(ret == 0, "Unexpected tool count %d.\n", ret);
1173 }
1174 }
1175
1177}
1178
1179static const struct message ttn_show_parent_seq[] =
1180{
1181 { WM_NOTIFY, sent|id, 0, 0, TTN_SHOW },
1182 { 0 }
1183};
1184
1185static void test_TTN_SHOW(void)
1186{
1187 HWND hwndTip, hwnd;
1188 TTTOOLINFOA ti;
1189 RECT rect;
1190 BOOL ret;
1191
1193 ok(hwnd != NULL, "Failed to create parent window.\n");
1194
1195 /* Put cursor outside the window */
1197 SetCursorPos(rect.right + 200, 0);
1198
1200 flush_events(100);
1201
1202 /* Create tooltip */
1203 hwndTip = CreateWindowExA(WS_EX_TOPMOST, TOOLTIPS_CLASSA, NULL, TTS_ALWAYSTIP, 10, 10, 300, 300,
1204 hwnd, NULL, NULL, 0);
1205 ok(hwndTip != NULL, "Failed to create tooltip window.\n");
1206
1208
1209 ti.cbSize = sizeof(TTTOOLINFOA);
1210 ti.hwnd = hwnd;
1212 ti.uFlags = TTF_SUBCLASS;
1213 ti.uId = 0x1234abcd;
1214 ti.lpszText = (LPSTR)"This is a test tooltip";
1215 ti.lParam = 0xdeadbeef;
1216 GetClientRect(hwnd, &ti.rect);
1217 ret = SendMessageA(hwndTip, TTM_ADDTOOLA, 0, (LPARAM)&ti);
1218 ok(ret, "Failed to add a tool.\n");
1219
1220 /* Make tooltip appear quickly */
1222
1224
1225 /* Put cursor inside window, tooltip will appear immediately */
1227 SetCursorPos((rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2);
1228 flush_events(200);
1229
1231
1232 DestroyWindow(hwndTip);
1234}
1235
1236START_TEST(tooltips)
1237{
1238 ULONG_PTR ctx_cookie;
1239 HANDLE hCtx;
1240
1242
1243 LoadLibraryA("comctl32.dll");
1244
1246
1249 test_gettext();
1253 test_track();
1255 test_margin();
1257 test_TTN_SHOW();
1258
1259 if (!load_v6_module(&ctx_cookie, &hCtx))
1260 return;
1261
1265 test_track();
1267 test_margin();
1269 test_TTN_SHOW();
1270
1271 unload_v6_module(ctx_cookie, hCtx);
1272}
#define broken(x)
Definition: _sntprintf.h:21
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
Arabic default style
Definition: afstyles.h:94
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define ARRAY_SIZE(a)
Definition: main.h:24
static INT max_size
Definition: history.c:51
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
@ sent
Definition: msg.h:34
@ defwinproc
Definition: msg.h:39
static void init_msg_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:391
#define ok_sequence(seq, index, exp, contx, todo)
Definition: msg.h:387
static void flush_sequences(struct msg_sequence **seq, int n)
Definition: msg.h:97
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CP_ACP
Definition: compat.h:109
#define CALLBACK
Definition: compat.h:35
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLuint id
Definition: glext.h:5910
static LRESULT WINAPI wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm32.c:183
char hdr[14]
Definition: iptest.cpp:33
static const WCHAR testW[]
Definition: jsregexp.c:44
#define b
Definition: ke_i.h:79
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
__u16 time
Definition: mkdosfs.c:8
static void flush_events(void)
Definition: animate.c:39
static UINT WPARAM wparam
Definition: combo.c:716
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
seq_index
Definition: edit.c:37
#define IDS_TBADD1
Definition: resources.h:27
static HWND create_parent_window(void)
Definition: tooltips.c:341
static void test_setinfo(BOOL is_v6)
Definition: tooltips.c:935
#define TEST_CDDS_ITEMPOSTPAINT
Definition: tooltips.c:105
static void test_gettext(void)
Definition: tooltips.c:351
#define TEST_CDDS_PREPAINT
Definition: tooltips.c:100
static void test_customdraw(void)
Definition: tooltips.c:149
#define TEST_CDDS_POSTPAINT
Definition: tooltips.c:101
@ NUM_MSG_SEQUENCES
Definition: tooltips.c:35
@ PARENT_SEQ_INDEX
Definition: tooltips.c:34
#define TEST_CDDS_PREERASE
Definition: tooltips.c:102
static void test_ttm_gettoolinfo(void)
Definition: tooltips.c:549
static BOOL almost_eq(int a, int b)
Definition: tooltips.c:865
static RECT g_ttip_rect
Definition: tooltips.c:276
static void test_longtextA(void)
Definition: tooltips.c:747
static void register_parent_wnd_class(void)
Definition: tooltips.c:322
static void test_track(void)
Definition: tooltips.c:870
#define TEST_CDDS_POSTERASE
Definition: tooltips.c:103
static void test_TTN_SHOW(void)
Definition: tooltips.c:1185
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: tooltips.c:277
static int CD_Stages
Definition: tooltips.c:96
#define TEST_CDDS_ITEMPOSTERASE
Definition: tooltips.c:107
static HWND g_hwnd
Definition: tooltips.c:98
#define TEST_CDDS_ITEMPREERASE
Definition: tooltips.c:106
static struct msg_sequence * sequences[NUM_MSG_SEQUENCES]
Definition: tooltips.c:38
static void test_margin(void)
Definition: tooltips.c:1070
static const struct message ttn_show_parent_seq[]
Definition: tooltips.c:1179
#define expect(expected, got)
Definition: tooltips.c:30
static const CHAR testcallbackA[]
Definition: tooltips.c:274
static LRESULT CD_Result
Definition: tooltips.c:97
static void test_longtextW(void)
Definition: tooltips.c:803
#define TEST_CDDS_ITEMPREPAINT
Definition: tooltips.c:104
static LRESULT CALLBACK info_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: tooltips.c:921
static void test_TTM_ADDTOOL(BOOL is_v6)
Definition: tooltips.c:1107
static void test_create_tooltip(BOOL is_v6)
Definition: tooltips.c:40
#define TEST_CDDS_SUBITEM
Definition: tooltips.c:108
static LRESULT CALLBACK custom_draw_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: tooltips.c:110
static const WCHAR textW[]
Definition: itemdlg.c:1559
static DNS_RECORDW r1
Definition: record.c:37
#define todo_wine_if(is_todo)
Definition: custom.c:76
#define todo_wine
Definition: custom.c:79
#define add_message(msg)
Definition: msg.c:2109
#define min(a, b)
Definition: monoChain.cc:55
int notify
Definition: msacm.c:1366
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_CAPTION
Definition: pedump.c:624
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_MAXIMIZE
Definition: pedump.c:623
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_BORDER
Definition: pedump.c:625
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_TOPMOST
Definition: pedump.c:647
long LONG
Definition: pedump.c:60
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define CDDS_ITEMPOSTPAINT
Definition: commctrl.h:286
#define TTM_SETDELAYTIME
Definition: commctrl.h:1785
#define TTN_GETDISPINFOA
Definition: commctrl.h:1872
#define CDDS_ITEMPOSTERASE
Definition: commctrl.h:288
#define CDRF_NOTIFYPOSTERASE
Definition: commctrl.h:277
#define TTN_SHOW
Definition: commctrl.h:1874
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:285
#define TTM_SETTOOLINFOA
Definition: commctrl.h:1797
#define CDDS_SUBITEM
Definition: commctrl.h:289
#define TTM_DELTOOLA
Definition: commctrl.h:1788
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:275
#define LPSTR_TEXTCALLBACKA
Definition: commctrl.h:2381
#define TTM_DELTOOLW
Definition: commctrl.h:1789
#define TTM_GETMARGIN
Definition: commctrl.h:1822
#define TTM_GETTOOLINFOA
Definition: commctrl.h:1794
#define CDRF_DODEFAULT
Definition: commctrl.h:268
#define TTM_GETTEXTW
Definition: commctrl.h:1803
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define TTTOOLINFOW_V1_SIZE
Definition: commctrl.h:1721
#define TTM_ADDTOOLA
Definition: commctrl.h:1786
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:274
#define TOOLTIPS_CLASSA
Definition: commctrl.h:1708
#define CDDS_POSTERASE
Definition: commctrl.h:283
#define TTM_ENUMTOOLSA
Definition: commctrl.h:1807
#define TTTOOLINFOW_V3_SIZE
Definition: commctrl.h:1725
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define TTM_ENUMTOOLSW
Definition: commctrl.h:1808
#define TTM_TRACKPOSITION
Definition: commctrl.h:1813
#define TTF_IDISHWND
Definition: commctrl.h:1764
#define TTF_SUBCLASS
Definition: commctrl.h:1767
#define TTM_GETTOOLCOUNT
Definition: commctrl.h:1806
#define TTM_ADDTOOLW
Definition: commctrl.h:1787
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define CDRF_NEWFONT
Definition: commctrl.h:269
#define TTM_GETCURRENTTOOLA
Definition: commctrl.h:1809
#define TTM_SETMARGIN
Definition: commctrl.h:1821
#define CDDS_PREPAINT
Definition: commctrl.h:280
#define TTF_ABSOLUTE
Definition: commctrl.h:1769
#define TTTOOLINFOA_V2_SIZE
Definition: commctrl.h:1722
#define TTM_SETTOOLINFOW
Definition: commctrl.h:1798
#define CDDS_POSTPAINT
Definition: commctrl.h:281
#define TTS_NOPREFIX
Definition: commctrl.h:1758
#define CDRF_SKIPDEFAULT
Definition: commctrl.h:270
#define TTF_TRACK
Definition: commctrl.h:1768
#define WC_STATICW
Definition: commctrl.h:4680
#define TTM_TRACKACTIVATE
Definition: commctrl.h:1812
#define CDDS_PREERASE
Definition: commctrl.h:282
#define TTM_GETTOOLINFOW
Definition: commctrl.h:1795
#define TTM_GETTEXTA
Definition: commctrl.h:1802
#define TTTOOLINFOA_V1_SIZE
Definition: commctrl.h:1720
#define CDDS_ITEMPREERASE
Definition: commctrl.h:287
#define TTDT_INITIAL
Definition: commctrl.h:1777
struct tagTOOLINFOA TTTOOLINFOA
#define TTTOOLINFOW_V2_SIZE
Definition: commctrl.h:1723
#define WM_NOTIFY
Definition: richedit.h:61
static __inline const char * wine_dbgstr_rect(const RECT *rect)
Definition: debug.h:219
#define memset(x, y, z)
Definition: compat.h:39
& rect
Definition: startmenu.cpp:1413
HBRUSH hbrBackground
Definition: winuser.h:3160
HICON hIcon
Definition: winuser.h:3158
HINSTANCE hInstance
Definition: winuser.h:3157
HCURSOR hCursor
Definition: winuser.h:3159
int cbWndExtra
Definition: winuser.h:3156
UINT style
Definition: winuser.h:3153
LPCSTR lpszMenuName
Definition: winuser.h:3161
LPCSTR lpszClassName
Definition: winuser.h:3162
WNDPROC lpfnWndProc
Definition: winuser.h:3154
int cbClsExtra
Definition: winuser.h:3155
Definition: inflate.c:139
Definition: tftpd.h:60
UINT message
Definition: msg.h:50
UINT_PTR idFrom
Definition: winuser.h:3148
HWND hwndFrom
Definition: winuser.h:3147
NMCUSTOMDRAW nmcd
Definition: commctrl.h:313
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LPARAM lParam
Definition: commctrl.h:1735
void * lpReserved
Definition: commctrl.h:1736
HINSTANCE hinst
Definition: commctrl.h:1733
LPSTR lpszText
Definition: commctrl.h:1734
UINT_PTR uId
Definition: commctrl.h:1731
HINSTANCE hinst
Definition: commctrl.h:1745
UINT_PTR uId
Definition: commctrl.h:1743
LPARAM lParam
Definition: commctrl.h:1747
LPWSTR lpszText
Definition: commctrl.h:1746
#define GWLP_WNDPROC
Definition: treelist.c:66
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
HANDLE HINSTANCE
Definition: typedefs.h:77
uint32_t ULONG_PTR
Definition: typedefs.h:65
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
Definition: v6util.h:71
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
Definition: v6util.h:63
int ret
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define CS_VREDRAW
Definition: winuser.h:653
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define COLOR_WINDOW
Definition: winuser.h:912
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define HWND_TOPMOST
Definition: winuser.h:1198
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define SWP_NOMOVE
Definition: winuser.h:1234
#define CS_HREDRAW
Definition: winuser.h:648
#define QS_ALLEVENTS
Definition: winuser.h:896
#define IDC_ARROW
Definition: winuser.h:682
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2639
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SWP_NOSIZE
Definition: winuser.h:1235
#define GetWindowLongPtrA
Definition: winuser.h:4818
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:2631
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
BOOL WINAPI IsWindowUnicode(_In_ HWND)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define PM_REMOVE
Definition: winuser.h:1186
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define CW_USEDEFAULT
Definition: winuser.h:225
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define WM_DESTROY
Definition: winuser.h:1599
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char CHAR
Definition: xmlstorage.h:175