|
|
|
date: Sat, 12 Jul 2008 12:28:33 -0700,
group: microsoft.public.win32.programmer.ui
back
Re: BUG? SetLayeredWindowAttributes() on Vista?
"Somebody" wrote in message
news:OB7ek.13831$Fj5.1997@newsfe23.lga...
> Hi,
> I'm using SetLayeredWindowAttributes() on Vista to fade in a window. These
> windows can sometimes be different sizes. The problem is that it seems
> like the OS is caching the last bitmap and there is no way to clear it.
>
> For example, say the first time the window fades in, it says "TEST" and
> everything is smooth. The 2nd time another window pops up, I sometimes
> seem the image of "TEST" there during the timer messages.
>
> Ie... it doesn't grab the new snapshot of the window.
>
> Anyone seen this before?
>
> I had this problem on XP too, but I was able to fix it by clearing the
> WS_EX_LAYERED bit and resetting. That works on Win2k3 too, but on Vista,
> no go...
>
To be sure, you are using the same HWND... the first time you paint TEST and
then call SetLayeredWindowAttributes() in a timer loop with the LWA_ALPHA
flag and increasing alpha values to make the window increasingly opaque.
Now when you show the same HWND the second time, how do you get it to paint
the new contents? Do you call Invalidate() and UpdateWindow() to force
painting of the new contents prior to fading it in with the
SetLayeredWindowAttributes() timer loop?
BTW, if your HWND has no child controls in it, you can use
UpdateLayeredWindow() instead of SetLayeredWindowAttributes(). This has the
advantage that each pixel of the window can have different alpha levels.
-- David
date: Sat, 12 Jul 2008 21:00:44 -0700
author: David Ching
|
|