11

I'm trying to create an application with Windows 7 Notification Area Flyouts, like the volume, power and wireless icons built in to Windows 7.

I haven't been able to find any information though on .NET APIs to implement this. Is there a built-in way to create notification area flyouts? If not, is there any other way to implement this functionality?

Grimthorr
  • 6,856
  • 5
  • 41
  • 53
nhinkle
  • 1,157
  • 1
  • 17
  • 32
  • This doesn't answer your question directly, as it isn't the Windows 7 stuff, but have you seen [Growl](http://www.growlforwindows.com/gfw/)? It is very nifty, and has .Net bindings available! It has the drawback of requiring another software installation, though. –  Aug 21 '11 at 00:51
  • Related: http://stackoverflow.com/questions/5094447/how-do-i-use-the-correct-windows-system-colors – Zack Peterson May 07 '12 at 16:38

2 Answers2

9

There isn't anything special about them, just a plain window (Form) without a title bar. ControlBox = false and Text = "" in winforms. The only things you have to do is set its Location property so it shows up above the notification area. And implement the Deactivate event to close it.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Those settings worked well for styling it the way I wanted, but what about the positioning? I've been looking at ways to do that, and so far haven't found any particularly elegant solutions. Do you have any advice on how to do the positioning? – nhinkle Aug 30 '11 at 23:55
  • You can infer it from Screen.PrimaryScreen.WorkingArea vs .Bounds. The difference is where the taskbar is located. Not 100% reliable, pinvoking ShAppBarMessage with ABM_GETTASKBARPOS is. Elegance off the table there. – Hans Passant Aug 31 '11 at 00:09
  • Are there any tutorials or other resources out there for the pinvoke route, or is that probably not worth my time? – nhinkle Aug 31 '11 at 00:58
  • It is not, .NET integration with the shell is very poor. It's been around too long and is unfriendly to work with. Using the Screen class is fine. If every anybody has another taskbar on their screen, extremely rare, they'll understand why you popup shows where it does. – Hans Passant Aug 31 '11 at 01:03
  • OK. I'll try using this method, and let you know how it goes. – nhinkle Aug 31 '11 at 04:54
4

I answered a similar question here:

Create a System-tray styled box in Winforms (C#)

Configure a few properties as mentioned there will get you a window that looks like this, which you can fill with your own controls. From here you'll need a small panel docked to the bottom of the window, a few links to put in it, and whatever other controls you need.

example border window

Community
  • 1
  • 1
Factor Mystic
  • 26,279
  • 16
  • 79
  • 95