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
64d69b60
Commit
64d69b60
authored
Sep 23, 2004
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Skip shell window test on Win9x and restore its functionality on NT
platforms. - Use keybd_event instead of SendInput in order to perform keyboard input test on Win95 as well.
parent
09878e1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
26 deletions
+28
-26
win.c
dlls/user/tests/win.c
+28
-26
No files found.
dlls/user/tests/win.c
View file @
64d69b60
...
...
@@ -797,7 +797,7 @@ static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
return
CallNextHookEx
(
hhook
,
nCode
,
wParam
,
lParam
);
}
static
void
test_shell_window
()
static
void
test_shell_window
(
void
)
{
BOOL
ret
;
DWORD
error
;
...
...
@@ -807,6 +807,12 @@ static void test_shell_window()
HWND
hwnd1
,
hwnd2
,
hwnd3
,
hwnd4
,
hwnd5
;
HWND
shellWindow
,
nextWnd
;
if
(
!
GetWindowLongW
(
GetDesktopWindow
(),
GWL_STYLE
))
{
trace
(
"Skipping shell window test on Win9x
\n
"
);
return
;
}
shellWindow
=
GetShellWindow
();
hinst
=
GetModuleHandle
(
0
);
hUser32
=
GetModuleHandleA
(
"user32"
);
...
...
@@ -817,12 +823,23 @@ static void test_shell_window()
trace
(
"previous shell window: %p
\n
"
,
shellWindow
);
if
(
shellWindow
)
{
DWORD
pid
;
HANDLE
hProcess
;
ret
=
DestroyWindow
(
shellWindow
);
error
=
GetLastError
();
ok
(
!
ret
,
"DestroyWindow(shellWindow)
\n
"
);
/* passes on Win XP, but not on Win98
ok(error==ERROR_ACCESS_DENIED, "ERROR_ACCESS_DENIED after DestroyWindow(shellWindow)\n"); */
/* passes on Win XP, but not on Win98 */
ok
(
error
==
ERROR_ACCESS_DENIED
,
"ERROR_ACCESS_DENIED after DestroyWindow(shellWindow)
\n
"
);
/* close old shell instance */
GetWindowThreadProcessId
(
shellWindow
,
&
pid
);
hProcess
=
OpenProcess
(
PROCESS_ALL_ACCESS
,
FALSE
,
pid
);
ret
=
TerminateProcess
(
hProcess
,
0
);
ok
(
ret
,
"termination of previous shell process failed: GetLastError()=%ld
\n
"
,
GetLastError
());
WaitForSingleObject
(
hProcess
,
INFINITE
);
/* wait for termination */
CloseHandle
(
hProcess
);
}
hwnd1
=
CreateWindowEx
(
0
,
TEXT
(
"#32770"
),
TEXT
(
"TEST1"
),
WS_OVERLAPPEDWINDOW
/*|WS_VISIBLE*/
,
100
,
100
,
300
,
200
,
0
,
0
,
hinst
,
0
);
...
...
@@ -1988,15 +2005,6 @@ static void test_capture_3(HWND hwnd1, HWND hwnd2)
static
void
test_keyboard_input
(
HWND
hwnd
)
{
MSG
msg
;
INPUT
input
;
FARPROC
pSendInput
=
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"SendInput"
);
input
.
type
=
INPUT_KEYBOARD
;
input
.
u
.
ki
.
wVk
=
VK_SPACE
;
input
.
u
.
ki
.
wScan
=
0
;
input
.
u
.
ki
.
dwFlags
=
0
;
input
.
u
.
ki
.
time
=
0
;
input
.
u
.
ki
.
dwExtraInfo
=
0
;
ShowWindow
(
hwnd
,
SW_SHOW
);
UpdateWindow
(
hwnd
);
...
...
@@ -2022,13 +2030,10 @@ static void test_keyboard_input(HWND hwnd)
ok
(
GetFocus
()
==
hwnd
,
"wrong focus window %p
\n
"
,
GetFocus
());
if
(
pSendInput
)
{
ok
(
pSendInput
(
1
,
&
input
,
sizeof
(
input
))
==
1
,
"SendInput failed
\n
"
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
hwnd
&&
msg
.
message
==
WM_KEYDOWN
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
!
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"message %04x available
\n
"
,
msg
.
message
);
}
keybd_event
(
VK_SPACE
,
0
,
0
,
0
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
hwnd
&&
msg
.
message
==
WM_KEYDOWN
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
!
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"message %04x available
\n
"
,
msg
.
message
);
SetFocus
(
0
);
ok
(
GetFocus
()
==
0
,
"wrong focus window %p
\n
"
,
GetFocus
());
...
...
@@ -2049,13 +2054,10 @@ static void test_keyboard_input(HWND hwnd)
ok
(
GetFocus
()
==
0
,
"wrong focus window %p
\n
"
,
GetFocus
());
if
(
pSendInput
)
{
ok
(
pSendInput
(
1
,
&
input
,
sizeof
(
input
))
==
1
,
"SendInput failed
\n
"
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
hwnd
&&
msg
.
message
==
WM_SYSKEYDOWN
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
!
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"message %04x available
\n
"
,
msg
.
message
);
}
keybd_event
(
VK_SPACE
,
0
,
0
,
0
);
ok
(
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"no message available
\n
"
);
ok
(
msg
.
hwnd
==
hwnd
&&
msg
.
message
==
WM_SYSKEYDOWN
,
"hwnd %p message %04x
\n
"
,
msg
.
hwnd
,
msg
.
message
);
ok
(
!
PeekMessageA
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
),
"message %04x available
\n
"
,
msg
.
message
);
}
START_TEST
(
win
)
...
...
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