I want to get only the visible part of the window in windows, as a region.
Want to get only the area that is seen by the user. Programmatically, of course. Here is an example. I have the following window composition:
+------------------------------------------+
| |
| +=============+ |
| | | |
| | A +--------------------------+
| | | |
| C | | B |
| | +--------------------------+
| | | |
+-----------| |----------------+
| |
+-------------+
Let's say that I am interested only in window A. Then what I would need is a handle to a region which would look like this:
+=============+
| |
| A +-----+
| |
| |
| +-----+
| |
| |
| |
+-------------+
Alternatively, I should be able to obtain the region of any other window in the following manner.
So far, I used this guide, and I agree that GetClipBox returns 0, 1, 2 or 3 if you have, accordingly, 0 -> Error, 1 for NULLREGION(the resulting rgn is invisible to the user), 2 -> SIMPLEREGION, and 3 for COMPLEXREGION. So, far, I need the complex region.
Master Question: But how do I get its coordinates and dimensions ?
(Added Info)
Is it possible to reconstruct a COMPLEXREGION (That was created by the OS, not me) to simple REGIONS of which it is composed. Feng Yuan suggests you can't:
http://www.codeguru.com/forum/archive/index.php/t-126543.html
(Added Info)
So, is there a way to find the region of A and translate it to a PolyPath or a nice geometric figure having the coordinates of its corners ?
I use JNA (Java) , by the way, but a C# or .VB code solving the same problem would be sufficient.
Cheers.