VC 任务栏图标闪烁

像QQ来消息时的,图标闪烁效果

将如下代码添加到Timer响应函数中

else if (nIDEvent == )
{// 任务栏图标闪烁
if (this != GetForegroundWindow())
{
//// this->ShowWindow(SW_RESTORE);
//// MoveWindow(&m_rect);
HWND hCurwnd = NULL;
hCurwnd = ::GetForegroundWindow();
DWORD threadID = ::GetCurrentThreadId();
DWORD threadprocessid = ::GetWindowThreadProcessId(hCurwnd, &threadID);
::AttachThreadInput(threadID, threadprocessid, TRUE);
this->SetForegroundWindow();
::AttachThreadInput(threadID, threadprocessid, FALSE);
}
}

VC 任务栏图标闪烁

上一篇:Redis 学习笔记4: Redis 3.2.1 集群搭建


下一篇:iOS开发-ViewController的生命周期和切换