Static control with WS_EX_TRANSPARENT style not repainted

I am trying to create a control that implements the per-pixel alpha blend while painting a 32-bit bitmap.

I extended a CWnd and use static control in the resource editor. I managed to paint the alpha channel correctly but still the static control keep painting the gray background.

I overwrote the OnEraseBkgnd to prevent the control from painting the background but it didn't worked. I finally managed to do it by using WS_EX_TRANSPARENT.

My problem now is that my control is placed over other control. The first time the dialog is painted all works fine...but if I click over the "parent" control (ie the one beneath my control) my control doesn't received the WM_PAINT message. So it is not painted anymore.

If I minimize the aplication and maximized it again the controls are painted again.

Please, can anybody give a hint? I am getting crazy with this control!!!



I would have though that if you are processing both the WM_ERASEBKGND and the WM_PAINT messages then you should have cover all the painting options, without having to resort to using the WS_EX_TRANSPARENT style.

Are you sure your code is not passing these messages on to the default processing?

One other option might be to subclass the static control, just to make sure your code is the only one handling these two messages.

Need Your Help

Rails forms for has_many through association with additional attributes?

ruby-on-rails ruby nested-forms has-many-through simple-form

How can I generate form fields for a has_many :through association that has additional attributes?

Download a webpage in UTF-8

c# .net utf-8

I'm using the code below to download this XML file:

Capture Video Length with FFMPEG and Paperclip

amazon-s3 ffmpeg paperclip

I am trying to get the video length during the video upload. We are using SWFUpload to upload the file. Then paperclip to store it on S3. Our current process is loading the file into memory and ...