?
Solved

EXE to Screen Saver

Posted on 1999-12-07
7
Medium Priority
?
298 Views
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.
0
Comment
Question by:USHASHI
7 Comments
 
LVL 32

Expert Comment

by:Erick37
ID: 2262415
MS article:

"HOWTO: Create a Screen Saver in Visual Basic"
http://support.microsoft.com/support/kb/articles/Q146/9/07.asp

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

Expert Comment

by:TimCottee
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!)
0
 
LVL 4

Expert Comment

by:Jeremy_D
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 ;-)

0
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

by:Erick37
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:

http://www.arcatapet.com/vbsource/jdsvrvb5.zip
0
 
LVL 6

Accepted Solution

by:
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
 
0
 

Author Comment

by:USHASHI
ID: 2275928
Thanks VbGuru.
0
 
LVL 6

Expert Comment

by:VBGuru
ID: 2278990
welcome
0

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