Detect a form/control is not totaly drawn on the screen

  • Thread starter Benoist Demeure
  • Start date
B

Benoist Demeure

Hi,

I'm using BitBlt to capture a screen-shot of a control.
It's works fine, but if the control is "masked" by an another windows, or
outside the screen bounds the captured bitmap is not complete. It's normal
because only the visible part of a control is drawn for optimizing paint.

So, before capturing the screen-shot, i want to verify that the control is
not masked by another windows ( wich can be a window from an external
application , for example the taskbar ) .
Is there a way to do that ?
 
J

Joep

screen coordinates of control combined with screen itself (that is, its
height and width) will tell you
 
B

Benoist Demeure

This is not enough : screen coordinates can help me to know if the control
is outside ( or partialy outside ) the screen.

But the main problem is to detect that the control is not masked by another
window
 
J

Joep

you are right, i missed that part, sorry

when a window, or better any window of whatever proces, is partially hidden,
another window is hiding part of it, sounds logical, then, windows have
z-order and can be enumerated, their size/location asked, whether visible,
just some thoughts
 
B

Benoist Demeure

You mean that z-order of my window dynamicaly change when it is behind or
ahead ?
If true, it will be helpfull to solve my problem.
 
J

Joep

z-order is the order in which windows are stacked on top of one another as
if the display has a third dimension (next to x and y or width and height)

so yes, your window is somewhere in that z-order as are other windows, that
means you can compare z-order programmatically giving you windows that can
overlap and then for these you check their respective location/size
 
J

Joep

in addition:

by the way, this pops up, I remember something about the difference between
desktop area on the one hand and screen area on the other (the latter does
not account for taskbar if I recall well), found that in the system metrics
corner or similar one day
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top