Friday 15 July 2011

c++ - Updating text in a C Win32 API STATIC control drawn with WS_EX_TRANSPARENT -


I have some static labels and buttons on it I make all the labels a transparent background so I can call background red . In the callback, I process the WM_CTLCOLORSTATIC message, set the control ID with GetDlgCtrlID () and then:

  SetBkMode (HDC) wParam, TransNet); // Stable Control BKGD Transparent Return (INT_PTR) (HBRUSH) GetStockObject (NULL_BRUSH);  

So far the form is drawn, the background is red and the label text is drawn to the top.

After the user interaction, I need to change the text, so I issue a SetDlgItemText () message and attract the new text. The problem is that the old text is not being erased, and the new text is pulled over it.

After reading today to some extent, it seems that the problem is the controlling parent (form) which is responsible for the drawing background. This means that when you change the label text, the control overlines the new text, but the form does not automatically show the background again.

The question is how do I redo rectangle area labeled control (preferably without subclassing)?

Added:

I have tried the following:

  HWND hctrl; Hctrl = GetDlgItem (HWD, Control ID); Redrawondo (HTTRL, 0, 0, RDW_UPDENEVE) RDWOOLHLRRNRDW_FRAMAMANDU || RDWYADADT || RDW_ARAC (RDWNTNLPANT); // RDW_UPDATENOW  

and:

I do not handle WM_PAINT messages at all, only:

  case WM_CTLCOLORSTATIC: SetBkMode ((HDC) WPAMAM, transnenet); Return (INT_PTR) (HBRUSH) GetStockObject (NULL_BRUSH); Int Library: :: SetCollectText (Int'l ControlId, String STECT) // Dialog Out {Ent Rated; Retal = Setdalguitum Text (hwd, control id, sText.c_str ()); RECT RECT; Hw & htl; Hctrl = GetDlgItem (HWD, Control ID); GetClientRect (hctrl, and rect); Map Window Points (HTTL, HWND, (PINT *) and REXT, 2); Invalid note (hwd, and riket, true); Return rate; }  

Mark, thank you for doing this work.

Use illegal use on capture rectangle by control.

RECT rect; GetClientRect (hctrl, and rect); Invalid note (HTTL, and Riket, true); Map Window Points (HTTL, HWND, (PINT *) and REXT, 2); Redrawondo (HWD, and reactivity, faucet, RDW_ARAC | RDWNAVANDAdit);

No comments:

Post a Comment