Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b48f394e
Commit
b48f394e
authored
Apr 12, 2012
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Apr 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Add support for retrieving lpszText in TOOLINFO structure.
parent
40456f4b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
tooltips.c
dlls/comctl32/tests/tooltips.c
+16
-0
tooltips.c
dlls/comctl32/tooltips.c
+19
-8
No files found.
dlls/comctl32/tests/tooltips.c
View file @
b48f394e
...
...
@@ -322,6 +322,11 @@ static void test_gettext(void)
toolinfoA
.
lpszText
=
bufA
;
SendMessageA
(
hwnd
,
TTM_GETTEXTA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
strcmp
(
toolinfoA
.
lpszText
,
""
)
==
0
,
"lpszText should be an empty string
\n
"
);
toolinfoA
.
lpszText
=
bufA
;
SendMessageA
(
hwnd
,
TTM_GETTOOLINFOA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
toolinfoA
.
lpszText
==
NULL
,
"expected NULL, got %p"
,
toolinfoA
.
lpszText
);
}
else
{
...
...
@@ -355,6 +360,12 @@ static void test_gettext(void)
SendMessageA
(
hwnd
,
TTM_GETTEXTA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
strcmp
(
toolinfoA
.
lpszText
,
testtipA
)
==
0
,
"lpszText should be an empty string
\n
"
);
memset
(
bufA
,
0x1f
,
sizeof
(
bufA
));
toolinfoA
.
lpszText
=
bufA
;
SendMessageA
(
hwnd
,
TTM_GETTOOLINFOA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
strcmp
(
toolinfoA
.
lpszText
,
testtipA
)
==
0
,
"expected %s, got %p
\n
"
,
testtipA
,
toolinfoA
.
lpszText
);
length
=
SendMessage
(
hwnd
,
WM_GETTEXTLENGTH
,
0
,
0
);
ok
(
length
==
0
,
"Expected 0, got %d
\n
"
,
length
);
}
...
...
@@ -378,6 +389,11 @@ static void test_gettext(void)
SendMessageA
(
hwnd
,
TTM_GETTEXTA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
strcmp
(
toolinfoA
.
lpszText
,
testcallbackA
)
==
0
,
"lpszText should be an (%s) string
\n
"
,
testcallbackA
);
toolinfoA
.
lpszText
=
bufA
;
SendMessageA
(
hwnd
,
TTM_GETTOOLINFOA
,
0
,
(
LPARAM
)
&
toolinfoA
);
ok
(
toolinfoA
.
lpszText
==
LPSTR_TEXTCALLBACKA
,
"expected LPSTR_TEXTCALLBACKA, got %p
\n
"
,
toolinfoA
.
lpszText
);
}
DestroyWindow
(
hwnd
);
...
...
dlls/comctl32/tooltips.c
View file @
b48f394e
...
...
@@ -943,6 +943,21 @@ TOOLTIPS_GetToolFromPoint (const TOOLTIPS_INFO *infoPtr, HWND hwnd, const POINT
return
-
1
;
}
static
inline
void
TOOLTIPS_CopyInfoT
(
const
TTTOOL_INFO
*
toolPtr
,
TTTOOLINFOW
*
ti
,
BOOL
isW
)
{
if
(
ti
->
lpszText
)
{
if
(
toolPtr
->
lpszText
==
NULL
||
IS_INTRESOURCE
(
toolPtr
->
lpszText
)
||
toolPtr
->
lpszText
==
LPSTR_TEXTCALLBACKW
)
ti
->
lpszText
=
toolPtr
->
lpszText
;
else
if
(
isW
)
strcpyW
(
ti
->
lpszText
,
toolPtr
->
lpszText
);
else
WideCharToMultiByte
(
CP_ACP
,
0
,
toolPtr
->
lpszText
,
-
1
,
(
LPSTR
)
ti
->
lpszText
,
INFOTIPSIZE
,
NULL
,
NULL
);
}
}
static
BOOL
TOOLTIPS_IsWindowActive
(
HWND
hwnd
)
...
...
@@ -1199,8 +1214,7 @@ TOOLTIPS_EnumToolsT (const TOOLTIPS_INFO *infoPtr, UINT uIndex, TTTOOLINFOW *ti,
ti
->
uId
=
toolPtr
->
uId
;
ti
->
rect
=
toolPtr
->
rect
;
ti
->
hinst
=
toolPtr
->
hinst
;
/* ti->lpszText = toolPtr->lpszText; */
ti
->
lpszText
=
NULL
;
/* FIXME */
TOOLTIPS_CopyInfoT
(
toolPtr
,
ti
,
isW
);
if
(
ti
->
cbSize
>=
TTTOOLINFOA_V2_SIZE
)
ti
->
lParam
=
toolPtr
->
lParam
;
...
...
@@ -1246,8 +1260,7 @@ TOOLTIPS_GetCurrentToolT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL is
ti
->
uFlags
=
toolPtr
->
uFlags
;
ti
->
rect
=
toolPtr
->
rect
;
ti
->
hinst
=
toolPtr
->
hinst
;
/* ti->lpszText = toolPtr->lpszText; */
ti
->
lpszText
=
NULL
;
/* FIXME */
TOOLTIPS_CopyInfoT
(
toolPtr
,
ti
,
isW
);
if
(
ti
->
cbSize
>=
TTTOOLINFOW_V2_SIZE
)
ti
->
lParam
=
toolPtr
->
lParam
;
...
...
@@ -1385,8 +1398,7 @@ TOOLTIPS_GetToolInfoT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
ti
->
uFlags
=
toolPtr
->
uFlags
;
ti
->
rect
=
toolPtr
->
rect
;
ti
->
hinst
=
toolPtr
->
hinst
;
/* lpToolInfo->lpszText = toolPtr->lpszText; */
ti
->
lpszText
=
NULL
;
/* FIXME */
TOOLTIPS_CopyInfoT
(
toolPtr
,
ti
,
isW
);
if
(
ti
->
cbSize
>=
TTTOOLINFOW_V2_SIZE
)
ti
->
lParam
=
toolPtr
->
lParam
;
...
...
@@ -1420,8 +1432,7 @@ TOOLTIPS_HitTestT (const TOOLTIPS_INFO *infoPtr, LPTTHITTESTINFOW lptthit,
lptthit
->
ti
.
uId
=
toolPtr
->
uId
;
lptthit
->
ti
.
rect
=
toolPtr
->
rect
;
lptthit
->
ti
.
hinst
=
toolPtr
->
hinst
;
/* lptthit->ti.lpszText = toolPtr->lpszText; */
lptthit
->
ti
.
lpszText
=
NULL
;
/* FIXME */
TOOLTIPS_CopyInfoT
(
toolPtr
,
&
lptthit
->
ti
,
isW
);
if
(
lptthit
->
ti
.
cbSize
>=
TTTOOLINFOW_V2_SIZE
)
lptthit
->
ti
.
lParam
=
toolPtr
->
lParam
;
}
...
...
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