0
点赞
收藏
分享

微信扫一扫

VS PlaySound function and add the winmm.lib


需要在VS2008开发的软件中加入声音播放,需要使用PlaySound函数,具体方法是,

1, 在stdafx.h中加入#include <mmsystem.h>

2,在配置中加入winmm.lib,如下图。

VS PlaySound function and add the winmm.lib_PlaySound

3,使用具体函数,如下,

PlaySound(MAKEINTRESOURCE(IDR_WAVE_ALERT),AfxGetApp()->m_hInstance,SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);

IDR_WAVE_ALERT是在资源中Import的声音文件。

举报

相关推荐

0 条评论