dpisarciuc
Programmer
Hi!
I need a transparent static control.
The WS_ES_TRANSPARENT doesn't work properly. To be exactly - it doesn't work at all instead MSDN says what it should make the control transparent.
My control have to by placed on a dialog which has a bitmap in background. And it should be able to change the text...
Drawing such control - no problems...
The BIG problem is WM_SETTEXT, sent by SentWindowText, which have to erase the old text, not affecting the background, and draw the new text.
To reach this effect, i use the next code:
if ( m_bTransparent )
{
CRect rcClient;
GetClientRect(&rcClient);
CWnd* pParent = GetParent();
ClientToScreen(&rcClient);
pParent->ScreenToClient(&rcClient);
SetRedraw(FALSE);
pParent->InvalidateRect(rcClient);
SetRedraw(TRUE);
}
return Default();
It's ok when the control's text is modified rarely, but when is necessary to modify the control's text very often - the control is flickering like crazy.
I think to use double buffering, but how to make the parent to draw it self in my memory dc? After pParent->SendMessage(WM_PAINT, (WPARAM)hMemDC); the dc is filled in black.
Thanks.
I need a transparent static control.
The WS_ES_TRANSPARENT doesn't work properly. To be exactly - it doesn't work at all instead MSDN says what it should make the control transparent.
My control have to by placed on a dialog which has a bitmap in background. And it should be able to change the text...
Drawing such control - no problems...
The BIG problem is WM_SETTEXT, sent by SentWindowText, which have to erase the old text, not affecting the background, and draw the new text.
To reach this effect, i use the next code:
if ( m_bTransparent )
{
CRect rcClient;
GetClientRect(&rcClient);
CWnd* pParent = GetParent();
ClientToScreen(&rcClient);
pParent->ScreenToClient(&rcClient);
SetRedraw(FALSE);
pParent->InvalidateRect(rcClient);
SetRedraw(TRUE);
}
return Default();
It's ok when the control's text is modified rarely, but when is necessary to modify the control's text very often - the control is flickering like crazy.
I think to use double buffering, but how to make the parent to draw it self in my memory dc? After pParent->SendMessage(WM_PAINT, (WPARAM)hMemDC); the dc is filled in black.
Thanks.