Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Display a screen saver

Posted on 1999-07-15
Medium Priority
Last Modified: 2010-04-30
I know how the /s and /c parameters work. Is there a way to display a preview of the screen saver in the preview window using VB 6.
Question by:LSDyeman
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 13

Accepted Solution

Mirkwood earned 600 total points
ID: 1525115
Use the /p parameter.
The /p parameter is preview

' Check the command line arguments
    ' The command-line argument /p is used to launch the preview box
    If Left(Command$, 2) = "/p" Then
       RunMode = RM_PREVIEW

    ' The command-line argument /c is used to launch the screen saver in setup mode
    ElseIf Left(Command$, 2) = "/c" Then
       RunMode = RM_CONFIGURE

    ' The command-line argument /s is used to launch the screen saver in normal operating mode
    ElseIf Left(Command$, 2) = "/s" Or Command$ = "" And Not App.PrevInstance Then
       RunMode = RM_NORMAL
    ' The command-line argument /a is used to launch the password mode
    ElseIf Left(Command$, 2) = "/a" Then
       RunMode = RM_PASSWORD
LVL 13

Expert Comment

ID: 1525116
Untested code that I have just sitting here waiting for me to have some time to play with it!

Public Sub PreviewDisplay()
  ' this routine displays a form in the little screen saver preview display
  ' note: code based on source by Jeff Hack
  ' the preview window handle will be in the right 3 chars of the calling arguments
  Dim Temp%, PrevHWND As Long
  ' note we don't show the "Main_Form" here as it tries to maximize itself
  ' against the entire screen and besides a mouse move/key press could end the
  ' display instead of clicking on a button.
  PrevHWND = CLng(Right$(Command$, Len(Command$) - 3))
  Temp% = SetParent(PreviewForm.Picture1.hWnd, PrevHWND) 'set active window to the preview window
  ' show the graphic in the window, this is a static display but
  ' a active one could be done here
  PreviewForm.Picture1.Left = 0
  PreviewForm.Picture1.Top = 0
  DoEvents        'allow Windows to check for other events
  Do While IsWindowVisible(PrevHWND) <> 0 ' wait around until the window dissapears (ok or cancel)
    DoEvents  'allow Windows to check for other events
End Sub


Author Comment

ID: 1525117
Sounds good to me. I'll have to try it. If it works, I can send you a copy of my screen saver, if you want.
LVL 13

Expert Comment

ID: 1525118
I'd like that

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question