how make STATIC transparent?

have these code, for do a transparant effect:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
case WM_CTLCOLORSTATIC:
            {
                if ( inst->blnTransparent == true)
                {
                    SetBkMode( (HDC)wParam, TRANSPARENT);
                    return (LRESULT) GetStockObject(HOLLOW_BRUSH);
                }
                else
                {
                    DeleteObject(g_hbrBackground);
                    HDC hdcStatic = (HDC)wParam;
                    SetTextColor(hdcStatic, inst->clrTextColor);
                    SetBkColor(hdcStatic,inst->clrBackColor);
                    SetBkMode(hdcStatic, TRANSPARENT);
                    g_hbrBackground = CreateSolidBrush(inst->clrBackColor);
                    return (LONG)g_hbrBackground;
                }
            }
            break;

(the inst is the pointer class(in these class).)
but when the text is changed, why the control isn't 'clean' before show the next text?
these code is ok.. i did a new tests with a parent image and works fine... thanks
Topic archived. No new replies allowed.