30#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
53 ok(
hwnd !=
NULL,
"failed to create tooltip wnd\n");
59 "wrong style %08x/%08x\n",
style, exp_style);
66 ok(
hwnd !=
NULL,
"failed to create tooltip wnd\n");
74 "Unexpected window style %#x.\n",
style);
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
153 } expectedResults[] = {
165 DWORD iterationNumber;
185 for (iterationNumber = 0;
186 iterationNumber <
ARRAY_SIZE(expectedResults);
200 ok(
parent !=
NULL,
"%d: Creation of main window failed\n", iterationNumber);
212 ok(hwndTip !=
NULL,
"%d: Creation of tooltip window failed\n", iterationNumber);
216 CD_Result = expectedResults[iterationNumber].FirstReturnValue;
228 toolInfo.
uId = 0x1234ABCD;
230 toolInfo.
lParam = 0xdeadbeef;
233 ok(
ret,
"%d: Failed to add the tool.\n", iterationNumber);
246 ok(
CD_Stages == expectedResults[iterationNumber].ExpectedCalls ||
248 "%d: CustomDraw stages %x, expected %x\n", iterationNumber,
CD_Stages,
249 expectedResults[iterationNumber].ExpectedCalls);
253 ok(
ret,
"%d: Failed to get current tool %#lx.\n", iterationNumber,
ret);
255 memset(&toolInfo, 0xcc,
sizeof(toolInfo));
256 toolInfo.
cbSize =
sizeof(toolInfo);
260 ok(toolInfo.
hwnd ==
parent,
"%d: Unexpected hwnd %p.\n", iterationNumber, toolInfo.
hwnd);
262 ok(toolInfo.
uId == 0x1234abcd,
"%d: Unexpected uId %lx.\n", iterationNumber, toolInfo.
uId);
263 ok(toolInfo.
lParam == 0,
"%d: Unexpected lParam %lx.\n", iterationNumber, toolInfo.
lParam);
264 ok(toolInfo.
lpReserved == (
void *)0xdeadbeef,
"%d: Unexpected lpReserved %p.\n", iterationNumber, toolInfo.
lpReserved);
279 static LONG defwndproc_counter = 0;
312 defwndproc_counter++;
317 defwndproc_counter--;
338 ok(
ret,
"Failed to register test parent class.\n");
344 "Tooltips test parent window",
353 static const CHAR testtip2A[] =
"testtip\ttest2";
354 static const CHAR testtipA[] =
"testtip";
360 WCHAR bufW[10] = { 0 };
364 ok(
notify !=
NULL,
"Expected notification window to be created\n");
370 ok(
hwnd !=
NULL,
"failed to create tooltip wnd\n");
378 toolinfoA.
uId = 0x1234ABCD;
380 toolinfoA.
lParam = 0xdeadbeef;
383 ok(
r,
"got %ld\n",
r);
386 toolinfoA.
uId = 0x1234abcd;
389 ok(!
r,
"got %ld\n",
r);
395 ok(!
r,
"got %ld\n",
r);
403 toolinfoA.
uId = 0x1233abcd;
405 toolinfoA.
lParam = 0xdeadbeef;
408 ok(
r,
"failed to add a tool\n");
411 toolinfoA.
uId = 0x1233abcd;
414 ok(!
r,
"got %ld\n",
r);
420 ok(!
r,
"got %ld\n",
r);
424 ok(!
r,
"got %ld\n",
r);
431 toolinfoA.
uId = 0x1235ABCD;
434 toolinfoA.
lParam = 0xdeadbeef;
437 ok(
r,
"Adding the tool to the tooltip failed\n");
443 toolinfoA.
uId = 0x1235abcd;
446 ok(!
r,
"got %ld\n",
r);
449 memset(bufA, 0x1f,
sizeof(bufA));
453 ok(!
r,
"got %ld\n",
r);
464 toolinfoA.
uId = 0x1236ABCD;
466 toolinfoA.
lParam = 0xdeadbeef;
469 ok(
r,
"Adding the tool to the tooltip failed\n");
472 toolinfoA.
uId = 0x1236abcd;
475 ok(!
r,
"got %ld\n",
r);
481 ok(!
r,
"got %ld\n",
r);
490 ok(
hwnd !=
NULL,
"failed to create tooltip wnd\n");
496 toolinfoW.
uId = 0x1234ABCD;
498 toolinfoW.
lParam = 0xdeadbeef;
504 ok(!
r,
"Adding the tool to the tooltip succeeded!\n");
509 toolinfoW.
uId = 0x1234ABCD;
512 ok(toolinfoW.lpszText[0] == 0,
"lpszText should be an empty string\n");
520 toolinfoA.
uId = 0x1235abce;
523 toolinfoA.
lParam = 0xdeadbeef;
526 ok(
r,
"got %ld\n",
r);
529 toolinfoA.
uId = 0x1235abce;
532 ok(!
r,
"got %ld\n",
r);
540 toolinfoA.
uId = 0x1235abce;
543 ok(!
r,
"got %ld\n",
r);
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");
568 ok(
r,
"Adding the tool to the tooltip failed\n");
573 ok(
r,
"Getting tooltip info failed\n");
576 "Expected 0x1abe11ed, got %lx\n", ti.
lParam);
580 tiW.
uId = 0x1234ABCD;
584 ok(
r,
"Getting tooltip info failed\n");
587 "Expected 0x1abe11ed, got %lx\n", tiW.
lParam);
597 ok(
r,
"Getting tooltip info failed\n");
600 "Expected 0x55555555, got %lx\n", ti.
lParam);
618 ok(
r,
"Adding the tool to the tooltip failed\n");
638 ok(
r,
"Adding the tool to the tooltip failed\n");
658 ok(
r,
"Adding the tool to the tooltip failed\n");
675 ok(
hwnd !=
NULL,
"Failed to create tooltip window.\n");
681 tiW.
uId = 0x1234ABCD;
686 ok(
r,
"Adding the tool to the tooltip failed\n");
692 tiW.
uId = 0x1234ABCD;
701 tiW.
uId = 0x1234ABCD;
706 ok(
r,
"Adding the tool to the tooltip failed\n");
712 tiW.
uId = 0x1234ABCD;
721 tiW.
uId = 0x1234ABCD;
726 ok(
r,
"Adding the tool to the tooltip failed\n");
732 tiW.
uId = 0x1234ABCD;
739 tiW.
uId = 0x1234ABCD;
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.";
764 toolinfoA.
uId = 0x1234ABCD;
767 toolinfoA.
lParam = 0xdeadbeef;
773 memset(bufA, 0,
sizeof(bufA));
775 toolinfoA.
uId = 0xABCD1234;
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);
783 memset(bufA, 0,
sizeof(bufA));
784 toolinfoA.hwnd =
NULL;
785 toolinfoA.uId = 0x1234ABCD;
786 toolinfoA.lpszText = bufA;
788 textlen =
lstrlenA(toolinfoA.lpszText);
789 ok(textlen == 80,
"lpszText has %d chars\n", textlen);
791 memset(bufA, 0,
sizeof(bufA));
792 toolinfoA.hwnd =
NULL;
793 toolinfoA.uId = 0x1234ABCD;
794 toolinfoA.lpszText = bufA;
796 textlen =
lstrlenA(toolinfoA.lpszText);
797 ok(textlen == 80,
"lpszText has %d chars\n", textlen);
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.";
817 ok(
hwnd !=
NULL,
"Failed to create tooltip window.\n");
823 toolinfoW.
uId = 0x1234ABCD;
827 toolinfoW.
lParam = 0xdeadbeef;
833 memset(bufW, 0,
sizeof(bufW));
835 toolinfoW.
uId = 0xABCD1234;
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);
843 memset(bufW, 0,
sizeof(bufW));
844 toolinfoW.hwnd =
NULL;
845 toolinfoW.uId = 0x1234ABCD;
846 toolinfoW.lpszText = bufW;
848 textlen =
lstrlenW(toolinfoW.lpszText);
849 ok(textlen == lenW,
"lpszText has %d chars\n", textlen);
851 memset(bufW, 0,
sizeof(bufW));
852 toolinfoW.hwnd =
NULL;
853 toolinfoW.uId = 0x1234ABCD;
854 toolinfoW.lpszText = bufW;
856 textlen =
lstrlenW(toolinfoW.lpszText);
857 ok(textlen == lenW ||
858 broken(textlen == 0 && toolinfoW.lpszText ==
NULL),
859 "lpszText has %d chars\n", textlen);
867 return a-5<
b &&
a+5>
b;
880 ok(
parent !=
NULL,
"creation of parent window failed\n");
888 ok(tt !=
NULL,
"creation of tooltip window failed\n");
899 ok(
res,
"adding the tool to the tooltip failed\n");
972 ok(parent2 !=
NULL,
"Creation of main window failed\n");
984 ok(hwndTip !=
NULL,
"Creation of tooltip window failed\n");
991 ok(hwndTip2 !=
NULL,
"Creation of tooltip window failed\n");
1003 toolInfo.
uId = 0x1234ABCD;
1005 toolInfo.
lParam = 0xdeadbeef;
1008 ok(lResult,
"Adding the tool to the tooltip failed\n");
1011 toolInfo.
hwnd = parent2;
1014 toolInfo.
uId = 0x1234ABCE;
1016 toolInfo.
lParam = 0xdeadbeef;
1019 ok(lResult,
"Adding the tool to the tooltip failed\n");
1024 toolInfo2.
uId = 0x1234ABCD;
1026 ok(lResult,
"GetToolInfo failed\n");
1028 "uFlags does not have subclass\n");
1032 toolInfo2.
uFlags &= ~TTF_SUBCLASS;
1035 ok(lResult,
"GetToolInfo failed\n");
1047 toolInfo2.
hwnd = parent2;
1048 toolInfo2.
uId = 0x1234ABCE;
1050 ok(lResult,
"GetToolInfo failed\n");
1058 ok(lResult,
"GetToolInfo failed\n");
1079 ok(
hwnd !=
NULL,
"failed to create tooltip wnd\n");
1109 static const WCHAR testW[] = {
'T',
'e',
's',
't',0};
1116 parent =
CreateWindowExA(0,
"Static",
NULL,
WS_POPUP, 0, 0, 0, 0,
NULL,
NULL,
NULL, 0);
1121 ok(
hwnd !=
NULL,
"Failed to create tooltip window.\n");
1129 ti.
uId = 0x1234abce;
1135 ok(
ret,
"Failed to add a tool, size %d.\n",
size);
1138 ok(
ret == 1,
"Unexpected tool count %d, size %d.\n",
ret,
size);
1141 ok(!
ret,
"Unexpected ret value %d.\n",
ret);
1144 ok(
ret == 0,
"Unexpected tool count %d, size %d.\n",
ret,
size);
1155 tiW.
uId = 0x1234abce;
1166 ok(
ret == 1,
"Unexpected tool count %d.\n",
ret);
1169 ok(!
ret,
"Unexpected ret value %d.\n",
ret);
1172 ok(
ret == 0,
"Unexpected tool count %d.\n",
ret);
1193 ok(
hwnd !=
NULL,
"Failed to create parent window.\n");
1205 ok(hwndTip !=
NULL,
"Failed to create tooltip window.\n");
1213 ti.
uId = 0x1234abcd;
1218 ok(
ret,
"Failed to add a tool.\n");
int strcmp(const char *String1, const char *String2)
char * strcpy(char *DstString, const char *SrcString)
static const char * wine_dbgstr_rect(const RECT *prc)
static void init_msg_sequences(struct msg_sequence **seq, int n)
static void flush_sequences(struct msg_sequence **seq, int n)
#define MultiByteToWideChar
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetTickCount(VOID)
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
static LRESULT WINAPI wndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static const WCHAR testW[]
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
static const WCHAR textW[]
#define todo_wine_if(is_todo)
unsigned __int3264 UINT_PTR
#define CDDS_ITEMPOSTPAINT
#define CDDS_ITEMPOSTERASE
#define CDRF_NOTIFYPOSTERASE
#define CDDS_ITEMPREPAINT
#define CDRF_NOTIFYITEMDRAW
#define LPSTR_TEXTCALLBACKA
#define TTTOOLINFOW_V1_SIZE
#define CDRF_NOTIFYPOSTPAINT
#define TTTOOLINFOW_V3_SIZE
#define TTM_TRACKPOSITION
#define TTM_GETCURRENTTOOLA
#define TTTOOLINFOA_V2_SIZE
#define TTM_TRACKACTIVATE
#define TTTOOLINFOA_V1_SIZE
#define CDDS_ITEMPREERASE
struct tagTOOLINFOA TTTOOLINFOA
#define TTTOOLINFOW_V2_SIZE
TW_UINT32 TW_UINT16 TW_UINT16 MSG
static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx)
static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx)
HGDIOBJ WINAPI GetStockObject(_In_ int)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
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)
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)
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)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GetWindowLongPtrA
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
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)
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)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define MAKEINTRESOURCEA(i)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
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)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)