Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Sat, 12 Jul 2008 12:28:33 -0700,    group: microsoft.public.win32.programmer.ui        back       


BUG? SetLayeredWindowAttributes() on Vista?   
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...
date: Sat, 12 Jul 2008 12:28:33 -0700   author:   Somebody

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us