Another attempt of a test for a visible desktop
Dmitry Timoshkov
dmitry at baikal.ru
Sat Mar 5 09:38:49 CST 2005
Hello,
Changelog:
Dmitry Timoshkov <dmitry at codeweavers.com>
Another attempt of a test for a visible desktop.
diff -up cvs/hq/wine/programs/winetest/main.c wine/programs/winetest/main.c
--- cvs/hq/wine/programs/winetest/main.c 2005-03-05 23:26:28.000000000 +0800
+++ wine/programs/winetest/main.c 2005-03-05 23:29:44.000000000 +0800
@@ -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 ()
diff -up cvs/hq/wine/programs/winetest/Makefile.in wine/programs/winetest/Makefile.in
--- cvs/hq/wine/programs/winetest/Makefile.in 2005-01-26 17:56:03.000000000 +0800
+++ wine/programs/winetest/Makefile.in 2005-03-05 23:31:32.000000000 +0800
@@ -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 \
More information about the wine-patches
mailing list