Special case Win9x platforms in the desktop visibility test, in Win98

GetUserObjectInformation is a stub returning ERROR_CALL_NOT_IMPLEMENTED.
This commit is contained in:
Dmitry Timoshkov 2005-03-14 10:06:22 +00:00 committed by Alexandre Julliard
parent 8528796c48
commit 097df18039
1 changed files with 10 additions and 5 deletions

View File

@ -69,21 +69,26 @@ static int running_under_wine ()
static int running_on_visible_desktop () static int running_on_visible_desktop ()
{ {
FARPROC pGetProcessWindowStation = GetProcAddress(GetModuleHandle("user32.dll"), "GetProcessWindowStation"); HWND desktop;
HMODULE huser32 = GetModuleHandle("user32.dll");
FARPROC pGetProcessWindowStation = GetProcAddress(huser32, "GetProcessWindowStation");
FARPROC pGetUserObjectInformationA = GetProcAddress(huser32, "GetUserObjectInformationA");
if (pGetProcessWindowStation) desktop = GetDesktopWindow();
if (!GetWindowLongPtrW(desktop, GWLP_WNDPROC)) /* Win9x */
return IsWindowVisible(desktop);
if (pGetProcessWindowStation && pGetUserObjectInformationA)
{ {
DWORD len; DWORD len;
HWINSTA wstation; HWINSTA wstation;
USEROBJECTFLAGS uoflags; USEROBJECTFLAGS uoflags;
FARPROC pGetUserObjectInformationA = GetProcAddress(GetModuleHandle("user32.dll"), "GetUserObjectInformationA");
wstation = (HWINSTA)pGetProcessWindowStation(); wstation = (HWINSTA)pGetProcessWindowStation();
assert(pGetUserObjectInformationA(wstation, UOI_FLAGS, &uoflags, sizeof(uoflags), &len)); assert(pGetUserObjectInformationA(wstation, UOI_FLAGS, &uoflags, sizeof(uoflags), &len));
return (uoflags.dwFlags & WSF_VISIBLE) != 0; return (uoflags.dwFlags & WSF_VISIBLE) != 0;
} }
else return IsWindowVisible(desktop);
return IsWindowVisible(GetDesktopWindow());
} }
void print_version () void print_version ()