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
3606dc55
Commit
3606dc55
authored
Nov 15, 2000
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 15, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added mapping to/from unicode for WM_CHAR, WM_DEADCHAR, WM_SYSCHAR,
WM_SYSDEADCHAR messages.
parent
7f126019
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
14 deletions
+66
-14
winproc.h
include/winproc.h
+2
-2
message.c
windows/message.c
+4
-3
winproc.c
windows/winproc.c
+60
-9
No files found.
include/winproc.h
View file @
3606dc55
...
...
@@ -48,9 +48,9 @@ extern BOOL WINPROC_SetProc( HWINDOWPROC *pFirst, WNDPROC16 func,
extern
void
WINPROC_FreeProc
(
HWINDOWPROC
proc
,
WINDOWPROCUSER
user
);
extern
WINDOWPROCTYPE
WINPROC_GetProcType
(
HWINDOWPROC
proc
);
extern
INT
WINPROC_MapMsg32ATo32W
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wP
aram
,
extern
INT
WINPROC_MapMsg32ATo32W
(
HWND
hwnd
,
UINT
msg
,
WPARAM
*
pwp
aram
,
LPARAM
*
plparam
);
extern
INT
WINPROC_MapMsg32WTo32A
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wP
aram
,
extern
INT
WINPROC_MapMsg32WTo32A
(
HWND
hwnd
,
UINT
msg
,
WPARAM
*
pwp
aram
,
LPARAM
*
plparam
);
extern
INT
WINPROC_MapMsg16To32A
(
UINT16
msg16
,
WPARAM16
wParam16
,
UINT
*
pmsg32
,
WPARAM
*
pwparam32
,
...
...
windows/message.c
View file @
3606dc55
...
...
@@ -1083,7 +1083,7 @@ static BOOL MSG_ConvertMsg( MSG *msg, int srcType, int dstType )
}
case
MAKELONG
(
QMSG_WIN32A
,
QMSG_WIN32W
):
switch
(
WINPROC_MapMsg32ATo32W
(
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
&
msg
->
lParam
)
)
switch
(
WINPROC_MapMsg32ATo32W
(
msg
->
hwnd
,
msg
->
message
,
&
msg
->
wParam
,
&
msg
->
lParam
)
)
{
case
0
:
return
TRUE
;
...
...
@@ -1095,7 +1095,7 @@ static BOOL MSG_ConvertMsg( MSG *msg, int srcType, int dstType )
}
case
MAKELONG
(
QMSG_WIN32W
,
QMSG_WIN32A
):
switch
(
WINPROC_MapMsg32WTo32A
(
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
&
msg
->
lParam
)
)
switch
(
WINPROC_MapMsg32WTo32A
(
msg
->
hwnd
,
msg
->
message
,
&
msg
->
wParam
,
&
msg
->
lParam
)
)
{
case
0
:
return
TRUE
;
...
...
@@ -1185,7 +1185,8 @@ static BOOL MSG_PeekMessage( int type, LPMSG msg, HWND hwnd,
MSG
tmpMsg
=
qmsg
->
msg
;
if
(
!
MSG_ConvertMsg
(
&
tmpMsg
,
qmsg
->
type
,
type
)
)
{
ERR
(
"Message of wrong type contains pointer parameters. Skipped!
\n
"
);
ERR
(
"Message %s of wrong type contains pointer parameters. Skipped!
\n
"
,
SPY_GetMsgName
(
tmpMsg
.
message
));
QUEUE_RemoveMsg
(
msgQueue
,
qmsg
);
goto
retry
;
}
...
...
windows/winproc.c
View file @
3606dc55
...
...
@@ -546,21 +546,21 @@ static BOOL WINPROC_TestLBForStr ( HWND hwnd )
* Return value is -1 on error, 0 if OK, 1 if an UnmapMsg call is needed.
*
* FIXME:
* WM_CHAR
, WM_CHARTOITEM, WM_DEADCHAR, WM_MENUCHAR, WM_SYSCHAR, WM_SYSDEAD
CHAR
* WM_CHAR
TOITEM, WM_MENU
CHAR
*
* FIXME:
* WM_GETTEXT/WM_SETTEXT and static control with SS_ICON style:
* the first four bytes are the handle of the icon
* when the WM_SETTEXT message has been used to set the icon
*/
INT
WINPROC_MapMsg32ATo32W
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wP
aram
,
LPARAM
*
plparam
)
INT
WINPROC_MapMsg32ATo32W
(
HWND
hwnd
,
UINT
msg
,
WPARAM
*
pwp
aram
,
LPARAM
*
plparam
)
{
switch
(
msg
)
{
case
WM_GETTEXT
:
{
LPARAM
*
ptr
=
(
LPARAM
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
wP
aram
*
sizeof
(
WCHAR
)
+
sizeof
(
LPARAM
)
);
*
pwp
aram
*
sizeof
(
WCHAR
)
+
sizeof
(
LPARAM
)
);
if
(
!
ptr
)
return
-
1
;
*
ptr
++
=
*
plparam
;
/* Store previous lParam */
*
plparam
=
(
LPARAM
)
ptr
;
...
...
@@ -663,6 +663,18 @@ INT WINPROC_MapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM *plparam
}
return
1
;
case
WM_CHAR
:
case
WM_DEADCHAR
:
case
WM_SYSCHAR
:
case
WM_SYSDEADCHAR
:
{
char
ch
=
*
pwparam
;
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
ch
,
1
,
&
wch
,
1
);
*
pwparam
=
wch
;
}
return
0
;
case
WM_ASKCBFORMATNAME
:
case
WM_DEVMODECHANGE
:
case
WM_PAINTCLIPBOARD
:
...
...
@@ -783,13 +795,14 @@ void WINPROC_UnmapMsg32ATo32W( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
* Map a message from Unicode to Ansi.
* Return value is -1 on error, 0 if OK, 1 if an UnmapMsg call is needed.
*/
INT
WINPROC_MapMsg32WTo32A
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
*
plparam
)
{
switch
(
msg
)
INT
WINPROC_MapMsg32WTo32A
(
HWND
hwnd
,
UINT
msg
,
WPARAM
*
pwparam
,
LPARAM
*
plparam
)
{
switch
(
msg
)
{
case
WM_GETTEXT
:
{
LPARAM
*
ptr
=
(
LPARAM
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
wP
aram
+
sizeof
(
LPARAM
)
);
*
pwp
aram
+
sizeof
(
LPARAM
)
);
if
(
!
ptr
)
return
-
1
;
*
ptr
++
=
*
plparam
;
/* Store previous lParam */
*
plparam
=
(
LPARAM
)
ptr
;
...
...
@@ -887,6 +900,18 @@ INT WINPROC_MapMsg32WTo32A( HWND hwnd, UINT msg, WPARAM wParam, LPARAM *plparam
}
return
1
;
case
WM_CHAR
:
case
WM_DEADCHAR
:
case
WM_SYSCHAR
:
case
WM_SYSDEADCHAR
:
{
WCHAR
wch
=
*
pwparam
;
char
ch
;
WideCharToMultiByte
(
CP_ACP
,
0
,
&
wch
,
1
,
&
ch
,
1
,
NULL
,
NULL
);
*
pwparam
=
ch
;
}
return
0
;
case
WM_ASKCBFORMATNAME
:
case
WM_DEVMODECHANGE
:
case
WM_PAINTCLIPBOARD
:
...
...
@@ -1380,7 +1405,7 @@ INT WINPROC_MapMsg16To32W( HWND16 hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *p
case
WM_GETTEXT
:
case
WM_SETTEXT
:
*
plparam
=
(
LPARAM
)
PTR_SEG_TO_LIN
(
*
plparam
);
return
WINPROC_MapMsg32ATo32W
(
hwnd
,
*
pmsg32
,
*
pwparam32
,
plparam
);
return
WINPROC_MapMsg32ATo32W
(
hwnd
,
*
pmsg32
,
pwparam32
,
plparam
);
case
WM_NCCREATE
:
case
WM_CREATE
:
{
...
...
@@ -1444,6 +1469,19 @@ INT WINPROC_MapMsg16To32W( HWND16 hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *p
return
1
;
}
else
return
0
;
case
WM_CHAR
:
case
WM_DEADCHAR
:
case
WM_SYSCHAR
:
case
WM_SYSDEADCHAR
:
{
char
ch
=
wParam16
;
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
ch
,
1
,
&
wch
,
1
);
*
pwparam32
=
wch
;
}
return
0
;
default:
/* No Unicode translation needed */
return
WINPROC_MapMsg16To32A
(
msg16
,
wParam16
,
pmsg32
,
pwparam32
,
plparam
);
...
...
@@ -2219,6 +2257,19 @@ INT WINPROC_MapMsg32WTo16( HWND hwnd, UINT msg32, WPARAM wParam32,
*
plparam
=
(
LPARAM
)
SEGPTR_GET
(
str
);
}
return
1
;
case
WM_CHAR
:
case
WM_DEADCHAR
:
case
WM_SYSCHAR
:
case
WM_SYSDEADCHAR
:
{
WCHAR
wch
=
wParam32
;
char
ch
;
WideCharToMultiByte
(
CP_ACP
,
0
,
&
wch
,
1
,
&
ch
,
1
,
NULL
,
NULL
);
*
pwparam16
=
ch
;
}
return
0
;
default:
/* No Unicode translation needed (?) */
return
WINPROC_MapMsg32ATo16
(
hwnd
,
msg32
,
wParam32
,
pmsg16
,
pwparam16
,
plparam
);
...
...
@@ -2271,7 +2322,7 @@ static LRESULT WINPROC_CallProc32ATo32W( WNDPROC func, HWND hwnd,
{
LRESULT
result
;
if
(
WINPROC_MapMsg32ATo32W
(
hwnd
,
msg
,
wParam
,
&
lParam
)
==
-
1
)
return
0
;
if
(
WINPROC_MapMsg32ATo32W
(
hwnd
,
msg
,
&
wParam
,
&
lParam
)
==
-
1
)
return
0
;
result
=
WINPROC_CallWndProc
(
func
,
hwnd
,
msg
,
wParam
,
lParam
);
WINPROC_UnmapMsg32ATo32W
(
hwnd
,
msg
,
wParam
,
lParam
);
return
result
;
...
...
@@ -2289,7 +2340,7 @@ static LRESULT WINPROC_CallProc32WTo32A( WNDPROC func, HWND hwnd,
{
LRESULT
result
;
if
(
WINPROC_MapMsg32WTo32A
(
hwnd
,
msg
,
wParam
,
&
lParam
)
==
-
1
)
return
0
;
if
(
WINPROC_MapMsg32WTo32A
(
hwnd
,
msg
,
&
wParam
,
&
lParam
)
==
-
1
)
return
0
;
result
=
WINPROC_CallWndProc
(
func
,
hwnd
,
msg
,
wParam
,
lParam
);
WINPROC_UnmapMsg32WTo32A
(
hwnd
,
msg
,
wParam
,
lParam
);
return
result
;
...
...
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