Erbit Posted June 2, 2007 Posted June 2, 2007 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.
xcal Posted June 2, 2007 Posted June 2, 2007 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 How To Ask Questions The Smart Way
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