Fazer uma PerguntaFazer uma Pergunta
 

RespondidoApplication in System Tray

  • quarta-feira, 4 de novembro de 2009 18:01vjsakec99 Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    I have a windows application when I press the X button to close the application I want it still running in system tray. How can I go about it? I am using the Notify but I cannot work it out.
    Varun

Respostas

  • quarta-feira, 4 de novembro de 2009 18:51BigTuna99 Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    Hook the Form Closing event and cancel it and set the visibility of the Form to false and set ShowInTaskbar to false as well.  Then in the click event of your notifyicon, simply show the form.  Your app will still show up when the users presses Alt-Tab however.



    If this answers your question, please mark the question as answered.
    • Marcado como Respostavjsakec99 quarta-feira, 4 de novembro de 2009 19:10
    • EditadoBigTuna99 quarta-feira, 4 de novembro de 2009 18:51spelling
    •  

Todas as Respostas

  • quarta-feira, 4 de novembro de 2009 18:51BigTuna99 Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    Hook the Form Closing event and cancel it and set the visibility of the Form to false and set ShowInTaskbar to false as well.  Then in the click event of your notifyicon, simply show the form.  Your app will still show up when the users presses Alt-Tab however.



    If this answers your question, please mark the question as answered.
    • Marcado como Respostavjsakec99 quarta-feira, 4 de novembro de 2009 19:10
    • EditadoBigTuna99 quarta-feira, 4 de novembro de 2009 18:51spelling
    •  
  • quarta-feira, 4 de novembro de 2009 19:10An Anon Coward Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hook the Form Closing event and cancel it and set the visibility of the Form to false and set ShowInTaskbar to false as well.  Then in the click event of your notifyicon, simply show the form.  Your app will still show up when the users presses Alt-Tab however.

    If a form isn't visible it won't show up in the Taskbar or in the Alt-Tab list.
  • segunda-feira, 9 de novembro de 2009 18:35Aadhi123 Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Adding Additional Info: If the Icon file is not specified the system tray will not work. Creating new icon in the project and mapping it in the icon properties of "notify icon" should help.