Never use the *Paint and the *DC functions together. Use the *Paint functions ONLY in response to the WM_PAINT message, and *DC in all other situations. Then you shouldn't have problems.