Source Code for Feng Yuan's excellent book: Windows Graphics Programming.
All content copyright Feng Yuan.
Source code downloaded from: http://blogs.msdn.com/b/fyuan/archive/2007/03/20/source-code-for-windows-graphics-programming-win32-gdi-and-directdraw.aspx