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
6e32d18f
Commit
6e32d18f
authored
Oct 12, 2013
by
Qian Hong
Committed by
Alexandre Julliard
Oct 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Try harder to set foreground window.
parent
5c1ea9bf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
winstation.c
dlls/user32/tests/winstation.c
+29
-4
No files found.
dlls/user32/tests/winstation.c
View file @
6e32d18f
...
@@ -758,6 +758,32 @@ static DWORD WINAPI create_window(LPVOID param)
...
@@ -758,6 +758,32 @@ static DWORD WINAPI create_window(LPVOID param)
return
0
;
return
0
;
}
}
static
DWORD
set_foreground
(
HWND
hwnd
)
{
HWND
hwnd_fore
;
DWORD
set_id
,
fore_id
,
ret
;
char
win_text
[
1024
];
hwnd_fore
=
GetForegroundWindow
();
GetWindowText
(
hwnd_fore
,
win_text
,
1024
);
set_id
=
GetWindowThreadProcessId
(
hwnd
,
NULL
);
fore_id
=
GetWindowThreadProcessId
(
hwnd_fore
,
NULL
);
trace
(
"
\"
%s
\"
%p %08x hwnd %p %08x
\n
"
,
win_text
,
hwnd_fore
,
fore_id
,
hwnd
,
set_id
);
ret
=
AttachThreadInput
(
set_id
,
fore_id
,
TRUE
);
trace
(
"AttachThreadInput returned %08x
\n
"
,
ret
);
ret
=
ShowWindow
(
hwnd
,
SW_SHOWNORMAL
);
trace
(
"ShowWindow returned %08x
\n
"
,
ret
);
ret
=
SetWindowPos
(
hwnd
,
HWND_TOPMOST
,
0
,
0
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
);
trace
(
"set topmost returned %08x
\n
"
,
ret
);
ret
=
SetWindowPos
(
hwnd
,
HWND_NOTOPMOST
,
0
,
0
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
);
trace
(
"set notopmost returned %08x
\n
"
,
ret
);
ret
=
SetForegroundWindow
(
hwnd
);
trace
(
"SetForegroundWindow returned %08x
\n
"
,
ret
);
Sleep
(
250
);
AttachThreadInput
(
set_id
,
fore_id
,
FALSE
);
return
ret
;
}
static
void
test_foregroundwindow
(
void
)
static
void
test_foregroundwindow
(
void
)
{
{
HWND
hwnd
,
hwnd_test
,
partners
[
2
],
hwnds
[
2
];
HWND
hwnd
,
hwnd_test
,
partners
[
2
],
hwnds
[
2
];
...
@@ -824,12 +850,11 @@ static void test_foregroundwindow(void)
...
@@ -824,12 +850,11 @@ static void test_foregroundwindow(void)
ok
(
ret
,
"set thread desktop failed!
\n
"
);
ok
(
ret
,
"set thread desktop failed!
\n
"
);
ret
=
SwitchDesktop
(
hdesks
[
input_desk_id
]);
ret
=
SwitchDesktop
(
hdesks
[
input_desk_id
]);
ok
(
ret
,
"switch desktop failed!
\n
"
);
ok
(
ret
,
"switch desktop failed!
\n
"
);
SetForegroundWindow
(
partners
[
0
]);
set_foreground
(
partners
[
0
]);
SetForegroundWindow
(
partners
[
1
]);
set_foreground
(
partners
[
1
]);
hwnd
=
GetForegroundWindow
();
hwnd
=
GetForegroundWindow
();
ok
(
hwnd
!=
hwnd_test
,
"unexpected foreground window %p
\n
"
,
hwnd
);
ok
(
hwnd
!=
hwnd_test
,
"unexpected foreground window %p
\n
"
,
hwnd
);
ret
=
SetForegroundWindow
(
hwnd_test
);
ret
=
set_foreground
(
hwnd_test
);
Sleep
(
250
);
hwnd
=
GetForegroundWindow
();
hwnd
=
GetForegroundWindow
();
GetWindowText
(
hwnd
,
win_text
,
1024
);
GetWindowText
(
hwnd
,
win_text
,
1024
);
trace
(
"hwnd %p name %s
\n
"
,
hwnd
,
win_text
);
trace
(
"hwnd %p name %s
\n
"
,
hwnd
,
win_text
);
...
...
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