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
203b4fbf
Commit
203b4fbf
authored
Nov 20, 2012
by
Aric Stewart
Committed by
Alexandre Julliard
Nov 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32/tests: Test showing that communication to the IME window is done via SendMessage.
parent
ad627248
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
11 deletions
+62
-11
imm32.c
dlls/imm32/tests/imm32.c
+62
-11
No files found.
dlls/imm32/tests/imm32.c
View file @
203b4fbf
...
...
@@ -33,11 +33,16 @@ static BOOL (WINAPI *pImmIsUIMessageA)(HWND,UINT,WPARAM,LPARAM);
/*
* msgspy - record and analyse message traces sent to a certain window
*/
typedef
struct
_msgs
{
CWPSTRUCT
msg
;
BOOL
post
;
}
imm_msgs
;
static
struct
_msg_spy
{
HWND
hwnd
;
HHOOK
get_msg_hook
;
HHOOK
call_wnd_proc_hook
;
CWPSTRUCT
msgs
[
32
];
imm_msgs
msgs
[
32
];
unsigned
int
i_msg
;
}
msg_spy
;
...
...
@@ -46,13 +51,14 @@ static LRESULT CALLBACK get_msg_filter(int nCode, WPARAM wParam, LPARAM lParam)
if
(
HC_ACTION
==
nCode
)
{
MSG
*
msg
=
(
MSG
*
)
lParam
;
if
((
msg
->
hwnd
==
msg_spy
.
hwnd
)
&&
if
((
msg
->
hwnd
==
msg_spy
.
hwnd
||
msg_spy
.
hwnd
==
NULL
)
&&
(
msg_spy
.
i_msg
<
NUMELEMS
(
msg_spy
.
msgs
)))
{
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
hwnd
=
msg
->
hwnd
;
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
message
=
msg
->
message
;
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
wParam
=
msg
->
wParam
;
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
lParam
=
msg
->
lParam
;
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
msg
.
hwnd
=
msg
->
hwnd
;
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
msg
.
message
=
msg
->
message
;
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
msg
.
wParam
=
msg
->
wParam
;
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
msg
.
lParam
=
msg
->
lParam
;
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
post
=
TRUE
;
msg_spy
.
i_msg
++
;
}
}
...
...
@@ -66,10 +72,11 @@ static LRESULT CALLBACK call_wnd_proc_filter(int nCode, WPARAM wParam,
if
(
HC_ACTION
==
nCode
)
{
CWPSTRUCT
*
cwp
=
(
CWPSTRUCT
*
)
lParam
;
if
((
cwp
->
hwnd
==
msg_spy
.
hwnd
)
&&
if
((
(
cwp
->
hwnd
==
msg_spy
.
hwnd
||
msg_spy
.
hwnd
==
NULL
)
)
&&
(
msg_spy
.
i_msg
<
NUMELEMS
(
msg_spy
.
msgs
)))
{
memcpy
(
&
msg_spy
.
msgs
[
msg_spy
.
i_msg
],
cwp
,
sizeof
(
msg_spy
.
msgs
[
0
]));
memcpy
(
&
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
msg
,
cwp
,
sizeof
(
msg_spy
.
msgs
[
0
].
msg
));
msg_spy
.
msgs
[
msg_spy
.
i_msg
].
post
=
FALSE
;
msg_spy
.
i_msg
++
;
}
}
...
...
@@ -93,7 +100,7 @@ static void msg_spy_flush_msgs(void) {
msg_spy
.
i_msg
=
0
;
}
static
CWPSTRUCT
*
msg_spy_find_msg
(
UINT
message
)
{
static
imm_msgs
*
msg_spy_find_next_msg
(
UINT
message
,
UINT
*
start
)
{
UINT
i
;
msg_spy_pump_msg_queue
();
...
...
@@ -102,13 +109,22 @@ static CWPSTRUCT* msg_spy_find_msg(UINT message) {
fprintf
(
stdout
,
"%s:%d: msg_spy: message buffer overflow!
\n
"
,
__FILE__
,
__LINE__
);
for
(
i
=
0
;
i
<
msg_spy
.
i_msg
;
i
++
)
if
(
msg_spy
.
msgs
[
i
].
message
==
message
)
for
(
i
=
*
start
;
i
<
msg_spy
.
i_msg
;
i
++
)
if
(
msg_spy
.
msgs
[
i
].
msg
.
message
==
message
)
{
*
start
=
i
+
1
;
return
&
msg_spy
.
msgs
[
i
];
}
return
NULL
;
}
static
imm_msgs
*
msg_spy_find_msg
(
UINT
message
)
{
UINT
i
=
0
;
return
msg_spy_find_next_msg
(
message
,
&
i
);
}
static
void
msg_spy_init
(
HWND
hwnd
)
{
msg_spy
.
hwnd
=
hwnd
;
msg_spy
.
get_msg_hook
=
...
...
@@ -655,6 +671,36 @@ static void test_ImmDefaultHwnd(void)
DestroyWindow
(
hwnd
);
}
static
void
test_ImmMessages
(
void
)
{
CANDIDATEFORM
cf
;
imm_msgs
*
msg
;
HWND
defwnd
;
HIMC
imc
;
UINT
idx
=
0
;
HWND
hwnd
=
CreateWindowEx
(
WS_EX_CLIENTEDGE
,
"EDIT"
,
"Wine imm32.dll test"
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
240
,
120
,
NULL
,
NULL
,
GetModuleHandle
(
0
),
NULL
);
ShowWindow
(
hwnd
,
SW_SHOWNORMAL
);
defwnd
=
ImmGetDefaultIMEWnd
(
hwnd
);
imc
=
ImmGetContext
(
hwnd
);
ImmSetOpenStatus
(
imc
,
TRUE
);
msg_spy_flush_msgs
();
SendMessage
(
defwnd
,
WM_IME_CONTROL
,
IMC_GETCANDIDATEPOS
,
(
LPARAM
)
&
cf
);
do
{
msg
=
msg_spy_find_next_msg
(
WM_IME_CONTROL
,
&
idx
);
if
(
msg
)
ok
(
!
msg
->
post
,
"Message should not be posted
\n
"
);
}
while
(
msg
);
msg_spy_flush_msgs
();
ImmSetOpenStatus
(
imc
,
FALSE
);
ImmReleaseContext
(
hwnd
,
imc
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
imm32
)
{
if
(
init
())
{
...
...
@@ -668,6 +714,11 @@ START_TEST(imm32) {
test_ImmGetContext
();
test_ImmGetDescription
();
test_ImmDefaultHwnd
();
msg_spy_cleanup
();
/* Reinitialize the hooks to capture all windows */
msg_spy_init
(
NULL
);
test_ImmMessages
();
msg_spy_cleanup
();
}
cleanup
();
}
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