about transparent STATIC control

This is a discussion on about transparent STATIC control within the Windows Programming forums, part of the Platform Specific Boards category; i know that i can't do a realy transparent control(in windows 7, only above)
so theres 3 ways:
1 - ...

about transparent STATIC control

i know that i can't do a realy transparent control(in windows 7, only above)
so theres 3 ways:
1 - the WM_PAINT message: and i can use the hdc parent with BitBlt();
2 - the Region way(i have the code, but seems not working );
3 - i can 'hide' the backcolor with WM_CTLCOLORSTATIC message.

using the transparent way and with WS_EX_TRANSPARENT extended style, i can 'hide' the backcolor. but i see 1 problem: why the text(every time that it's changed) don't clean the last text?
(what i see is several texts above others... isn't never clean before show the new text)

when i use an image, with a diferent backcolor, the control backcolor still be the old or it's the new one?
anotherthing: i read something about InvaliteWindow() but seems not working or i'm not using the right message

Could you clarify why you want the static to have a transparent background? [A screen shot would be helpful.]

[Do you want the background of the whole window to be an image and clicking on a static control / area of the image triggers something? ie Hotspots
or do you want the whole window to be transparent? ie show the window / desktop below]

Could you clarify why you want the static to have a transparent background? [A screen shot would be helpful.]

[Do you want the background of the whole window to be an image and clicking on a static control / area of the image triggers something? ie Hotspots
or do you want the whole window to be transparent? ie show the window / desktop below]

(i know do transparent and opacy with main window, but not with child controls... only if i use windows 8 or above)

imagine the parent have 1 image.. i want see that image too. for these i can use the Region way, but seems that code isn't working. i wanted, too, the opacy, but for that i must use the WM_PAINT message and working with some GUID API functions.

So the background is an image and the static control acts like a button (ie when the user clicks on an area in the image something happens, just as if the user had clicked a button)?

If so why not just process mouse clicks?
Set the static to not visible (remove the WS_VISIBLE style or use ShowWindow(hStaticControl, SW_HIDE) )
If the mouse was clicked, convert the point from screen to client coordinates and check to see if the point clicked is in the static controls client rect ( PtInRect() ) then call the processing.
That way you do not have to worry about any drawing of the static (as it is invisble).

Otherwise you need to replace the code I provided before so it uses an offset in the BitBlt().
Generally the offset would be the ((top left point of the static controls window rect) - (the top left of the parent's window rect)) ( GetWindowRect() not GetClientRect() )

If the static just holds text, and that text changes durring run time (and the issue is the remnants of old text) then use double buffering.

So the background is an image and the static control acts like a button (ie when the user clicks on an area in the image something happens, just as if the user had clicked a button)?

If so why not just process mouse clicks?
Set the static to not visible (remove the WS_VISIBLE style or use ShowWindow(hStaticControl, SW_HIDE) )
If the mouse was clicked, convert the point from screen to client coordinates and check to see if the point clicked is in the static controls client rect ( PtInRect() ) then call the processing.
That way you do not have to worry about any drawing of the static (as it is invisble).

Otherwise you need to replace the code I provided before so it uses an offset in the BitBlt().
Generally the offset would be the ((top left point of the static controls window rect) - (the top left of the parent's window rect)) ( GetWindowRect() not GetClientRect() )

If the static just holds text, and that text changes durring run time (and the issue is the remnants of old text) then use double buffering.

thanks for that.
let me ask anotherthing: the Region can give a control 1 shape(circule, rectangle or even irregular like an image), right?
but can you give me a link for see better?