Vaibhav Gaikwad
Microsoft .NET developer
Bla Code! Bla Code!

Flashing your window, getting attention.

Tuesday, March 13, 2007 5:41 PM

This is a simple example of using Win32 api in .NET. I'll use the FlashWindow() API from user32.dll so as to make the window go flashing and get attention.

Take a simple Windows form and add a button to it. Add a reference to System.Runtime.InteropServices namespace. And heres the code.

// --------- code -----------
[DllImport("user32")]
public static extern int FlashWindow(int hWnd, int bInvert);

public partial class Form1 : Form
{
   public Form1()
   {
      InitializeComponent();
   }

   private void button1_Click(object sender, EventArgs e)
   {
      FlashWindow(this.Handle.ToInt32(), 1);
   }
} // -------- code ends

This was nice and simple for the start.

-Vaibhav Gaikwad




Feedback

# free roblox

The very enjoyful game roblox robux to get it now http://freerobuxnow.com/ 9/28/2017 3:07 PM | free roblox on robux

Post a comment