Another attempt of a test for a visible desktop.
This commit is contained in:
parent
08b250e74e
commit
b5c358bba7
|
@ -4,7 +4,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = winetest.exe
|
||||
APPMODE = -mconsole
|
||||
IMPORTS = comctl32 user32 wsock32
|
||||
IMPORTS = comctl32 user32 gdi32 wsock32
|
||||
|
||||
C_SRCS = \
|
||||
gui.c \
|
||||
|
|
|
@ -68,7 +68,23 @@ static int running_under_wine ()
|
|||
|
||||
static int running_on_visible_desktop ()
|
||||
{
|
||||
return IsWindowVisible( GetDesktopWindow() );
|
||||
BOOL visible;
|
||||
HWND desktop;
|
||||
HDC hdc;
|
||||
HRGN hrgn;
|
||||
RECT rc;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void print_version ()
|
||||
|
|
Loading…
Reference in New Issue