Jump to content
  • Advertisement
Sign in to follow this  
Stru

[.net] Detecting visibility of a form

This topic is 4829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I detect whether or not the contents of a form are actually visible on the screen? I am not just talking about the Visible property. I would like to be able to tell if a form is covered by another window or dragged so that the contents are not visible onscreen.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Stru
How can I detect whether or not the contents of a form are actually visible on the screen? I am not just talking about the Visible property. I would like to be able to tell if a form is covered by another window or dragged so that the contents are not visible onscreen.

Are you asking if any portion of it is covered, or all of it is covered?

Share this post


Link to post
Share on other sites
I only need to know whether or not the entire client area of the form is covered. I dont care whether or not the control box / title bar is visible, just whats in the form. I also don't care if only part of the form is visible, even if its only one pixel, but if no pixels in the client part of the form are visible then I would like to know.

Share this post


Link to post
Share on other sites
The win32 function, GetWindow, should be one way to do it. You could determine which windows are in front of your window, and then do simple rect calculations to see if the entirety of your client area is blocked by any of the windows higher in the z-order.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!