Problems hiding the main form and displaying only a tray icon

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Danielb (Danielb_at_nospam.net)
Date: 11/28/04


Date: Sun, 28 Nov 2004 11:13:34 -0000


 I want my application to run most of the time as just an notify icon
visible in the system tray, with some dialogs windows that open if the user
selects an option from the context menu on the tray icon. I've had a look at
the example on code project that creates an application that runs in the
system tray:

http://www.codeproject.com/csharp/desktop_mail_checker.asp

So I copied how the above article sets up the main form: the form's
FormBorderStyle to none, set it to minizied, disable the titlebar controls
(maximize, minimize, close etc). It was all fine until I noticed that the
form was visible in the Alt-Tab menu and once you had alt-tabbed to it there
was no way of hiding it again :(

After a bit of googling I discover if I set the Form's FormBorderStyle to
FixedToolWindow then it was no longer visible in the Alt-Tab menu, result!
But today I have noticed that now I can no longer minimize or hide the form
it appears as a minizied tool window in the bottom left of my desktop when
the application is running and even worse if the user double clicks on the
title bar the window expands to its normal size, apart from the form is
empty and there's no way to minimize it again!

Anyone got any ideas as to how to completely hide form so its not visible as
a window on the taskbar or on the alt-tab menu? All I want is my
application's icon in the system tray while its running and a context menu
for the icon. I don't really need the main form at all!

Cheers,

DanielB



Relevant Pages

  • Re: Problems hiding the main form and displaying only a tray icon
    ... > I want my application to run most of the time as just an notify icon> visible in the system tray, with some dialogs windows that open if the> user selects an option from the context menu on the tray icon. ... It was all fine until I noticed that the> form was visible in the Alt-Tab menu and once you had alt-tabbed to it> there was no way of hiding it again:(> ... > But today I have noticed that now I can no longer minimize or hide the> form it appears as a minizied tool window in the bottom left of my desktop> when the application is running and even worse if the user double clicks> on the title bar the window expands to its normal size, apart from the> form is empty and there's no way to minimize it again! ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: perltray/tk intercept windows minimize function
    ... the system tray by interacting with the system tray icon as opposed to a ... double clicking the system tray icon redraws ... withdraws the main window and that sends an event to the application. ... Application can however withdraw the _icon_. ...
    (comp.lang.perl.tk)
  • Re: Tray Icons and custom shell
    ... messages to SysTray to forwarding WM_COMMAND event to some other parts or windows of the same app). ... PostMessage to send the appropriate command to the tray icon window. ... I've a custom shell and therefore no system tray. ...
    (microsoft.public.windowsxp.embedded)
  • Re: JDK 1.6 and JFrame icon
    ... for the main window is not displaying under Windows when using Alt-Tab. ... I does display fine in the window itself and in the task bar, but not when I use Alt-Tab. ... Maybe a bug related to the new 1.6 feature which allows you to specify multiple icon images. ...
    (comp.lang.java.gui)
  • Re: perltray/tk intercept windows minimize function
    ... ptk list while viewing the codecomments archives. ... the system tray by interacting with the system tray icon as opposed to a ... double clicking the system tray icon redraws ... withdraws the main window and that sends an event to the application. ...
    (comp.lang.perl.tk)