September 22, 2018
Hot Topics:

Quickstart Guide to Screensavers

  • November 19, 2002
  • By Karl Moore
  • Send Email »
  • More Articles »

When your screensaver application is run (by, say, the Display applet or Windows itself) numerous arguments are passed to it, depending on what the calling application wants it to do. You can extract command-line arguments by analysing the string returned by the Command function.

Here's a list of arguments you may encounter, along with what they are asking your screensaver to do:

/pDisplay a preview of your screensaver (followed by a handle to the preview window)
/cDisplay any settings for your screensaver (followed by a handle to the Display Properties window)
/pDisplay a preview of your screensaver (followed by a handle to the preview window)
/sDisplay full screensaver
/aShow change password dialog box (followed by a handle to the Display Properties window)

Determining the Mode

To determine the screensaver mode, you need to analyse any passed arguments.

  • Use the following code to determine which mode you are currently in, preferably placing it into your Sub Main:
If Left(Command, 2) = "/p" Then' Run "Previewing your Screensaver" codeElseIf Left(Command, 2) = "/c" ThenMsgBox "Settings Dialog Box (If Required) Goes Here"ElseIf Left(Command, 2) = "/s" ThenMyScreensaverForm.ShowElseIf Left(Command, 2) = "/a" Then' Run "Changing the Password" codeEnd If

Page 3 of 8

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.


Thanks for your registration, follow us on our social networks to keep up-to-date