Windows custom sound events
Say for example I want to make windows 7 play a sound every time I open Firefox
This is what I do:
With regedit I create the following:
HKEY_CURRENT_USER->AppEvents->EventLabels->Firefox (default = Firefox) HKEY_CURRENT_USER->AppEvents->Schemes->Apps->Firefox->Launch (default = 0)
I then go to Control Panel - Sound - Sounds and give the newly created Firefox -> Launch program event a sound to play. I apply the changes and open firefox - no sound is played.
What am I missing? I guess I need to specify somewhere what this event is about?
Solution 1:
What you did is partly correct, but it is only half of the thing that is necessary. The second question on this MSDN page describes how to add a Windows sound event and how to play it.
With your registry changes you created an application specific sound Event for the application Firefox. Then you set the sound file to play using Control Panel. Now if Firefox calls the Windows function PlaySound as PlaySound(_T("Launch"), NULL, SND_APPLICATION)
then Windows will play the sound you configured. The problem is that Firefox does not call PlaySound, so the sound event is not triggered and the sound is not played.