Animation with OpenGL

I am having a problem with the animation in my program. I am using coding a MDI in MFC and one widow has animation. When I minimize this window the animation is still on the screen. I was wondering if anyone new what to do.