像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); } }