In WM_PAINT you need to paint the currently shown graph.