Hi Shabbir, I tried in devc++, as i know about compiler there is no break point, so i used the MessageBox() to know the flow. after compiling i am not getting the messagebox message but the window is updating as per the graph is concern when i am closing the window the msg loop will send the all the messgebox() message. first around 8 tp 9 messagebox containing wm_paint afetr that i am going to erasebkgnd, i dont know this will workout for me..