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