void startAlert(HWND hwnd, int durationMs, int timeoutMs)
{
    FLASHWINFO info;
    info.cbSize = sizeof(info);
    info.hwnd = hwnd;
    info.dwFlags = FLASHW_TRAY;
    info.dwTimeout = timeoutMs;
    info.uCount = durationMs == 0 ? 10 : durationMs / timeoutMs;
    FlashWindowEx(&info);
}

void stopAlert(HWND hwnd)
{
    FLASHWINFO info;
    info.cbSize = sizeof(info);
    info.hwnd = hwnd;
    info.dwFlags = FLASHW_STOP;
    info.dwTimeout = 0;
    info.uCount = 0;
    FlashWindowEx(&info);
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注

鄂ICP备17003086号. Copyright © 2016. All Rights Reserved.