Sign in to follow this  
Followers 0
Erbit

Please Help - Looping Problem

4 posts in this topic

Hello, I'm trying to make a program play music each time my screenscreen saver pops up, and stop that music unpon the screensaver closing. My problem is very simple:

#include <Sound.au3>

; Define the more important variables.
$SSProcess = "Helios.scr" ; Process name of the screensaver.

; Run the program.
#include <Sound.au3>

; Define the more important variables.
$SSProcess = "Helios.scr" ; Process name of the screensaver.

; Run the program.
While 1
    If (ProcessExists($SSProcess)) Then
        $MusicFile = _SoundOpen("D:\Desktop\My Stuff\Media\Music\Toolbox\Ænima\15 Third Eye .mp3") ; Path to the music file.
        _SoundPlay($MusicFile, 1)
        ExitLoop
    Else
        _SoundStop(1)
        ContinueLoop
    EndIF
WEnd

How do I make the loop actually work. I have not tried a Do...Until yet, but I don't know if that would work.

Thanks for the help, Erbit.

Share this post


Link to post
Share on other sites



Try this...

#include <Sound.au3>

HotKeySet('{ESC}', 'quit')

$sound = @WindowsDir & '\media\Windows XP Startup.wav'
$screensaver = '3dwindowsxp.scr'

_SoundOpen($sound, 'mysound')

Sleep(3000)
ShellExecute(@SystemDir & '\' & $screensaver)

While 1
    Sleep(100)
    If ProcessExists($screensaver) Then _SoundPlay('mysound')
WEnd

Func quit()
    _SoundClose('mysound')
    Exit
EndFunc

Share this post


Link to post
Share on other sites

That's what I was looking for! Thanks!

Share this post


Link to post
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
Sign in to follow this  
Followers 0