Creating Screen Savers Using MSVC ++Page 4 |
This page discusses the frameworks you can use for constructing your screen saver
I've had enough! I want to go home
I want to see the previous page
If you use the Visual C++ App Wizard to create a MFC application for you, you can take advantage of MFC functionality and the Class Wizard message mapping. This makes it easier to process windows messages and dialog boxes, especially if you are already used to creating MFC applications
However, App Wizard assumes that you want to use the "Doc/View" architecture, and generates your application that way. You will have to delete the "doc" and "view" files and classes, then insert your own window classes. Luckily, this is fairly easy to do. The process is explained later.
An alternative is to ignore MFC and set up your own message processing loops and so on. I'm used to MFC and like using classes (being an Object Oriented programmer), so I stick with MFC. However, if you are used to doing without MFC, then you should be able to adapt my code samples without too much effort.
The Windows SDK documents a set of screen saver routines that can be used to create screen savers. These routines are accessed via the SCRNSAVE.LIB library file. You write your screen saver to fit within the SCRNSAVE framework, which looks after all the functionality such as terminating when user input is detected, managing screen saver passwords, and detecting preview window requests.
All you need to supply are a few pre-named routines :
The disadvantage is that you cannot easily fit this into a MFC framework, and it is not as flexible as doing it yourself. I prefer to be in control and to try to understand what is going on behind the scenes. This is why I don’t use the SCRNSAVE library, but use a cut-down MFC framework instead.