Dave's Brain

Browse - programming tips - win32 flash window

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);
}
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, 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.
Advertisements: