Buffo Posted July 27, 2006 Share Posted July 27, 2006 Hi, with the search I found a lot of topics about screensavers, but not that info I need. Is it possible to start the screensaver that is actual selected? Here is an example API-Call form VB. Perhaps someone can convert it into Autoit-DLLCall? Private Declare Function SendMessage Lib "user32" Alias _ "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, ByVal lParam As Long) As Long Private Const WM_SYSCOMMAND = &H112& Private Const SC_SCREENSAVE = &HF140& Public Sub StartScreenSaver(ByVal hWnd As Long) Dim Result As Long Result = SendMessage(hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0&) End Sub Thx in advance Regards, Buffo Link to comment Share on other sites More sharing options...
Helge Posted July 27, 2006 Share Posted July 27, 2006 This seems to work : $screensaver = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "SCRNSAVE.EXE") If FileExists($screensaver) Then Run($screensaver & " /s") Link to comment Share on other sites More sharing options...
Buffo Posted July 27, 2006 Author Share Posted July 27, 2006 Yes, it works under WinXPSP2 Great and simple idea. Sometimes it's so easy but my fault is that I think always much to complicated Link to comment Share on other sites More sharing options...
SailorSonic Posted November 9, 2006 Share Posted November 9, 2006 (edited) $screensaver = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "SCRNSAVE.EXE") If FileExists($screensaver) Then Run($screensaver & " /s") ----------------------------------------------------------------------------- The code works great, but how can i add a 10 second delay to it? Edit: Yes I have read the help file, but i still can't figure it out. Edited November 9, 2006 by SailorSonic Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted November 9, 2006 Share Posted November 9, 2006 if you read the helpfile and take a look at sleep it would help alot Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now