gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 13:11:25 28 4
gpt4 key购买 nike

我刚读过 this question我真的很喜欢this answer到这个问题。自然地,一个有趣的问题出现在我的脑海中……

如何在控制面板 -> 声音和音频设备 -> 声音 -> 程序事件中添加我自己的(我自己的应用程序的)事件?

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

最佳答案

与 Google 的一段美好时光让我看到了一篇名为“Creating Your Own Sound Alerts”的 CodeProject 文章。秘诀似乎都在 HKEY_CURRENT_USER\AppEvents 注册表项下。

来自文章:

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.

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

关于windows - 在控制面板 -> 声音中添加我自己的应用程序事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/80918/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com