BOOL PlayWav(UINT nResId)
{
BOOL bRet = FALSE;
HRSRC hWaveRes = FindResource(AfxGetResourceHandle(), MAKEINTRESOURCE(nResId), _T("WAVE"));
if (hWaveRes != NULL)
{
HGLOBAL hGlobMem = LoadResource(AfxGetResourceHandle(), hWaveRes);
if (hGlobMem != NULL)
{
bRet = sndPlaySound((LPCTSTR)LockResource(hGlobMem), SND_ASYNC | SND_MEMORY);
FreeResource(hGlobMem);
}
}
return bRet;
}
posted on 2010-11-26 21:58
张志松 阅读(160)
评论(0) 编辑 收藏 引用