why the static control is 'hided'?

by several reasons i drawed the static control using WM_PAINT at least i can change the textcolor, textbackcolor and 'transparent'(is a copy of the parent).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
case WM_PAINT:
            {
                PAINTSTRUCT  ps;
                HDC hdc = BeginPaint(inst->hwnd, &ps);

                if (inst->Paint==NULL)
                {
                    RECT f;
                    GetClientRect(hwnd,&f);
                    HBRUSH s=CreateSolidBrush(inst->clrBackColor);
                    SelectObject(hdc,(HBRUSH)s);
                    if (inst->clrBackColor==-1)
                        BitBlt(hdc,0,0,f.right-f.left,f.bottom-f.top,GetDC(GetParent(inst->hwnd)),inst->intLeft,inst->intTop,SRCCOPY);
                    else
                        FillRect(hdc,&f,s);

                    SetBkMode(hdc,TRANSPARENT);
                    char *text=(char*)inst->strCaption.c_str();
                    SetTextColor(hdc,inst->clrTextColor );
                    DrawTextEx(hdc,text,-1,&f,DT_CENTER,NULL);
                    DeleteObject(s);
                }
                else
                    inst->Paint(inst->hwnd,hdc);
                EndPaint(inst->hwnd, &ps);
            }
            break;

the static it's showed normaly and seems great.
now i add the WS_CLIPCHILDREN style for avoid the flickers with child control, but the static control isn't showed :(
in parent control(the form):
1 - the paint show an image(from a variable that have sevral subimages);
2 - the timer change the subimage and use the InvalidateRect() for call the WM_PAINT message.
doing these, by some reason, the static control is hided, but the mouse events continue working... so what is affecting the static WM_PAINT message?
Sounds to me like you need to be using the WM_CTLCOLORSTATIC message for something like that ...

http://msdn.microsoft.com/en-us/library/windows/desktop/bb787524%28v=vs.85%29.aspx
by some reason, i can't use that message... that msdn doc make me more confuse than i'm :(
anotherthing: i use the WS_EX_TRANSPARENT style when i create the static control. if i delete that style, the static is showed normaly but not transparent. i'm testing 1 thing without sucess :(
when the parent is repainted, can i send a message to the others controls?
(i subclass the controls)
Registered users can post here. Sign in or register to post.