doublew:我要是没有记错的话,CButtonST类最新版本(ver3.9)就直接支持鼠标掠过时发声.....
其中代码如下:
#ifdef BTNST_USE_SOUND
DWORD CButtonST::SetSound(LPCTSTR lpszSound, HMODULE hMod, BOOL bPlayOnClick, BOOL bPlayAsync)
{
BYTE byIndex = bPlayOnClick ? 1 : 0;
// Store new sound
if (lpszSound)
{
if (hMod) // From resource identifier ?
{
m_csSounds[byIndex].lpszSound = lpszSound;
} // if
else
{
_tcscpy(m_csSounds[byIndex].szSound, lpszSound);
m_csSounds[byIndex].lpszSound = m_csSounds[byIndex].szSound;
} // else
m_csSounds[byIndex].hMod = hMod;
m_csSounds[byIndex].dwFlags = SND_NODEFAULT | SND_NOWAIT;
m_csSounds[byIndex].dwFlags |= hMod ? SND_RESOURCE : SND_FILENAME;
m_csSounds[byIndex].dwFlags |= bPlayAsync ? SND_ASYNC : SND_SYNC;
} // if
else
{
// Or remove any existing
::ZeroMemory(&m_csSounds[byIndex], sizeof(STRUCT_SOUND));
} // else
return BTNST_OK;
} // End of SetSound
#endif
呵呵,不过还是要谢谢作者...
最新版本下载地址:
(发表于2003-4-23 14:47:00)
Alon21:我写的代码中有个错误,改正如下:
在CButtonST类中的PlaySound函数中CString sID="IDR_WAVE1";应该改为CString
sID=SoundID;
感谢happyweilin@163.com对错误的指出。
(发表于2003-4-25 9:04:00)
..........................................................................
--------------------next---------------------
阅读(401) | 评论(0) | 转发(0) |