-1

So I'm using the code written here to redraw a static text but I've noticed that everytime I do so the system take it to the back(behind a static picture) and I can't see it. Is there a way to put it back in position or to prevent this action?

The code I use to redraw it:

vHWND = Control's HWND

wHWND = Window's HWND

RECT rect;
GetClientRect(vHWND, &rect);
InvalidateRect(vHWND, &rect, TRUE);
MapWindowPoints(vHWND, wHWND, (POINT *)&rect, 2);
RedrawWindow(wHWND, &rect, NULL, RDW_ERASE | RDW_INVALIDATE);

The code to have transparent bg:

case WM_CTLCOLORSTATIC: //Draw views transparent background
    {
        SetBkMode((HDC)wParam, TRANSPARENT); //BG Transp
        return (LRESULT)GetStockObject(HOLLOW_BRUSH);
        break;
    }
MrDick
  • 51
  • 1
  • 6
  • What do you mean by "behind a static picture"? – user7860670 Jul 16 '17 at 17:17
  • My static text control is in front of an static picture and everytime I do this action windows redraw the text behind the picture and can only be seen if i set the picture HBITMAP as NULL – MrDick Jul 16 '17 at 17:21
  • Why don't you just draw text on top of picture without creating dedicated static text window? Dealing with clipping and overdraw seems to be more troublesome. – user7860670 Jul 16 '17 at 17:25

1 Answers1

-1

Nevermind, I solved it using SetWindowPos.

MrDick
  • 51
  • 1
  • 6