I’m drawing text on window at WM_PAINT message, is there any way i can refresh that window region before drawing a new line of text so the old text at the same location would get erased?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to call InvalidateRect for the window with the
bEraseparameter set toTRUEso that it will erase itself before the WM_PAINT is generated.This is often required when the window is a static text control, as those don’t erase themselves automatically when you change their value.
Make sure your window is handling WM_ERASEBKGND properly and the window class doesn’t have a NULL background brush, as this is the mechanism used by InvalidateRect to do the erasing.