Question

i have a layered form with the WS_EX_LAYERED extended style set. i've created a child "EDIT" control using CreateWindowEx(...) API function; the control it's there but is not painted and nothing appears on the form.

i know that when using WS_EX_LAYERED style on a top window the WM_PAINT message is not sent anymore and neither child controls will receive it so that`s why it doesn't appear.

please take into account that the form`s opacity is set to 255 and the background is painted with a transparent image using UpdateLayeredWindow(...) API.

when i hover the mouse over the EDIT control, the text cursor appear and i can copy the text inside it.

i guess that the problem i have to deal with is somehow making the control to accept user paint.

i've tried painting the control with the same technique as the form, and for that i've created a compatible DC from the form but i don't know if this is even possible, my control is still not painted.

should it work if i send the WM_PRINTCLIENT for that control ? in that case, the DC should be the layered parent form ? i have also tried this but i couldn't make it work.

normal form: http://img580.imageshack.us/i/formy.png/

layered form: http://img6.imageshack.us/i/layeredform.png/

my question is how do i make my edit control accept alpha-blended-user-paint ? how do i paint a alpha-blended control on the layered form ?

Was it helpful?

Solution

in the end i have found a way to do it,

what i had to do was to get the bitmap-image of each control and draw it on the form's background so ... when i applied UpdateLayeredWindow for the form, the form bitmap contained all the controls,

i still don`t know if this is a best practice though

the method works nicely but i have to perfect it and add more interaction + alpha blended controls .. on the other hand functionality is there

here it is: http://img84.imageshack.us/img84/3172/73845647.png

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top