?
Solved

How to create a screen saver in VB?

Posted on 1998-07-17
5
Medium Priority
?
167 Views
Last Modified: 2010-05-03
Hello,
How would one go about creating a screen saver (.scr) in visual basic 5 ?  I know it can be done, but how?

Any help would be great!
Thanx in advance,
Rob
0
Comment
Question by:rob2000
[X]
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
5 Comments
 
LVL 1

Expert Comment

by:sirigere
ID: 1466125
I will send you a sample project of screen saver let me know your e-mail ID
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1466126
rob2000,
Here is the step by step "How to makeer a screen saver" that has been in some paq's that I answered. Let me know if you have anyquestions.

A couple of things are: Make your the boardstyle of your  form (the one you want to show as SS) to none, and show it as maximized.

To sirigere: you should not lock a question when you are not providing an answer.

Regards.
Dalin


Screen savers are simply .exe files renamed to .scr.
There are only a few things you need  to do.

Make the project start up from Sub Main. Do this by going
to Tools | Options | Project and selecting the
Start-up form as Sub Main.
This Sub should look something like this:

  Sub main()
  ' Check to see if we should blank the screen, or display
  ' the Setup dialog box.

   If InStr(Command$, "/c") Then ' looks in command string for screen saver parameters
      SetupForm.Show 1
      ElseIf InStr(Command$, "/s") Then
  BlankForm.Show
      End If

   ' Wait until there are no form visible, then quit.
    While DoEvents() > 0 ' Loop until no forms visible
    Wend
  End Sub

   This is all you really need but this won't look very good.
On the setup form you can put all your parameters and save them to an
INI or the system registry.  You can add routines to the blank form so that
the screen saver actually does something; like animations, flashing colours,
dots and lines etc. etc.   But there are some more important things, the Mouse
Pointer still shows. So, we'll use an API to get rid of it. Put this in the
declarations section of the module:


Declare Function ShowCursor Lib "user32" Alias "ShowCursor" (ByVal bShow As Long) As Long
                                     
Then add these subs:

 Sub HideMouse()
    While ShowCursor(False) >= 0
    Wend
   End Sub

 Sub ShowMouse()
       While ShowCursor(True) < 0
       Wend
    End Sub

 Call the HideMouse() from the Blankform's Load event
  and the ShowMouse() from the UnLoad.
 
 
0
 

Author Comment

by:rob2000
ID: 1466127
Thank you very much Dalin!
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1466128
rob2000,
If my answer worked for you, you should reject sirigere's answer and reopen the question so that I can relock in.
Thank you for your attention.
Regards
Dalin
0
 
LVL 9

Accepted Solution

by:
Dalin earned 150 total points
ID: 1466129
Thank you, rob2000.
Good luck in your project.
Regards
Dalin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses
Course of the Month15 days, 9 hours left to enroll

741 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