Layered Window - Black Area

  • Thread starter Thread starter scolemann
  • Start date Start date
S

scolemann

Hi all,

I have a form that I have turned into a layered window (the layered
window is opaque). Everything works great except that if part of the
form is covered and then uncovered, the uncovered area is black. I
have tried doing an invalidate() but it does not update the layered
window. Do I need to call an API function to update the layered
window?

Thanks,
Cole
 
Not really anything specific I can post. Here is the situation. I've
created a window that sits on top of a window owned by another
application. The form is irregular in shape and uses regions to
display the currently "visible" parts of my form. The visible areas of
my form are almost always child controls of the form itself. I
changed my window to a layered window (the easy way: by setting
Opaque=0 then Opaque=100) to see if it would improve performance and it
did improve performance quite a bit. The form is 100% opaque.

The problem is that when the form is painted, areas of the form that
were not visible (covered by other windows, off the screen bounds) are
black when that part of the window becomes visible (because it moved
inside the screen bounds or the window covering it was moved).

Once the form repaints itself the form displays correctly.

I can live with the black spots as long as I can make them go away when
my form, or the form it sits on, are activated. I have tried
Invalidate(true), RedrawWindow, and UpdateWindow. I saw
UpdateLayeredWindow, but I have no experience using the Layered Window
API and it was not obvious what parameters I would need to pass for a
simple "repaint".

Thanks,
Cole
 
Back
Top