Click to See Complete Forum and Search --> : Screen Saver??????????


ant
May 29th, 2001, 02:15 PM
How do i change an exe to a scr file without damaging it? I'm trying to create a screen saver, but i dont know how to change the extension, do i just change the extension when i compile it?? Help!

coolbiz
May 29th, 2001, 03:05 PM
Just rename it.

-Cool Bizs

ant
May 29th, 2001, 03:16 PM
Ok, i got that far, but when i put it in the system folder and then try to use it and preview it
i don't get anything, nothing even loads!


--Ant

coolbiz
May 29th, 2001, 04:31 PM
Just wondering, what happen when you doubleclick on your program (while the extension is still EXE)? Does it do what it supposed to do (not saying that you don't know what you're doing)? Screensaver application has to handle few instruction from the OS.

<snipet from MSDN>
Windows communicates with Screen Savers through command line arguments. The ScrnSave.lib library handles this for Screen Savers that are written to use it, but other Win32 Screen Savers marked 4.0 or higher must handle the following command line arguments:

ScreenSaver - Show the Settings dialog box.
ScreenSaver /c - Show the Settings dialog box, modal to the
foreground window.
ScreenSaver /p <HWND> - Preview Screen Saver as child of window <HWND>.
ScreenSaver /s - Run the Screen Saver.
In addition, Windows 95 Screen Savers must handle:

ScreenSaver /a <HWND> - change password, modal to window <HWND>
<HWND> is a HWND presented on the command line as an unsigned decimal number.
</snipet>

Another thing that you wanna be careful is if you're using the MouseMove() event to detect mouse activity, ensure to not do anything until the form is already up and running. When I wrote my Screensaver application I had to do the following:


dim bReady as Boolean

private Sub Form_Load()
' we're not ready yet - so disable SCREENSAVER functionality
bReady = false

' maximize form
me.WindowState = vbMaximized
End Sub

private Sub Form_Paint()
' this event will be called once the form is already up and running
if (not bReady) then
' now enable it
bReady = true
end if
End Sub

private Sub Form_MouseMove(Button as Integer, Shift as Integer, X as Single, Y as Single)
' since there is a mouse activity - then end the app
if (bReady) then End
End Sub

private Sub Form_KeyUp(KeyCode as Integer, Shift as Integer)
' since there is a keyboard activity - then end the app
if (bReady) then End
End Sub




The reason is, when the form is maximized or minimized, it triggers the MouseMove() event but the thing is, you're just resizing your window. Without the flag, your application will end even before you start your application. Of course this is all assuming that you're using the same method as me :)

-Cool Bizs

razilatif
May 30th, 2001, 11:01 PM
just rename the filename from exe to scr... could be done in dos prompt easyly.... sorry for my english

ren abc.exe abc.scr

that's all

Alattas
September 20th, 2001, 04:00 AM
I'm wondering if this is applicable for all Win32 Operating System.. I'm using win2k and I'm facing problem running the screensaver.. it works fine in the configuration and preview mode.. but not in the running mode.. Any idea what can be wrong??


Alattas

Cimperiali
September 20th, 2001, 04:51 AM
May be you should read this (and download the source code provided at end of doc) to see how screenSavers can be build with vb :
http://www.codeguru.com/vb/articles/htm/s_saver.shtml

Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater

coolbiz
September 20th, 2001, 09:26 AM
I did use it on NT4 and Win2K before. It worked fine for even Win9x (except mine needs NT security so did not write anything for Win9x).

Can't say for sure what is wrong. You can email me your code and I'll check it out on my PC. Email me at coolbiz@pd.jaring.my

-Cool Bizs