Jump to content

Start actual screensaver


Recommended Posts

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 :whistle:

Regards,

Buffo

Link to comment
Share on other sites

  • 3 months later...

$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 by SailorSonic
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...