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
454c1b75
Commit
454c1b75
authored
Mar 10, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement a test for the desktop visibility based on the MSDN article
pointed out by Robert Shearman.
parent
af54602c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
main.c
programs/winetest/main.c
+15
-16
No files found.
programs/winetest/main.c
View file @
454c1b75
...
...
@@ -30,6 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
...
...
@@ -68,23 +69,21 @@ static int running_under_wine ()
static
int
running_on_visible_desktop
()
{
BOOL
visible
;
HWND
desktop
;
HDC
hdc
;
HRGN
hrgn
;
RECT
rc
;
FARPROC
pGetProcessWindowStation
=
GetProcAddress
(
GetModuleHandle
(
"user32.dll"
),
"GetProcessWindowStation"
);
desktop
=
GetDesktopWindow
();
hdc
=
GetDC
(
desktop
);
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
GetRandomRgn
(
hdc
,
hrgn
,
SYSRGN
);
visible
=
GetRgnBox
(
hrgn
,
&
rc
)
!=
NULLREGION
;
DeleteObject
(
hrgn
);
ReleaseDC
(
desktop
,
hdc
);
return
visible
;
if
(
pGetProcessWindowStation
)
{
DWORD
len
;
HWINSTA
wstation
;
USEROBJECTFLAGS
uoflags
;
FARPROC
pGetUserObjectInformationA
=
GetProcAddress
(
GetModuleHandle
(
"user32.dll"
),
"GetUserObjectInformationA"
);
wstation
=
(
HWINSTA
)
pGetProcessWindowStation
();
assert
(
pGetUserObjectInformationA
(
wstation
,
UOI_FLAGS
,
&
uoflags
,
sizeof
(
uoflags
),
&
len
));
return
(
uoflags
.
dwFlags
&
WSF_VISIBLE
)
!=
0
;
}
else
return
IsWindowVisible
(
GetDesktopWindow
());
}
void
print_version
()
...
...
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