finally i found 1 solution(doublebuffering for avoid flickers and others):
(these code is in my label window procedure)
Code:
case WM_ERASEBKGND:
{
HDC mdc = CreateCompatibleDC(NULL);//creating the doublebuffer
Size a=inst->GetSize();//get the control size
Position b=inst->GetPosition();//get ocntrol position
HBITMAP mbmp = CreateBitmap(a.Width,a.Height,1,24,NULL); //create the bimap with a size
HBITMAP moldbmp = (HBITMAP)SelectObject(mdc,mbmp);//select the DC from that bitmap
HDC labeldc=GetDC(inst->hwnd);//get the label DC
BitBlt(mdc,0,0,a.Width,a.Height,GetDC(GetParent(inst->hwnd)),b.X, b.Y,SRCCOPY);//copy the parent control
TransparentBlt(mdc,0,0,a.Width,a.Height,labeldc,0,0,a.Width,a.Height,(UINT)inst->clrBackColor);//copy the label DC to mdc(double buffer), without backcolor
BitBlt(GetDC(inst->hwnd),0,0,a.Width,a.Height,mdc,b.X, b.Y,SRCCOPY);//now copy the double buffer to label dc
//clean objects
SelectObject(mdc,moldbmp);
DeleteObject(mbmp);
DeleteDC(mdc);
}
but i get these strange error on TransparenBlt():
"obj\Debug\main.o||In function `ZN5label7WndProcEP6HWND__jjl@16':"
"undefined reference to `_imp__TransparentBlt@44'"
the clrBackColor it's a COLORREF type.
isn't the 1st time that i get these strange error, can you please give me more information?