Hi all,

could you please help me to remove flick when i subclass an Edit control, this my code:

Code:
LRESULT CALLBACK WindowProcedureEdit(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    RECT lpRect;

    HDC hDC;
        
    HBRUSH hBrush,oBrush;
    
    if(message == WM_PAINT)
    {

        GetClientRect(hwnd, &lpRect);
        hBrush = CreateSolidBrush(RGB(255,255,255));
        oBrush = CreateSolidBrush(RGB(250,0,0));

        hDC = GetDC(hwnd);
        FillRect(hDC,&lpRect,hBrush);
        FrameRect(hDC,&lpRect,oBrush);
        
        ReleaseDC(hwnd, hDC);

        DeleteObject(hBrush);
        DeleteObject(oBrush);
        return 0L;
    }
    if(message == WM_ERASEBKGND)
    {
        return 1L;
    }
    return CallWindowProc(g_oldEditProc, hwnd, message, wParam, lParam);
}