How to redraw/repaint a window when a dialog removed from it under stereo model?

How to redraw/repaint a window when a dialog removed from it with stereo model?

i used WM_PAINT ,it does not work,
i need the variable from dialog, if i don’t catch it immediately,i can’t display the main window rightly.