Reputation: 191
How can I determine if a user can see a window (fully or partially) at the screen using WPF/C#?
I tried to define this using WindowState, but the window may be “under” other windows.
For example now the window are focused and user can view it:
Now part of window are covered with IDE, but user still can view it:
Now the window is completely covered by the IDE window, and the user cannot see it.
How can I now determine in what "visible state" the window is?
Upvotes: 0
Views: 480
Reputation: 1489
You could do a "hit test" on the 4 corners coordinates and if all tests return your window then the window is completely visible.
Upvotes: 1
Reputation: 113
You can track when your application active(or focused) but I am not sure is it possible with a partially visible window, in any case, read this, hope it will be helpful.
Upvotes: 0