What’s the proper way to minimize to tray a C# WinForms app?

There is actually no managed way to do that form of animation to the tray in native winforms, however you can P/Invoke shell32.dll to do it:

Some good info here (In the comments not the post):

http://blogs.msdn.com/jfoscoding/archive/2005/10/20/483300.aspx

And here it is in C++:

http://www.codeproject.com/KB/shell/minimizetotray.aspx

You can use that to figure out what stuff to Pinvoke for your C# version.

Leave a Comment