O'Reilly logo

Software Engineering and Computer Games by Rudy Rucker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

25.3. Persistent display

It takes some work to make a Windows program have a persistent display that stays in place even if the window is resized or covered and then uncovered.

The OnDraw method

The standard practice is to have our Windows programs do all their writing to the screen within one single function, the CView::OnDraw method. When does your CView get an OnDraw message? Here are four important ways that this can happen.

  • When the CView is first created, whether automatically at startup, by a File | New call or by a Window | New call. First there’s a call to the constructor, then a call to OnCreate, and then a call to OnDraw.

  • Whenever your CView gets resized, whether by dragging a corner using a command like Window | Tile, or by clicking ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required