« November 2005 »
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
You are not logged in. Log in

Programming Tips
Tuesday, 15 November 2005
Repainting immediately!
Mood:  bright
Topic: VC++
Many times it happens that when we call Invalidate(TRUE /*or FALSE*/) the window is not refreshed immediately. 
It happens because Invalidate() simply marks an area to be repainted. 
The area will be painted only during the next WM_PAINT message. This message won't be immediately fired 
if there is another blocking event taking place. Now you should be knowing why it didn't repaint immediately. 
:)

So now what to do if we wish to refresh the window immediately.
Simply do this!

Invalidate(TRUE);//marks the window to be painted
UpdateWindow();//by passes the message queue and paints immediately

Don't forget to call Invalidate() before UpdateWindow() or else the window will not be refreshed. 
The reason being that your region is not marked to be refreshed. 


Posted by Nibu babu thomas at 12:02 PM
Updated: Tuesday, 15 November 2005 12:07 PM

View Latest Entries