Post some code. You seem to be invoking WM_PAINT message using InvalidateRect or UpdateWindow in your WM_PAINT handler.