Search code examples
c#.netconsolesystem-tray

.Net Console Application in System tray


Is there a way I can put a console application in the system tray when minimizing ?


Solution

  • A console has no window to minimize by itself. It runs in a command prompt window. You might hook the window messages and hide the window on minimize. In your application it's possible to add a tray icon just the same as you would do it in a windows application. Well, somehow this smells...

    But: I'm not sure why you want to do this. A console application is by design different to a windows application. Hence, maybe it's an option to change the app to be a windows form application?