Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding my own application events in Control Panel -> Sounds

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?

like image 207
Paulius Avatar asked Sep 17 '08 07:09

Paulius


1 Answers

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.

like image 128
Adrian Clark Avatar answered Dec 04 '22 05:12

Adrian Clark