|This is an asynchronous function, that means it returns immediately after beginning the flashing.|
Once the handle of a window is known, it is possible to flash the window with a caption and/or taskbar button.
Another code sample shows how to enumerate handles for the child windows of the main VFP window. Apply the FlashWindowEx to any of these windows and watch the result.
* * *
The FlashWindowManager class shown here once added to C# WinForm project automatically adds FlashWindow and FlashStop extension methods to every form in the project.
With fairly small changes the FlashWindowManager class can be used with .NET WPF forms.
public static void FlashWindow(
this Window window,
FlashWinFlags flags = FlashWinFlags.FlashAll,
int count = int.MaxValue,
nt timeout = 0)
var windowInteropHelper = new WindowInteropHelper(window);
FlashWindow(windowInteropHelper.Handle, flags, count, timeout);