What am I trying to achieve?
I am writing a windows-form based application in C# .NET 2.0. The application should behave like this: No form should be visible; just a system tray icon is the entire application. So, I have to hide the form during startup and make a NotifyIcon
available in the system tray with a ContextMenuStrip
attached to it.
What have I done so far?
I have created a Windows application with the default form's properties WindowState-Minimized
and ShowInTaskbar-false
. Added a NotifyIcon
and attached a ContextMenuStrip
to it.
What's happening? The application starts as a system tray icon and the form is hidden. So far so good. But when I am working with other applications and when I switch between other application using the Alt-Tab combination in Windows, the application icon appears in the switch-application menu; and when I select my application, the form appears.
What's expected? The application should not be available in the switch-application menu; because, the form is empty and there is no functionality attached to it. All that is needed is the system-tray icon.
How to hide the application entry from the switch-application menu?
Thanks.