0

I handle WM_CTLCOLORSTATIC message to make transparent background for static control:

case WM_CTLCOLORSTATIC:
{
SetTextColor((HDC)wParam,RGB(0,0,0));
SetBkMode((HDC)wParam,TRANSPARENT);
HBRUSH return_bush = (HBRUSH)GetStockObject(NULL_BRUSH);
return (LRESULT)return_brush;
}

This works fine. And now I try to change text for static control by calling SendMessage(). But in result new text is placed over the existing text. I think that need to repaint static control. How to repaint static control? How to do it?

Ig_M
  • 107
  • 9

1 Answers1

0

I think the answer to your problem (changing text in Transparent Static control) is already on Stackoverflow; See here

Community
  • 1
  • 1
manuell
  • 7,528
  • 5
  • 31
  • 58
  • Thanks, but where to insert this code?: RECT rect; HWND hctrl; hctrl = GetDlgItem(hwnd, ControlID); GetClientRect(hctrl, &rect); MapWindowPoints(hctrl, hwnd, (POINT *)&rect, 2); InvalidateRect(hwnd, &rect, TRUE); which WM message to handle? – Ig_M Jun 21 '13 at 11:32
  • Insert the code where you change the text of the static control (after the SendMessage) – manuell Jun 26 '13 at 15:48