在控制面板中添加我自己的应用程序事件 - >声音

时间:2022-01-11 02:50:56

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?

另外一个相关的问题,我想在这里也应该回答一下......当我的应用程序中的事件发生时,如何播放控制面板中指定的声音?

1 个解决方案

#1


6  

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.

与Google的一段美好时光让我看到了一篇名为“创建自己的声音警报”的CodeProject文章。好像秘密酱都在HKEY_CURRENT_USER \ AppEvents注册表项下面。

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. 在HKEY_CURRENT_USER \ AppEvents \ Schemes \ App.Default下创建一个新密钥并命名为XYZAlert

  3. Create another key under the key XYZAlert (the key you have created in above step) and name that .default
  4. 在XYZAlert键(您在上面的步骤中创建的键)下创建另一个键,并命名为.default

  5. Set the default value of the .default key to path of some .wav file. eg. C:\abc\abc.wav
  6. 将.default键的默认值设置为某个.wav文件的路径。例如。 C:\ ABC \ abc.wav

  7. Create another key under XYZAlert and name that to .current and also set the path to some wav file, or leave that blank.
  8. 在XYZAlert下创建另一个键并将其命名为.current,并将路径设置为某个wav文件,或将其留空。

  9. Now Create another key under HKEY_CURRENT_USER\AppEvents\EventLabels and name that XYZAlert
  10. 现在在HKEY_CURRENT_USER \ AppEvents \ EventLabels下创建另一个键并命名为XYZAlert

  11. Set the default value of this key to anything like "XYZ Alert Here."
  12. 将此键的默认值设置为“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.

那就结束了。现在转到控制面板并启动声音小程序。您将看到名为XYZ Alert的新声音警报类型。

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

请注意,您还必须使用“PlaySound”本机调用播放声音。

#1


6  

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.

与Google的一段美好时光让我看到了一篇名为“创建自己的声音警报”的CodeProject文章。好像秘密酱都在HKEY_CURRENT_USER \ AppEvents注册表项下面。

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. 在HKEY_CURRENT_USER \ AppEvents \ Schemes \ App.Default下创建一个新密钥并命名为XYZAlert

  3. Create another key under the key XYZAlert (the key you have created in above step) and name that .default
  4. 在XYZAlert键(您在上面的步骤中创建的键)下创建另一个键,并命名为.default

  5. Set the default value of the .default key to path of some .wav file. eg. C:\abc\abc.wav
  6. 将.default键的默认值设置为某个.wav文件的路径。例如。 C:\ ABC \ abc.wav

  7. Create another key under XYZAlert and name that to .current and also set the path to some wav file, or leave that blank.
  8. 在XYZAlert下创建另一个键并将其命名为.current,并将路径设置为某个wav文件,或将其留空。

  9. Now Create another key under HKEY_CURRENT_USER\AppEvents\EventLabels and name that XYZAlert
  10. 现在在HKEY_CURRENT_USER \ AppEvents \ EventLabels下创建另一个键并命名为XYZAlert

  11. Set the default value of this key to anything like "XYZ Alert Here."
  12. 将此键的默认值设置为“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.

那就结束了。现在转到控制面板并启动声音小程序。您将看到名为XYZ Alert的新声音警报类型。

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

请注意,您还必须使用“PlaySound”本机调用播放声音。