Commit b5c358bb authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Another attempt of a test for a visible desktop.

parent 08b250e7
......@@ -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 ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment