Another attempt of a test for a visible desktop.

This commit is contained in:
Dmitry Timoshkov 2005-03-07 10:58:37 +00:00 committed by Alexandre Julliard
parent 08b250e74e
commit b5c358bba7
2 changed files with 18 additions and 2 deletions

View File

@ -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 \

View File

@ -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 ()