views:

1196

answers:

4

I'm looking to write a notification application where I'd like to provide popup notifications from the taskbar similiar to the ones in MSN Messenger or most other chat programs. Are there any good examples using VB .NET or C#, ideally without using Win32 calls? Thanks.

+1  A: 

http://www.codeproject.com/KB/miscctrl/RobMisNotifyWindow.aspx

Paul Alexander
I found this example online. I'm trying to avoid using Win32 calls.
Achilles
As mentioned in the article, the only way to show the window without stealing focus is the Win32 ShowWindow method. So you can't really avoid Win32 and get the behavior you want.
Paul Alexander
Took a bit of digging but I found this reference:http://msdn.microsoft.com/en-us/library/system.windows.forms.form.showwithoutactivation.aspxas well as this SO question:http://stackoverflow.com/questions/630420/prevent-form-from-stealing-focus/631082Looks like you can prevent the focus from being stolen without Win32 calls :-D
Achilles
@Achilles: Nice!
Paul Alexander
A: 

Also known as toast notifications. Here's another example on codeproject.

Slightly off-topic. I think these things are evil. I wish they were never invented because they always pop up at at time when it is most distracting. See human task switching considered harmful.

And for the love of mike, please detect presentation mode and stop putting up toasts. (Do you hear me skype?!)

Brian Reiter
+3  A: 

Perhaps try this, modeled after Outlook rather than MSN Messenger, but of course you can still tweak it:

http://www.codeguru.com/csharp/csharp/cs_misc/userinterface/article.php/c10139

The Matt
A: 

I found a better solution for what I'm looking to to do: http://msdn.microsoft.com/en-us/magazine/cc163732.aspx

Achilles