@@ -598,7 +598,6 @@ void CTrafficMonitorDlg::ShowNotifyTip(const wchar_t* title, const wchar_t* mess
598598 {
599599 // 添加通知栏图标
600600 AddNotifyIcon ();
601- theApp.m_general_data .show_notify_icon = true ;
602601 }
603602 // 显示通知提示
604603 m_ntIcon.uFlags |= NIF_INFO;
@@ -608,6 +607,14 @@ void CTrafficMonitorDlg::ShowNotifyTip(const wchar_t* title, const wchar_t* mess
608607 CCommon::WStringCopy (m_ntIcon.szInfoTitle , 64 , title);
609608 ::Shell_NotifyIcon (NIM_MODIFY, &m_ntIcon);
610609 m_ntIcon.uFlags &= ~NIF_INFO;
610+
611+ // 如果不显示通知区域图标,则在弹出通知的一段时间后删除通知区图标
612+ if (!theApp.m_general_data .show_notify_icon )
613+ {
614+ // 延迟一定时间后删除通知区图标
615+ KillTimer (DELETE_NOTIFY_ICON_TIMER);
616+ SetTimer (DELETE_NOTIFY_ICON_TIMER, 8000 , NULL );
617+ }
611618}
612619
613620void CTrafficMonitorDlg::UpdateNotifyIconTip ()
@@ -1845,6 +1852,12 @@ void CTrafficMonitorDlg::OnTimer(UINT_PTR nIDEvent)
18451852 }
18461853 }
18471854
1855+ if (nIDEvent == DELETE_NOTIFY_ICON_TIMER)
1856+ {
1857+ DeleteNotifyIcon ();
1858+ KillTimer (DELETE_NOTIFY_ICON_TIMER);
1859+ }
1860+
18481861 CDialog::OnTimer (nIDEvent);
18491862}
18501863
@@ -2054,6 +2067,8 @@ BOOL CTrafficMonitorDlg::OnCommand(WPARAM wParam, LPARAM lParam)
20542067 if (uMsg == ID_CMD_TEST)
20552068 {
20562069 CTest::TestCommand ();
2070+ // ShowNotifyTip(CCommon::LoadText(_T("TrafficMonitor "), IDS_NOTIFY), _T("测试通知"));
2071+
20572072 }
20582073#endif // DEBUG
20592074 // 选择了插件命令
0 commit comments