EXE to Screen Saver

Posted on 1999-12-07
Medium Priority
Last Modified: 2012-05-04
I want my whole application to be a Screen Saver. If a rename .exe to .scr it considers the application as Screen Saver. My problem is, as soon I select  my Screen saver from the properties dialog of windows, it starts running the screen saver in full screen, which is supposed to run in the small screen provied within properties Dialog. Kindly let me know the solution for this.
Thank You.
Question by:USHASHI
LVL 32

Expert Comment

ID: 2262415
MS article:

"HOWTO: Create a Screen Saver in Visual Basic"

**Make sure that you include the code to prevent multiple instances of your program from running.**
LVL 43

Expert Comment

ID: 2262451
You need to make sure that you support the command line argument screensaver.scr /p hWnd

the /p indicates that the exe should run as a preview in the window described by hWnd. You would probably need to parse the command line using

strCommandLine = Command()

and if /p is there use the hWnd and the setparent api call to place your application in the window defined.

I haven't tried this myself though I have done it the other way around, by having multiple windows previewing different screen savers in a vb front end. (You can even have multiple screensavers running in the same preview window!)

Expert Comment

ID: 2262490
Eric37: If you create the screensaver the way described in the article, then will VB register the app as a 'WindowsScreenSaverClass'-class window, or will it still be a ThunderForm-class window? (of course I could test this myself, but if you know allready it could save me some time ;-)

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

LVL 32

Expert Comment

ID: 2262546
No, the window class will not change.
TimCottee is correct, you MUST also provide /P support for preview.

Here is a sample VB5 screen saver which supports the preview switch:


Accepted Solution

VBGuru earned 200 total points
ID: 2268036
You should install your Screen Saver using the following command.
command:  rundll32.exe desk.cpl,InstallScreenSaver c:\win\system\Flying Windows.scr
result:  Installs the new screen saver and runs the display/screen saver preview property page

Author Comment

ID: 2275928
Thanks VbGuru.

Expert Comment

ID: 2278990

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

589 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