Reputation: 13306
I'm developing a small chat application between client and server.
I would like to get notified when a message received and the chat window is minimized (like in live messenger)
here's the method that I append the received message onto.
public void AppendChat(string msg)
{
if (InvokeRequired)
{
this.Invoke(new Action<string>(AppendChat), new object[] { msg });
return;
}
txtChat.AppendText(GetTime() + msg + Environment.NewLine + Environment.NewLine);
if (this.WindowState == FormWindowState.Minimized)
{
//... what should I write in here?
}
}
sorry for my bad English. I hope I wrote the right words for the questions.
Upvotes: 0
Views: 1157
Reputation: 14532
[DllImport("user32.dll")]
private static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
Use the user32 method to flash the window. You can read more about the method and it's parametrs here. It has a complete code and examples for how to use it.
Upvotes: 3