tags:

views:

18

answers:

1

I have a layered (semi-transparent window) created with WS_EX_LAYERED and adjusted with SetLayeredWindowAttributes(... LWA_ALPHA). I have to show and hide it from time to time, but since last hide there are cases when the image is going to be changed significally. But SetWindowPos and ShowWindow at first shows the previous image (possibly buffered image from last time) and after that I see new image repainting. What is the best way to invalidate it as though it is going to be shown for the first time (so no drawing of the previous buffered image)

Thanks

Maxn

A: 

Never noticed this before, this might be an artifact of your video display driver.

Yes, you can do something about it. A layered window allows you to control the opacity. You could start out with SetLayeredWindowAttributes()'s bAlpha at 0 and change it after the first WM_PAINT message you process. A fade-in driven by a timer is a pretty common trick as well.

Hans Passant
Answered, although thinking there would be no replies solved it the same way ) I understand why one could not notice it, it's not so often the content would change without user intervention.
Maksee