Dave's Brain

Browse - Programming Tips - How can I flash a Window to indicate an error?

Date: 2008jul17
Platform: win32
Language: C/C++

Q.  How can I flash a Window to indicate an error?

A.  Use FlashWindow() or FlashWindowEx() like this:

BOOL Flash(const HWND hwnd) { FLASHWINFO info; ZeroMemory(&info, sizeof(info)); info.cbSize = sizeof(info); info.hwnd = hwnd; info.dwFlags = FLASHW_CAPTION | FLASHW_TRAY | FLASHW_TIMERNOFG; info.uCount = UINT_MAX; info.dwTimeout = 0; return ::FlashWindowEx(&info); }

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.