如何发挥一个标准的Windows声音? [英] How to play a standard windows sound?

查看:131
本文介绍了如何发挥一个标准的Windows声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何找出声音文件的用户在控制面板配置?

例如:我想播放声音的连接设备

哪些API可用于查询的控制面板声音设置?

我看到有通过在控制面板对话框第三方程序做了一些自定义项,所以必须有这些计划与全球声音设置交流的方式。

编辑:谢谢。我不知道指定注册表项的名称时,PlaySound也只是起到相应的声音文件。

要玩设备Conntected的声音:

  :: PlaySound(TEXT(DeviceConnect),NULL,SND_ALIAS | SND_ASYNC);


解决方案

PlaySound 是API,也见播放系统声音

How do I find out which sound files the user has configured in the control panel?

Example: I want to play the sound for "Device connected".

Which API can be used to query the control panel sound settings?

I see that there are some custom entries made by third party programs in the control panel dialog, so there has to be a way for these programs to communicate with the global sound settings.

Edit: Thank you. I did not know that PlaySound also just played appropriate sound file when specifying the name of the registry entry.

To play the "Device Conntected" sound:

::PlaySound( TEXT("DeviceConnect"), NULL, SND_ALIAS|SND_ASYNC );

解决方案

PlaySound is the API ,also see Play System Sounds

这篇关于如何发挥一个标准的Windows声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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