What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! Help » Play sound effect upon program launch.

Play sound effect upon program launch.
Author: Message:
malovon
New Member
*


Posts: 3
Joined: Nov 2011
O.P. Play sound effect upon program launch.
Hello, i have been trying to figure out if it's possible to add a sound effect when you start MSN messenger, so far it seems not likely, but i thought I'd try asking here if anyone know.
I know you can add a sound effect through windows when you launch any program, but that's just a little too much spam, and it also doesn't work all the time.   Anyway, thanks in advance.
11-14-2011 10:41 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Play sound effect upon program launch.
A script could be written to do so when you sign in...
11-14-2011 11:36 AM
Profile E-Mail PM Find Quote Report
malovon
New Member
*


Posts: 3
Joined: Nov 2011
O.P. RE: Play sound effect upon program launch.
Well, i don't know much about writing scripts, practically nothing really.
11-14-2011 11:46 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Play sound effect upon program launch.
This script will play a sound when Messenger starts:
js code:
var sSoundFile = "C:\\directory\\sound.mp3";
function OnEvent_Initialize(bMessengerStart) {
    if (bMessengerStart) {
        MsgPlus.PlaySound("\\" + sSoundFile);
    }
}

- Open the scripting editor in Plus!
  (Plus! > Preferences & Options > Plugins > Plus! Plugins)
- Click on "create new..."
- Fill in the name of the new script.
- In the editor copy/paste the code above
- Change the path and file name to the sound (mp3, wav, voc, au, ... but not wma files) you want.
- Press "Save All"

If you want to learn scripting in Plus! you can read the documentation here or download it here.

This post was edited on 11-14-2011 at 03:16 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-14-2011 01:05 PM
Profile PM Find Quote Report
malovon
New Member
*


Posts: 3
Joined: Nov 2011
O.P. RE: Play sound effect upon program launch.
Hey, thanks a lot!
This works perfectly.
11-14-2011 01:13 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Play sound effect upon program launch.
PS: Another method you can use, for any program you want, is to make a small batch file/Windows script which you need to run instead of the program itself:
VBScript code:
sSoundFile = "C:\directory\sound.mp3"
sProgramFile = "C:\Program Files\Windows Live\Messenger\msnmsgr.exe"
'Don't forget to update the proper paths in above variables

Set oWshShell = CreateObject("Wscript.Shell")
oWshShell.Run Chr(34) & sProgramFile & Chr(34)

Set oMCI = CreateObject("MCI.MMcontrol")
oMCI.Command = "Close all"
oMCI.FileName = sSoundFile
oMCI.Command = "Open"
oMCI.Wait = True
oMCI.Command = "Play"

Set oWshShell = Nothing
Set oMCI = Nothing
Save that as a file named "whatever.vbs" (the file extension VBS is important!) and start this instead of Messenger itself.

More about VBScript can be found here.

This post was edited on 11-14-2011 at 03:29 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-14-2011 03:07 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On