Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f0509667
Commit
f0509667
authored
Sep 17, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Sep 17, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Unicode window messages.
parent
cfef4ade
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
27 deletions
+32
-27
tooltips.c
dlls/comctl32/tooltips.c
+32
-27
No files found.
dlls/comctl32/tooltips.c
View file @
f0509667
...
...
@@ -318,7 +318,7 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
ttnmdi
.
lParam
=
toolPtr
->
lParam
;
TRACE
(
"hdr.idFrom = %x
\n
"
,
ttnmdi
.
hdr
.
idFrom
);
SendMessage
A
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
SendMessage
W
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
(
WPARAM
)
toolPtr
->
uId
,
(
LPARAM
)
&
ttnmdi
);
if
(
HIWORD
((
UINT
)
ttnmdi
.
lpszText
)
==
0
)
{
...
...
@@ -522,7 +522,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr)
hdr
.
hwndFrom
=
hwnd
;
hdr
.
idFrom
=
toolPtr
->
uId
;
hdr
.
code
=
TTN_SHOW
;
SendMessage
A
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
SendMessage
W
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
(
WPARAM
)
toolPtr
->
uId
,
(
LPARAM
)
&
hdr
);
TRACE
(
"%s
\n
"
,
debugstr_w
(
infoPtr
->
szTipText
));
...
...
@@ -698,7 +698,7 @@ TOOLTIPS_Hide (HWND hwnd, TOOLTIPS_INFO *infoPtr)
hdr
.
hwndFrom
=
hwnd
;
hdr
.
idFrom
=
toolPtr
->
uId
;
hdr
.
code
=
TTN_POP
;
SendMessage
A
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
SendMessage
W
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
(
WPARAM
)
toolPtr
->
uId
,
(
LPARAM
)
&
hdr
);
infoPtr
->
nCurrentTool
=
-
1
;
...
...
@@ -736,7 +736,7 @@ TOOLTIPS_TrackShow (HWND hwnd, TOOLTIPS_INFO *infoPtr)
hdr
.
hwndFrom
=
hwnd
;
hdr
.
idFrom
=
toolPtr
->
uId
;
hdr
.
code
=
TTN_SHOW
;
SendMessage
A
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
SendMessage
W
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
(
WPARAM
)
toolPtr
->
uId
,
(
LPARAM
)
&
hdr
);
TRACE
(
"%s
\n
"
,
debugstr_w
(
infoPtr
->
szTipText
));
...
...
@@ -822,7 +822,7 @@ TOOLTIPS_TrackHide (HWND hwnd, TOOLTIPS_INFO *infoPtr)
hdr
.
hwndFrom
=
hwnd
;
hdr
.
idFrom
=
toolPtr
->
uId
;
hdr
.
code
=
TTN_POP
;
SendMessage
A
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
SendMessage
W
(
toolPtr
->
hwnd
,
WM_NOTIFY
,
(
WPARAM
)
toolPtr
->
uId
,
(
LPARAM
)
&
hdr
);
SetWindowPos
(
hwnd
,
HWND_TOP
,
0
,
0
,
0
,
0
,
...
...
@@ -936,7 +936,7 @@ TOOLTIPS_CheckTool (HWND hwnd, BOOL bShowTest)
INT
nTool
;
GetCursorPos
(
&
pt
);
hwndTool
=
(
HWND
)
SendMessage
A
(
hwnd
,
TTM_WINDOWFROMPOINT
,
0
,
(
LPARAM
)
&
pt
);
hwndTool
=
(
HWND
)
SendMessage
W
(
hwnd
,
TTM_WINDOWFROMPOINT
,
0
,
(
LPARAM
)
&
pt
);
if
(
hwndTool
==
0
)
return
-
1
;
...
...
@@ -1048,7 +1048,7 @@ TOOLTIPS_AddToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE
(
"subclassing installed!
\n
"
);
}
nResult
=
(
INT
)
SendMessage
A
(
toolPtr
->
hwnd
,
WM_NOTIFYFORMAT
,
nResult
=
(
INT
)
SendMessage
W
(
toolPtr
->
hwnd
,
WM_NOTIFYFORMAT
,
(
WPARAM
)
hwnd
,
(
LPARAM
)
NF_QUERY
);
if
(
nResult
==
NFR_ANSI
)
{
toolPtr
->
bNotifyUnicode
=
FALSE
;
...
...
@@ -1138,7 +1138,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE
(
"subclassing installed!
\n
"
);
}
nResult
=
(
INT
)
SendMessage
A
(
toolPtr
->
hwnd
,
WM_NOTIFYFORMAT
,
nResult
=
(
INT
)
SendMessage
W
(
toolPtr
->
hwnd
,
WM_NOTIFYFORMAT
,
(
WPARAM
)
hwnd
,
(
LPARAM
)
NF_QUERY
);
if
(
nResult
==
NFR_ANSI
)
{
toolPtr
->
bNotifyUnicode
=
FALSE
;
...
...
@@ -2415,7 +2415,7 @@ TOOLTIPS_NCHitTest (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
}
return
DefWindowProc
A
(
hwnd
,
WM_NCHITTEST
,
wParam
,
lParam
);
return
DefWindowProc
W
(
hwnd
,
WM_NCHITTEST
,
wParam
,
lParam
);
}
...
...
@@ -2464,8 +2464,9 @@ TOOLTIPS_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
return
0
;
}
/******************************************************************
* TOOLTIPS_
OnWM
GetTextLength
* TOOLTIPS_GetTextLength
*
* This function is called when the tooltip receive a
* WM_GETTEXTLENGTH message.
...
...
@@ -2473,12 +2474,12 @@ TOOLTIPS_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
* lParam : not used
*
* returns the length, in characters, of the tip text
*
*****************************************************************
/
*/
static
LRESULT
TOOLTIPS_
OnWM
GetTextLength
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
TOOLTIPS_GetTextLength
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TOOLTIPS_INFO
*
infoPtr
=
TOOLTIPS_GetInfoPtr
(
hwnd
);
return
l
strlenW
(
infoPtr
->
szTipText
);
return
strlenW
(
infoPtr
->
szTipText
);
}
/******************************************************************
...
...
@@ -2491,17 +2492,21 @@ TOOLTIPS_OnWMGetTextLength(HWND hwnd, WPARAM wParam, LPARAM lParam)
* the tip text
*
* returns the number of characters copied
*
*****************************************************************
/
*/
static
LRESULT
TOOLTIPS_OnWMGetText
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TOOLTIPS_INFO
*
infoPtr
=
TOOLTIPS_GetInfoPtr
(
hwnd
);
LRESULT
res
;
LPWSTR
pszText
=
(
LPWSTR
)
lParam
;
if
(
!
infoPtr
||
!
(
infoPtr
->
szTipText
)
)
if
(
!
infoPtr
->
szTipText
||
!
wParam
)
return
0
;
return
WideCharToMultiByte
(
CP_ACP
,
0
,
infoPtr
->
szTipText
,
-
1
,
(
LPSTR
)
lParam
,
wParam
,
NULL
,
NULL
);
res
=
min
(
strlenW
(
infoPtr
->
szTipText
)
+
1
,
wParam
);
memcpy
(
pszText
,
infoPtr
->
szTipText
,
res
*
sizeof
(
WCHAR
));
pszText
[
res
-
1
]
=
'\0'
;
return
res
-
1
;
}
static
LRESULT
...
...
@@ -2597,7 +2602,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
TRACE
(
"hwnd=%p msg=%x wparam=%x lParam=%lx
\n
"
,
hwnd
,
uMsg
,
wParam
,
lParam
);
if
(
!
TOOLTIPS_GetInfoPtr
(
hwnd
)
&&
(
uMsg
!=
WM_CREATE
)
&&
(
uMsg
!=
WM_NCCREATE
))
return
DefWindowProc
A
(
hwnd
,
uMsg
,
wParam
,
lParam
);
return
DefWindowProc
W
(
hwnd
,
uMsg
,
wParam
,
lParam
);
switch
(
uMsg
)
{
case
TTM_ACTIVATE
:
...
...
@@ -2741,7 +2746,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
TOOLTIPS_OnWMGetText
(
hwnd
,
wParam
,
lParam
);
case
WM_GETTEXTLENGTH
:
return
TOOLTIPS_
OnWM
GetTextLength
(
hwnd
,
wParam
,
lParam
);
return
TOOLTIPS_GetTextLength
(
hwnd
,
wParam
,
lParam
);
case
WM_LBUTTONDOWN
:
case
WM_LBUTTONUP
:
...
...
@@ -2777,7 +2782,7 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if
((
uMsg
>=
WM_USER
)
&&
(
uMsg
<
WM_APP
))
ERR
(
"unknown msg %04x wp=%08x lp=%08lx
\n
"
,
uMsg
,
wParam
,
lParam
);
return
DefWindowProc
A
(
hwnd
,
uMsg
,
wParam
,
lParam
);
return
DefWindowProc
W
(
hwnd
,
uMsg
,
wParam
,
lParam
);
}
return
0
;
}
...
...
@@ -2786,18 +2791,18 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID
TOOLTIPS_Register
(
void
)
{
WNDCLASS
A
wndClass
;
WNDCLASS
W
wndClass
;
ZeroMemory
(
&
wndClass
,
sizeof
(
WNDCLASS
A
));
ZeroMemory
(
&
wndClass
,
sizeof
(
WNDCLASS
W
));
wndClass
.
style
=
CS_GLOBALCLASS
|
CS_DBLCLKS
|
CS_SAVEBITS
;
wndClass
.
lpfnWndProc
=
(
WNDPROC
)
TOOLTIPS_WindowProc
;
wndClass
.
lpfnWndProc
=
TOOLTIPS_WindowProc
;
wndClass
.
cbClsExtra
=
0
;
wndClass
.
cbWndExtra
=
sizeof
(
TOOLTIPS_INFO
*
);
wndClass
.
hCursor
=
LoadCursor
A
(
0
,
(
LP
STR
)
IDC_ARROW
);
wndClass
.
hCursor
=
LoadCursor
W
(
0
,
(
LPW
STR
)
IDC_ARROW
);
wndClass
.
hbrBackground
=
0
;
wndClass
.
lpszClassName
=
TOOLTIPS_CLASS
A
;
wndClass
.
lpszClassName
=
TOOLTIPS_CLASS
W
;
RegisterClass
A
(
&
wndClass
);
RegisterClass
W
(
&
wndClass
);
hTooltipIcons
[
TTI_NONE
]
=
NULL
;
hTooltipIcons
[
TTI_INFO
]
=
LoadImageW
(
COMCTL32_hModule
,
...
...
@@ -2815,5 +2820,5 @@ TOOLTIPS_Unregister (void)
int
i
;
for
(
i
=
0
;
i
<
TTI_ERROR
+
1
;
i
++
)
DeleteObject
(
hTooltipIcons
[
i
]);
UnregisterClass
A
(
TOOLTIPS_CLASSA
,
NULL
);
UnregisterClass
W
(
TOOLTIPS_CLASSW
,
NULL
);
}
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