Solved

Screen Saver?

Posted on 1998-10-23
3
366 Views
Last Modified: 2010-04-30
Is there a way to make a VB program run as a screen saver?
I noticed that a program I downloaded put two files in the windows directory a .scr file and a .ini file, but the actual .exe file is int's it's own directory.
0
Comment
Question by:timothy1
  • 2
3 Comments
 

Accepted Solution

by:
Fantym earned 50 total points
ID: 1441384
The only difference between a Screen saver and a normal program is the extinsion.  Windows finds all programs with the .scr extension and lists them and their titles as Screen Savers.  You could make a program that is named .scr and it calls to an external .exe in a different directory.  The Settings part of the screen saver is sent as a command line switch /C .
And Example of this is:
         if Command$ = "/c" then frmSetting.show

Here is a useful api to hide the currsor

Declare Function ShowCursor Lib "user32" Alias _
"ShowCursor" (ByVal bShow As Long) As Long

bShow is either True or False

0
 

Author Comment

by:timothy1
ID: 1441385
What exactly do you put in the program that you call the  visual basic screensaver.exe with? And do you just write it on a .bas and then change the file extension?
0
 

Author Comment

by:timothy1
ID: 1441386
Well I made bas program and put the following in the sub main:

Dim returnvalue As Double
returnvalue = Shell("c:\windows\desktop\screensaver\GMscreensaver.EXE", 3)
AppActivate returnvalue
End

And then I changed the extension to the compiled program above to scr and selected it as my screensaver and it did call the listed program, but I got a runtime error # 6 overflow.

Plus it kept loading the screensaver program without waiting for the delay to start the screensaver that windows has. So I figure I got a bunch of missing code. What do I need to do?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 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