VC 任务栏图标闪烁
像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); } }

作者:Dozeoo
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

浙公网安备 33010602011771号