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
b1267aec
Commit
b1267aec
authored
Oct 19, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make TranslateAcceleratorA handle national characters.
parent
109f41aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
14 deletions
+69
-14
menu.c
dlls/user/menu.c
+67
-12
user32.spec
dlls/user/user32.spec
+2
-2
No files found.
dlls/user/menu.c
View file @
b1267aec
...
...
@@ -4678,33 +4678,88 @@ static BOOL translate_accelerator( HWND hWnd, UINT message, WPARAM wParam, LPARA
/**********************************************************************
* TranslateAccelerator (USER32.@)
* TranslateAcceleratorA (USER32.@)
* TranslateAcceleratorW (USER32.@)
*/
INT
WINAPI
TranslateAccelerator
W
(
HWND
hWnd
,
HACCEL
hAccel
,
LPMSG
msg
)
INT
WINAPI
TranslateAccelerator
A
(
HWND
hWnd
,
HACCEL
hAccel
,
LPMSG
msg
)
{
/* YES, Accel16! */
LPACCEL16
lpAccelTbl
;
int
i
;
WPARAM
wParam
;
if
(
!
hWnd
||
!
msg
)
return
0
;
if
(
!
hAccel
||
!
(
lpAccelTbl
=
(
LPACCEL16
)
LockResource16
(
HACCEL_16
(
hAccel
))))
{
WARN_
(
accel
)(
"invalid accel handle=%p
\n
"
,
hAccel
);
return
0
;
}
if
(
msg
==
NULL
)
wParam
=
msg
->
wParam
;
switch
(
msg
->
message
)
{
WARN_
(
accel
)(
"msg null; should hang here to be win compatible
\n
"
);
case
WM_KEYDOWN
:
case
WM_SYSKEYDOWN
:
break
;
case
WM_CHAR
:
case
WM_SYSCHAR
:
{
char
ch
=
LOWORD
(
wParam
);
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
ch
,
1
,
&
wch
,
1
);
wParam
=
MAKEWPARAM
(
wch
,
HIWORD
(
wParam
));
}
break
;
default:
return
0
;
}
TRACE_
(
accel
)(
"hAccel %p, hWnd %p, msg->hwnd %p, msg->message %04x, wParam %08x, lParam %08lx
\n
"
,
hAccel
,
hWnd
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
i
=
0
;
do
{
if
(
translate_accelerator
(
hWnd
,
msg
->
message
,
wParam
,
msg
->
lParam
,
lpAccelTbl
[
i
].
fVirt
,
lpAccelTbl
[
i
].
key
,
lpAccelTbl
[
i
].
cmd
))
return
1
;
}
while
((
lpAccelTbl
[
i
++
].
fVirt
&
0x80
)
==
0
);
return
0
;
}
/**********************************************************************
* TranslateAcceleratorW (USER32.@)
*/
INT
WINAPI
TranslateAcceleratorW
(
HWND
hWnd
,
HACCEL
hAccel
,
LPMSG
msg
)
{
/* YES, Accel16! */
LPACCEL16
lpAccelTbl
;
int
i
;
if
(
!
hWnd
||
!
msg
)
return
0
;
if
(
!
hAccel
||
!
(
lpAccelTbl
=
(
LPACCEL16
)
LockResource16
(
HACCEL_16
(
hAccel
))))
{
WARN_
(
accel
)(
"invalid accel handle=%p
\n
"
,
hAccel
);
return
0
;
}
if
(
msg
->
message
!=
WM_KEYDOWN
&&
msg
->
message
!=
WM_SYSKEYDOWN
&&
msg
->
message
!=
WM_SYSCHAR
&&
msg
->
message
!=
WM_CHAR
)
return
0
;
TRACE_
(
accel
)(
"TranslateAccelerators hAccel=%p, hWnd=%p,"
"msg->hwnd=%p, msg->message=%04x, wParam=%08x, lParam=%lx
\n
"
,
hAccel
,
hWnd
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
switch
(
msg
->
message
)
{
case
WM_KEYDOWN
:
case
WM_SYSKEYDOWN
:
case
WM_CHAR
:
case
WM_SYSCHAR
:
break
;
default:
return
0
;
}
TRACE_
(
accel
)(
"hAccel %p, hWnd %p, msg->hwnd %p, msg->message %04x, wParam %08x, lParam %08lx
\n
"
,
hAccel
,
hWnd
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
msg
->
lParam
);
i
=
0
;
do
{
...
...
@@ -4712,6 +4767,6 @@ INT WINAPI TranslateAcceleratorW( HWND hWnd, HACCEL hAccel, LPMSG msg )
lpAccelTbl
[
i
].
fVirt
,
lpAccelTbl
[
i
].
key
,
lpAccelTbl
[
i
].
cmd
))
return
1
;
}
while
((
lpAccelTbl
[
i
++
].
fVirt
&
0x80
)
==
0
);
WARN_
(
accel
)(
"couldn't translate accelerator key
\n
"
);
return
0
;
}
dlls/user/user32.spec
View file @
b1267aec
...
...
@@ -586,8 +586,8 @@
@ stdcall ToUnicode(long long ptr wstr long long)
@ stdcall TrackPopupMenu(long long long long long long ptr)
@ stdcall TrackPopupMenuEx(long long long long long ptr)
@ stdcall TranslateAccelerator(long long ptr) TranslateAccelerator
W
@ stdcall TranslateAcceleratorA(long long ptr)
TranslateAcceleratorW
@ stdcall TranslateAccelerator(long long ptr) TranslateAccelerator
A
@ stdcall TranslateAcceleratorA(long long ptr)
@ stdcall TranslateAcceleratorW(long long ptr)
@ stdcall TranslateMDISysAccel(long ptr)
@ stdcall TranslateMessage(ptr)
...
...
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