在控制面板中添加我自己的应用程序事件 - >声音 [英] Adding my own application events in Control Panel -> Sounds

查看:236
本文介绍了在控制面板中添加我自己的应用程序事件 - >声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚阅读了这个问题,我真的很喜欢这个答案的问题。自然地,一个有趣的问题出现在我的头脑中...

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?

推荐答案

CodeProject文章称为创建自己的声音提醒。看来秘密调料都在 HKEY_CURRENT_USER\AppEvents 注册表项下面。

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.

从文章: p>

From the article:


好的,创建新的Sound Alert Scheme很容易。现在让我们移动到声音中添加自己的声音警报类型。为此,请按照以下步骤操作。

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

  2. 在XYZAlert键(您在上述步骤中创建的密钥)下创建另一个键,并命名为.default

  3. 设置默认值。一些.wav文件的路径的默认键。例如。 C:\abc\abc.wav

  4. 在XYZAlert下创建另一个键并将其命名为.current,并将路径设置为某个wav文件,或将其留空。

  5. 现在在HKEY_CURRENT_USER\AppEvents\EventLabels下创建另一个键,并将其命名为XYZAlert

  6. 将此键的默认值设置为XYZ Alert Here。

  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."

完成了。现在去你的控制面板并启动声音小程序。您将看到新的声音警报类型,名称为XYZ Alert。

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.

请注意,您还必须使用 a href =http://msdn.microsoft.com/en-us/library/ms712879(VS.85).aspx =noreferrertitle =MSDN - PlaySound> PlaySound 本地电话。

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

这篇关于在控制面板中添加我自己的应用程序事件 - >声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆