c++ - Function to check if a window is visible on screen does not work on Windows 7 -
for program, need know if @ least pixel of window visible on screen.
i'm using code:
bool iswindowvisible(hwnd hwnd) { rect r1; getwindowrect(hwnd, &r1); hrgn x = createrectrgnindirect(&r1); hwnd s = gettopwindow(0); { if (iswindowvisible(s)) { rect r2; getwindowrect(s, &r2); hrgn y = createrectrgnindirect(&r2); int res = combinergn(x, x, y, rgn_diff); deleteobject(y); if (res == nullregion) { deleteobject(x); return false; } } } while ((s = getnextwindow(s, gw_hwndnext)) && s != hwnd); deleteobject(x); return true; }
this work on windows 8.1 , windows 10, not on windows 7. on windows 7, returns false
every time.
i thought because of aero effects, when disable it, still happens. got method here on stackoverflow , adapted c++.
does know why happening?
ok, figured out myself. not check if window on top of z-order same window 1 check. if window still on top, function subtracts , returns false
. don't know why error happens on windows 7, @ least fixed now.
Comments
Post a Comment