AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Do idle time tasks with custom-made ScreenSavers!

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Thu Apr 22, 2004 11:44 am    Post subject: Do idle time tasks with custom-made ScreenSavers! Reply with quote

A lot many ppl don't know that screensaver (*.scr) files are actually regular executables. try renaming a .scr file to .exe or vice versa, they'll run the same.

now utilising this we can make a compiled script to do some tasks like cleaning temp files etc. and rename it to something.scr to make windows see it as a screensaver. (i use one that cleans temp folder, and scans entire drive for *.tmp , ~*.* files and cleans them, then runs defrag or AV tools)

here are few things worth noting:
-when a screensaver is dbl-clicked, its run by windows with a '/S' cmd line parameter.
-when you select a screensaver in display properties window, its run by windows with a '/P' cmd line parameter.
-when the ScreenSaver Settings button is pushed on Display Properties window, then windows runs the screensaver with '/C:3346456' parameter. (actually the number can be anything)

these are utilised to detect if the screensaver is actually run when system is idle or is a preview run or is dbl-clicked.

you can have the following as the starting point for your script.

Code:
ifequal, 1, /P, goto, preview
IfInString, 1, /c:, goto, config
MouseGetPos, X, Y
ifnotequal, 1, /S, goto, select
SetTimer, check, 500

; stuff to do when system is idle, goes here
exitapp


select:
;stuff to do when screensaver is run manually
exitapp


preview:
;splashtext saying 'Rajat is cool' here   ;)
exitapp

config:
;screensaver settings here
exitapp


check:
MouseGetPos, CX, CY
ifnotequal, CX, %X%, exitapp
ifnotequal, CY, %Y%, exitapp
return


_________________


Last edited by Rajat on Fri Apr 23, 2004 2:31 am; edited 2 times in total
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10463

PostPosted: Thu Apr 22, 2004 1:38 pm    Post subject: Reply with quote

Wow, that is great info. I did not know you could just rename an EXE to be SCR and use it as a screensaver.

You didn't mention in your post, but I guess it's obvious that you must first compile your script into an EXE for this to work.

Thanks for the tip; I wish I had known about it years ago.
Back to top
View user's profile Send private message Send e-mail
JonTheNiceGuy



Joined: 22 Apr 2004
Posts: 18
Location: Manchester, UK

PostPosted: Thu Apr 22, 2004 11:14 pm    Post subject: In the same vein... how about Reply with quote

Why not make splashtext be something like HTML, so you can include an image and tables? This would mean you could write a full screensaver in AHK?

Perhaps something like the (now apparently defunct) electricsheep.org?

JonTheNiceGuy
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10463

PostPosted: Fri Apr 23, 2004 12:32 am    Post subject: Reply with quote

Nice idea, I'll put it on the list.
Back to top
View user's profile Send private message Send e-mail
JonTheNiceGuy



Joined: 22 Apr 2004
Posts: 18
Location: Manchester, UK

PostPosted: Fri Apr 23, 2004 12:46 am    Post subject: Just out of interest... Reply with quote

How long is the list, and how does one go about helping?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Fri Apr 23, 2004 1:50 am    Post subject: Reply with quote

er, Chris I've mentioned the compiling part... maybe i should've made that bold. see :
Quote:
now utilising this we can make a compiled script to do some tasks like cleaning temp files etc.


uhh...sorry for being late!
_________________
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10463

PostPosted: Fri Apr 23, 2004 2:23 am    Post subject: Reply with quote

Quote:
Chris I've mentioned the compiling part
Oops, so you did. Sorry.

Quote:
How long is the list, and how does one go about helping?
The list is a prioiritized spreadsheet and has over 500 pending items (admittedly many of them are minor or out-of-date). Help is always welcome, and can take many forms, e.g. suggesting new features, making add-ons for editors such as Crimson Editor and Scite, improving the documentation, finding open source code that might be adaptable to new features, or even contributing your own design and code. For this last one, you don't even have to be a programmer: well thought-out designs can be just as valuable as code (even more so since they tend to be more understandable).
Back to top
View user's profile Send private message Send e-mail
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Fri Apr 23, 2004 2:28 am    Post subject: Reply with quote

Quote:
Why not make splashtext be something like HTML, so you can include an image and tables?


this can already be done... instead of posting it here i'm posting it as a separate thread so that more ppl can use it. http://www.autohotkey.com/forum/viewtopic.php?p=537
_________________
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Fri Apr 23, 2004 2:30 am    Post subject: Reply with quote

added a note regarding settings in main post.
_________________
Back to top
View user's profile Send private message
JonTheNiceGuy



Joined: 22 Apr 2004
Posts: 18
Location: Manchester, UK

PostPosted: Mon Apr 26, 2004 9:25 am    Post subject: The ToDo List Reply with quote

Quote:
The list is a prioiritized spreadsheet and has over 500 pending items

Where would I find that spreadsheet?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10463

PostPosted: Mon Apr 26, 2004 11:55 am    Post subject: Reply with quote

It's not published since it's very informally written. If you have an interest, after I make the next release today or tomorrow I'll try to put at least the highest priority items online or in the forum.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group