EXE to Screen Saver

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.**
TimCotteeHead of Software ServicesCommented:
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!)
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 ;-)

The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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:

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
USHASHIAuthor Commented:
Thanks VbGuru.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.