angcba:void CbackdropDlg::OnTimer(UINT nIDEvent)
{
...
}
我认为amethystwu和vcxian两位高手在文档处说的内容有理,上面这段程序改为如下较好!
void CbackdropDlg::OnTimer(UINT nIDEvent)
{
if(!bkbmp)
{
bkbmp_n++;
if(bkbmp_n>2) bkbmp_n=0;
// Shell_NotifyIcon(NIM_DELETE, &nd);
switch(bkbmp_n)
{
case 0:
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
break;
case 1:
m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
break;
case 2:
m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON2);
break;
default:
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
nd.hIcon = m_hIcon;
// Shell_NotifyIcon(NIM_ADD, &nd);
Shell_NotifyIcon(NIM_MODIFY, &nd);
InvalidateRect(NULL,TRUE);//刷当前程序界面
}
CDialog::OnTimer(nIDEvent);
}
(发表于2005-4-20 17:18:00)
..........................................................................
--------------------next---------------------
阅读(269) | 评论(0) | 转发(0) |