mfc_vc++最小化或者离开当前窗口后任务栏消息提醒功能
代码放在OnTimer里面
void CMFCApplication1Dlg::OnTimer(UINT_PTR nIDEvent)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
//if(nIDEvent==100)
//{
/*if (this != GetForegroundWindow())
{
HWND hCurwnd = NULL;
hCurwnd = ::GetForegroundWindow();
DWORD threadID = ::GetCurrentThreadId();
DWORD threadprocessid = ::GetWindowThreadProcessId(hCurwnd, &threadID);
::AttachThreadInput(threadID, threadprocessid, TRUE);
this->SetForegroundWindow();
::AttachThreadInput(threadID, threadprocessid, FALSE);
}*/
if (nIDEvent == 100)
{
if (::GetActiveWindow() == AfxGetMainWnd()->m_hWnd)
{
//KillTimer(100); //当程序窗口置于最前时,停止闪烁
}
else
{
FlashWindow(TRUE);
}
}
CDialogEx::OnTimer(nIDEvent);
}