最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用Api函数播放wav文件
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
这个是一段例程,希望能对你有帮助
[DllImport("Winmm")]
public static extern bool PlaySound(string pszSound, IntPtr hmod, UInt32
fdwSound);
private const Int32 SND_ASYNC = 1;
private const Int32 SND_LOOP = 8;
private const Int32 SND_FILENAME = 131072;
private void PlayScreenSaver()
{
PlaySound ("BackGround.WAV", IntPtr.Zero, SND_ASYNC | SND_FILENAME |
SND_LOOP);
……
}
private void StopScreenSaver()
{
PlaySound (null, IntPtr.Zero, SND_ASYNC);
……
}
更详细的信息可以到这里看看
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/mmfunc_9uxw.asp
[DllImport("Winmm")]
public static extern bool PlaySound(string pszSound, IntPtr hmod, UInt32
fdwSound);
private const Int32 SND_ASYNC = 1;
private const Int32 SND_LOOP = 8;
private const Int32 SND_FILENAME = 131072;
private void PlayScreenSaver()
{
PlaySound ("BackGround.WAV", IntPtr.Zero, SND_ASYNC | SND_FILENAME |
SND_LOOP);
……
}
private void StopScreenSaver()
{
PlaySound (null, IntPtr.Zero, SND_ASYNC);
……
}
更详细的信息可以到这里看看
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/mmfunc_9uxw.asp
相关文章
- python常用的文件操作函数介绍 03-23
- Python文件操作函数详解 11-25
- 文件重命名rename函数用法 05-25
- JAVA文件操作常用函数 10-31
- 再点一次Active的名,我把你的函数功能扩充了一下,嘻嘻,现在能以树型结构列出整个磁盘上的文件啦。 01-12
- 一个取得文件扩展名的函数(不过函数名叫做取得FILETYPE呢!呵呵!) 01-12