Digital Clock Screensaver?

Goober

Turning Right ...
Joined
Dec 5, 2003
Messages
6,143
Location
Victoria, BC, CANADA!!!
Would it be possible to make This into a screensaver?

It would be great if someone could, please and thanks!!!

If not, then where could I find a similar, clock-style Screensaver?
 
Hmm, this might actually be possible...

I havn't written any screensavers at all, but over the years I've collected a lot of resources teaching me how to write them.

But I have long working hours (9am to 8pm) at the moment (project deadline is near), so I'll look into this fun project this weekend...
 
Hey, ya, if you could, that would be fantastic.

I have a PC, FYI . . .
 
If you have VB, it's quite easy, but you need to have all the appropriate files installed (VB Runtime maybe and SHDOCVW.dll). Although it's not very good, I'll attach it.
 

Attachments

Originally posted by funxus
If you have VB, it's quite easy, but you need to have all the appropriate files installed (VB Runtime maybe and SHDOCVW.dll). Although it's not very good, I'll attach it.

funxus, could you post the source code / project? My sources are using C++, and I'm not very experienced in VB. You'll have my eternal gratitude! :)

Then based on your code, I can write up a factory program that turns any Flash into a screensaver :D


*Think*: With any luck, funxus will probably do this before weekend and post the results with source code. Hmmm, that'll be nice. :crazyeye:

Let me guess... are you making use of the Microsoft Web Browser control? I was planning to do that in C++...
 
@ funxus - I don't understand how to run/install it, what is this VB thing?

I'm not a programmer, btw . . .
 
Unzip it and put it in your C:\windows\system32 directory. You should then see it when you click on the 'ScreenSaver' Tab in your display properties dialog.

Loads kinda slow, but then it runs just fine.
 
Originally posted by RealGoober
@ funxus - I don't understand how to run/install it, what is this VB thing?

I'm not a programmer, btw . . .

Just extract the SCR file somewhere. That'll be your backup copy.

Then right-click on it. There should be a "Install" or something similar option in the pop-up menu. That'll copy the SCR file to your Windows directory, and then it'll be available in your display properties | screen saver tab.

IMPORTANT
While this file from funxus is save to use, you don't want to open SCR files from anywhere. SCR files are executable and can contain virus. Beware of any attached SCR files in e-mail.
 
Hmm, ok, I think it works, thanks for the help . . .
 
You guessed right about the Webbrowser control (named 'w' in the code). As you can see at the address below, it's all still on the internet, which means that you need to be connected and it can be a bit slow to load... I assume it'd be possible to download "hand.swf", include it in a resource file, extract it when program is run and then load it into the browser from the local HD, but it'd take more work than I'm willing to put in...

Code:
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
        x As Long
        y As Long
End Type
Dim fP As POINTAPI
Dim nP As POINTAPI

Private Sub Form_Load()
    If App.PrevInstance Then Unload Me
    GetCursorPos fP
    w.Navigate2 "http://www.lares.dti.ne.jp/%7Eyugo/storage/monocrafts_ver3/03/index.html"
End Sub

Private Sub Form_Resize()
    Me.Move 0, 0, Screen.Width, Screen.Height
    w.Move 0, 0, ScaleWidth, ScaleHeight
End Sub

Private Sub Timer1_Timer()
    GetCursorPos nP
    If nP.x <> fP.x Or nP.y <> fP.y Then Unload Me
    fP = nP
End Sub

Timer1 is a Timer object, which means that the code in Timer1_Timer runs (in my app) every 100ms.

@RealGoober, VB is short for Visual Basic, and is a language designed by MS for Windows only.

I also assure you that I haven't put in any virus in the screensaver, if it's worth anything.:)

BTW, does anyone know how to hide the cursor and then show it again when the program is closed? Is it done in VB, or can I use an API?
 
I don't have much to do in school atm, so I did a few fixes to the program... It only starts when it's supposed to be used as a screensaver, is now put on top and hides the cursor. New source below:
Code:
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Type POINTAPI
        X As Long
        Y As Long
End Type
Dim oP As POINTAPI
Dim fP As POINTAPI
Dim nP As POINTAPI

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40
Private Const HWND_TOPMOST = -1

Private Sub Form_Load()
    If App.PrevInstance Then Unload Me
    If UCase(Command$()) <> "/S" Then End
    GetCursorPos oP
    SetCursorPos Screen.Width, Screen.Height
    GetCursorPos fP
    w.Navigate2 "http://www.lares.dti.ne.jp/%7Eyugo/storage/monocrafts_ver3/03/index.html"
End Sub

Private Sub Form_Resize()
    Me.Move 0, 0, Screen.Width, Screen.Height
    w.Move 0, 0, ScaleWidth, ScaleHeight
    OnTop
End Sub

Private Sub Form_Unload(Cancel As Integer)
    SetCursorPos oP.X, oP.Y
End Sub

Private Sub Timer1_Timer()
    GetCursorPos nP
    If nP.X <> fP.X Or nP.Y <> fP.Y Then Unload Me
    fP = nP
End Sub

Public Sub OnTop()
    SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE Or SWP_SHOWWINDOW
End Sub
 
Woah, cool, thanks. I know nothing about the Code, but the clock looks great, thanks!!!

And ya, apparently you coulda put a virus in, but there wasn't, and I trust ya anyway.
 
Thanks a lot, funxus! You now have my eternal gratitude :)

I'll see if I can make the "Flash to Screensaver" factory this weekend :)
 
funxus said:
You're welcome.:)

kcwong, please show us what you came up with. Maybe it'd be easier to make a "Homepage to Screensaver"-program.

Finally! I got some spare time to complete this project :beer:
And here's the result!

FlashScreenSaver.zip contains the .SCR file - the screen saver itself. Launch it and it will display a help page.
FlashScreenSaver_Src.zip contains the VB6 project, source code and resource files.

It allows you to select a Flash (actually, you can also choose images and animations (.gif) too) by pressing F1, or enter a URL by pressing F2.

The Flash is not added inside resource file... rather I used an INI file to point to it.

Thanks again, Funxus :goodjob: Without your source code as base, I'll never be able to make it - I'm a C/C++/J2SE/J2EE person you see :)
 
Back
Top Bottom