像QQ来消息时的,图标闪烁效果
将如下代码添加到Timer响应函数中
else if (nIDEvent ==
1)
{// 任务栏图标闪烁
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);
}
}
转载于:https://www.cnblogs.com/nightnine/p/7503507.html
相关资源:VC MFC 托盘图标闪烁与消息提示.rar.rar