Grade 12 skilled screen saver?
Printable View
Grade 12 skilled screen saver?
Hey can you be more specific as what you want????
Here's some code I picked up a long time ago (back in the era of VB4 I think, but it still seems to work fine in 5 and 6).
Code:Option Explicit
'Screen Saver Template
'When you compile this, change the .exe extention to .scr so it can be recognized
'by Windows as a screen saver. If you put it in your windows directory, it will also
'show up in the normal screen saver listing
Private Sub Form_Load()
'use this to load your options/settings form if you have one
'it might be either C or O, but I can't recall
If Left$(LCase$(Command), 2) = "/c" Then
'Load frmOptions
Unload Me
End If
Me.WindowState = vbMaximized
Me.BorderStyle = vbBSNone
Me.Caption = ""
Me.KeyPreview = True
Me.Show
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
CheckActivity
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
CheckActivity
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
CheckActivity
End Sub
Private Sub CheckActivity()
'this sub keeps track of "activity"; the screen saver will be terminated
'after enough movements/keys have been detected (generally some events fire after
'Form_Load such as Mouse_Move, so this can screen those out to prevent it from
'being terminated on load
Static nCount As Integer
If nCount > 4 Then Unload Me
nCount = nCount + 1
End Sub
how do I make some interesting objects moving inside the screen saver?
Well on that part you're on your own. This is just the skeleton of the screen saver. Most often though, I've seen people stick timers onto the form and then have some code in the Timer event that will draw things or do something else interesting. I'll see if I can dig up a simple one I did that just drew random shapes (which honestly was about as far as I ever went into making a screen saver :D )