Re: Drawing order of sibling windows
"James B." <JamesB@discussions.microsoft.com> wrote in message
news:B5EF7D36-7B19-4A9E-AC11-DA82C1638454@microsoft.com...
We have tried various flags, WS_CLIPSIBLINGS etc. These partially work,
the
fix all the drawing for normal windows but transparent windows don't draw
correctly. The closest I have come is to set different flags for
different
windows depending if they are transparent or not, this helps but again
there
are several cases where transparent objects overlapping each other don't
draw
correctly.
David Lowndes was involved in threads from years ago that cite this problem.
For example, this thread from 1998 verifies what you found: windows are
drawn in reverse z-order, yet the mouse hit goes to the top of the z-order,
which seems well unusable:
http://groups.google.com/group/microsoft.public.win32.programmer.ui/browse_thread/thread/955f3a962043ee8d/897623ad3a7200a8?lnk=st&q=&rnum=8&hl=en#897623ad3a7200a8
This thread from 2000 cites a Knowledgebase article entitled, "INFO:
Overlapping Controls Are Not Supported by Windows":
http://groups.google.com/group/microsoft.public.vc.mfc/browse_thread/thread/c71dacade3332f13/2d6e86f6522a77c7?lnk=st&q=&rnum=3&hl=en#2d6e86f6522a77c7
OK, so after verifying Windows really doesn't support overlapping siblings
very well, I think the thing to do is create the Windows in reverse Z-order
so that at least the drawing is done correctly. To fix the mouse hit
problem, you could install a WH_MOUSE or WH_MOUSE_LL hook for your app only
and forward the mouse message to the topmost child that has the given
coordinates.
-- David