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

Re: Layered Window - Black Area by Bob

Bob
Sun Jun 19 14:28:29 CDT 2005

UpdateLayeredWindow ???!!!

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"scolemann" <scolemann@yahoo.com> wrote in message
news:1119198612.031235.77370@z14g2000cwz.googlegroups.com...
> 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
>



Re: Layered Window - Black Area by Bob

Bob
Sun Jun 19 14:35:40 CDT 2005

Post your code please.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"scolemann" <scolemann@yahoo.com> wrote in message
news:1119198612.031235.77370@z14g2000cwz.googlegroups.com...
> 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
>



Re: Layered Window - Black Area by scolemann

scolemann
Mon Jun 20 20:49:09 CDT 2005

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