Quickstart Guide to Screensavers, Page 2
Screensavers are technically very similar to regular Visual Basic applications. The only real difference is the file extension, SCR as opposed to EXE.
Your screensaver could contain anything from a simple static company logo through to flying animations, a mini noughts-and-crosses through to a full-blown shoot-'em-up game. You create these just as you would any regular application, though with screensavers you typically place all the graphics and related functionality on one form.
First off, try creating a test project by following through our instructions for Setting Up your Form, Compiling Your Screensaver and Running your Screensaver. Then run through our extra sections to Determine the Mode, moving on later to Previewing your Screensaver. You might also want to find out about Changing the Password and Verifying the Password, plus you'll probably be interested in techniques such as Hiding the Cursor, Disabling Task Keys and Checking for Mouse Movement.
Setting Up your Form
Before creating a screensaver, you need to define a few key form properties.
- Set the following properties on your screensaver form:
Compiling your Screensaver
You can compile any regular project into a screensaver.
- Click 'File'
- Select 'Make <ProjectName>.exe'
- When the 'Make Project' box appears, change the '.exe' extension to '.scr'
- Hit 'OK'
Running your Screensaver
You can run a screensaver from the Control Panel's Display applet or by simply double-clicking on it within Windows Explorer. This section deals with handling it via the Display applet.
- Compile your Screensaver to the Windows directory
- Click 'Start', 'Settings', 'Control Panel'
- Double-click the 'Display' icon
- Select the 'Screensaver' tab and choose your screensaver from the list
- Hit the 'Preview' button
Note: Your screensaver may simply 'popup' before you hit the Preview button. If this occurs, you need to add code to handle the passed screensaver arguments. You do this by first Determining the Mode, then responding accordingly. We'll deal with this in the next section.