views:

561

answers:

1

I have just read this question and I really loved this answer to the question. Naturally, an interesting question popped in my head...

How to add my own events (of my own applications) in the Control Panel -> Sounds and Audio Devices -> Sounds -> Program Events?

And another related question, that I suppose should be answered here as well is... How do I play those sounds specified in the Control Panel, when the event in my application occurs?

+2  A: 

A bit of quality time with Google led me to a CodeProject article called "Creating Your Own Sound Alerts". It seems the secret sauce is all underneath the HKEY_CURRENT_USER\AppEvents registry key.

From the article:

Ok, it was very easy to create new Sound Alert Scheme. Now let us move to add our own Sound Alert Type in the sounds. For that follow these steps.

  1. Create a new Key under HKEY_CURRENT_USER\AppEvents\Schemes\App.Default and name that XYZAlert
  2. Create another key under the key XYZAlert (the key you have created in above step) and name that .default
  3. Set the default value of the .default key to path of some .wav file. eg. C:\abc\abc.wav
  4. Create another key under XYZAlert and name that to .current and also set the path to some wav file, or leave that blank.
  5. Now Create another key under HKEY_CURRENT_USER\AppEvents\EventLabels and name that XYZAlert
  6. Set the default value of this key to anything like "XYZ Alert Here."

That's finish. Now go to your control panel and start the sounds applet. You will see the new sound alert type with name XYZ Alert.

Note that you also have to play the sounds using the "PlaySound" native call.

Aydsman