Chinaunix首页 | 论坛 | 博客
  • 博客访问: 819482
  • 博文数量: 756
  • 博客积分: 40000
  • 博客等级: 大将
  • 技术积分: 4980
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-13 14:40
文章分类

全部博文(756)

文章存档

2011年(1)

2008年(755)

我的朋友

分类:

2008-10-13 16:07:37

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---------------------

阅读(387) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~