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
c8a4bb8f
Commit
c8a4bb8f
authored
Apr 07, 2008
by
Lei Zhang
Committed by
Alexandre Julliard
Apr 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix WM_CHAR return value for edit controls.
parent
42d32aba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
edit.c
dlls/user32/edit.c
+5
-4
edit.c
dlls/user32/tests/edit.c
+16
-9
No files found.
dlls/user32/edit.c
View file @
c8a4bb8f
...
...
@@ -257,7 +257,7 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es);
/*
* WM_XXX message handlers
*/
static
void
EDIT_WM_Char
(
EDITSTATE
*
es
,
WCHAR
c
);
static
LRESULT
EDIT_WM_Char
(
EDITSTATE
*
es
,
WCHAR
c
);
static
void
EDIT_WM_Command
(
EDITSTATE
*
es
,
INT
code
,
INT
id
,
HWND
conrtol
);
static
void
EDIT_WM_ContextMenu
(
EDITSTATE
*
es
,
INT
x
,
INT
y
);
static
void
EDIT_WM_Copy
(
EDITSTATE
*
es
);
...
...
@@ -834,7 +834,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
strng
[
1
]
=
wParam
&
0xff
;
if
(
strng
[
0
])
MultiByteToWideChar
(
CP_ACP
,
0
,
strng
,
2
,
&
charW
,
1
);
else
MultiByteToWideChar
(
CP_ACP
,
0
,
&
strng
[
1
],
1
,
&
charW
,
1
);
EDIT_WM_Char
(
es
,
charW
);
result
=
EDIT_WM_Char
(
es
,
charW
);
break
;
}
/* fall through */
...
...
@@ -866,7 +866,7 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
if
(
charW
==
VK_TAB
||
charW
==
VK_RETURN
)
break
;
}
EDIT_WM_Char
(
es
,
charW
);
result
=
EDIT_WM_Char
(
es
,
charW
);
break
;
}
...
...
@@ -3994,7 +3994,7 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es)
* WM_CHAR
*
*/
static
void
EDIT_WM_Char
(
EDITSTATE
*
es
,
WCHAR
c
)
static
LRESULT
EDIT_WM_Char
(
EDITSTATE
*
es
,
WCHAR
c
)
{
BOOL
control
;
...
...
@@ -4065,6 +4065,7 @@ static void EDIT_WM_Char(EDITSTATE *es, WCHAR c)
}
break
;
}
return
1
;
}
...
...
dlls/user32/tests/edit.c
View file @
c8a4bb8f
...
...
@@ -731,6 +731,7 @@ static void test_edit_control_2(void)
{
HWND
hwndMain
;
char
szLocalString
[
MAXLEN
];
LONG
r
;
/* Create main and edit windows. */
hwndMain
=
CreateWindow
(
szEditTest2Class
,
"ET2"
,
WS_OVERLAPPEDWINDOW
,
...
...
@@ -749,9 +750,12 @@ static void test_edit_control_2(void)
trace
(
"EDIT: SETTEXT atomicity
\n
"
);
/* Send messages to "type" in the word 'foo'. */
SendMessage
(
hwndET2
,
WM_CHAR
,
'f'
,
1
);
SendMessage
(
hwndET2
,
WM_CHAR
,
'o'
,
1
);
SendMessage
(
hwndET2
,
WM_CHAR
,
'o'
,
1
);
r
=
SendMessage
(
hwndET2
,
WM_CHAR
,
'f'
,
1
);
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
r
=
SendMessage
(
hwndET2
,
WM_CHAR
,
'o'
,
1
);
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
r
=
SendMessage
(
hwndET2
,
WM_CHAR
,
'o'
,
1
);
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
/* 'foo' should have been changed to 'bar' by the UPDATE handler. */
GetWindowText
(
hwndET2
,
szLocalString
,
MAXLEN
);
ok
(
lstrcmp
(
szLocalString
,
"bar"
)
==
0
,
...
...
@@ -1553,7 +1557,8 @@ static void test_espassword(void)
/* select all, cut (ctrl-x) */
SendMessage
(
hwEdit
,
EM_SETSEL
,
0
,
-
1
);
SendMessage
(
hwEdit
,
WM_CHAR
,
24
,
0
);
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
24
,
0
);
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
/* get text */
r
=
SendMessage
(
hwEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
...
...
@@ -1569,8 +1574,10 @@ static void test_espassword(void)
/* select all, copy (ctrl-c) and paste (ctrl-v) */
SendMessage
(
hwEdit
,
EM_SETSEL
,
0
,
-
1
);
SendMessage
(
hwEdit
,
WM_CHAR
,
3
,
0
);
SendMessage
(
hwEdit
,
WM_CHAR
,
22
,
0
);
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
3
,
0
);
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
22
,
0
);
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
/* get text */
buffer
[
0
]
=
0
;
...
...
@@ -1607,7 +1614,7 @@ static void test_undo(void)
/* cut (ctrl-x) */
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
24
,
0
);
todo_wine
{
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
}
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
/* get text */
buffer
[
0
]
=
0
;
...
...
@@ -1617,7 +1624,7 @@ static void test_undo(void)
/* undo (ctrl-z) */
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
26
,
0
);
todo_wine
{
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
}
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
/* get text */
buffer
[
0
]
=
0
;
...
...
@@ -1627,7 +1634,7 @@ static void test_undo(void)
/* undo again (ctrl-z) */
r
=
SendMessage
(
hwEdit
,
WM_CHAR
,
26
,
0
);
todo_wine
{
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
}
ok
(
1
==
r
,
"Expected: %d, got: %d
\n
"
,
1
,
r
);
/* get text */
buffer
[
0
]
=
0
;
...
...
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