Better test for visible desktop, should be working on all platforms.
jakov at vmlinux.org
Sat Mar 5 10:21:40 CST 2005
Dmitry Timoshkov wrote:
>"Dmitry Timoshkov" <dmitry at baikal.ru> wrote:
>>>It's not pretty, but I don't have an NT4 to test with, so I didn't want
>>>anything. Later I can refactor it into exactly the failing part.
>>Did you consider implementing the approach Robert Shearman has pointed out?
>Here is another way for testing for a visible desktop which just came
>to my mind (based on the EMF test failure analysis and the description
>static int running_on_visible_desktop ()
> 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;
> ReleaseDC(desktop, hdc);
> return visible;
Go for it, could you send a patch to wine-cvs?
More information about the wine-devel