Minimizing an Application to the System Tray... 
Author Message
 Minimizing an Application to the System Tray...

Hi everyone....

        I'm writing an application that will be doing the same procedure
every 5 minutes.     I want the "X" button to minimize the application to
the system tray and to let it keep running instead of closing it.     How do
I do this?

Anthony



Tue, 27 Apr 2004 14:30:59 GMT  
 Minimizing an Application to the System Tray...
Anthony

To get the form to "minimize" do this

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
    Cancel = True
    Me.Visible = False
    'code to show in the System Tray
End If
End Sub

Then go to http://groups.google.com/advanced_group_search and do a search
for ShellIconNotify to get your form to show up in the tray.

regards

Ian

** invalid email address, change dk to denmark

homepage http://www.kingsoft-denmark.com/
Tips & Tricks page http://tips.kingsoft-denmark.com/


Quote:
> Hi everyone....

>         I'm writing an application that will be doing the same procedure
> every 5 minutes.     I want the "X" button to minimize the application to
> the system tray and to let it keep running instead of closing it.     How
do
> I do this?

> Anthony



Tue, 27 Apr 2004 14:54:13 GMT  
 Minimizing an Application to the System Tray...
On Fri, 9 Nov 2001 06:54:13 -0000, "Ian Williams"

Quote:

>Then go to http://www.*-*-*.com/
>for ShellIconNotify to get your form to show up in the tray.

That would be Shell_NotifyIcon.

Are we all {*filter*}ed today ? :)

Regards, Frank



Tue, 27 Apr 2004 15:13:09 GMT  
 Minimizing an Application to the System Tray...
Ah, an old favorite in this ng.  Here is the best solution I have found for
this situation:

http://vbaccelerator.com/codelib/shell/systray.htm

HTH,
Christopher


Hi everyone....

        I'm writing an application that will be doing the same procedure
every 5 minutes.     I want the "X" button to minimize the application to
the system tray and to let it keep running instead of closing it.     How do
I do this?

Anthony



Tue, 27 Apr 2004 16:39:34 GMT  
 Minimizing an Application to the System Tray...
Hi Christopher,

        I downloaded the sample you mentioned and tried it.   When you
launch the application, it DOES appear in the SysTray, except that when you
click on the "X", the app shuts down instead of just minimizing.   I added
the code that Ian Williams suggested to the Form_QueryUnload to make the X
minimize it

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
    Cancel = True
    Me.Visible = False
    'code to show in the System Tray
End If
End Sub

, but then when I do do that, if I click on the icon in the systray, nothing
happens...     what am I doing wrong?

Anthony



Quote:
> Ah, an old favorite in this ng.  Here is the best solution I have found
for
> this situation:

> http://vbaccelerator.com/codelib/shell/systray.htm

> HTH,
> Christopher



> Hi everyone....

>         I'm writing an application that will be doing the same procedure
> every 5 minutes.     I want the "X" button to minimize the application to
> the system tray and to let it keep running instead of closing it.     How
do
> I do this?

> Anthony



Tue, 27 Apr 2004 22:23:35 GMT  
 Minimizing an Application to the System Tray...
You probably need add code
like form.show when click on icon

Quote:
> Hi Christopher,

>         I downloaded the sample you mentioned and tried it.   When you
> launch the application, it DOES appear in the SysTray, except that when
you
> click on the "X", the app shuts down instead of just minimizing.   I added
> the code that Ian Williams suggested to the Form_QueryUnload to make the X
> minimize it

> Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
> If UnloadMode = vbFormControlMenu Then
>     Cancel = True
>     Me.Visible = False
>     'code to show in the System Tray
> End If
> End Sub

> , but then when I do do that, if I click on the icon in the systray,
nothing
> happens...     what am I doing wrong?

> Anthony



> > Ah, an old favorite in this ng.  Here is the best solution I have found
> for
> > this situation:

> > http://vbaccelerator.com/codelib/shell/systray.htm

> > HTH,
> > Christopher



> > Hi everyone....

> >         I'm writing an application that will be doing the same procedure
> > every 5 minutes.     I want the "X" button to minimize the application
to
> > the system tray and to let it keep running instead of closing it.
How
> do
> > I do this?

> > Anthony



Tue, 27 Apr 2004 22:32:49 GMT  
 Minimizing an Application to the System Tray...
You need to replace the comment Ian made in the code: "'code to show in the
System Tray" with the code you need to place the icon in the system tray. In
the case of the vbAccelorator example all you need to use is SetIcon.

Alex


Quote:
> Hi Christopher,

>         I downloaded the sample you mentioned and tried it.   When you
> launch the application, it DOES appear in the SysTray, except that when
you
> click on the "X", the app shuts down instead of just minimizing.   I added
> the code that Ian Williams suggested to the Form_QueryUnload to make the X
> minimize it

> Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
> If UnloadMode = vbFormControlMenu Then
>     Cancel = True
>     Me.Visible = False
>     'code to show in the System Tray
> End If
> End Sub

> , but then when I do do that, if I click on the icon in the systray,
nothing
> happens...     what am I doing wrong?

> Anthony



> > Ah, an old favorite in this ng.  Here is the best solution I have found
> for
> > this situation:

> > http://vbaccelerator.com/codelib/shell/systray.htm

> > HTH,
> > Christopher



> > Hi everyone....

> >         I'm writing an application that will be doing the same procedure
> > every 5 minutes.     I want the "X" button to minimize the application
to
> > the system tray and to let it keep running instead of closing it.
How
> do
> > I do this?

> > Anthony



Wed, 28 Apr 2004 04:43:13 GMT  
 Minimizing an Application to the System Tray...
Well, it was 6:30 am, and I was rushing to get to work :-)

regards

Ian

** invalid email address, change dk to denmark

homepage http://www.*-*-*.com/
Tips & Tricks page http://www.*-*-*.com/


Quote:
> On Fri, 9 Nov 2001 06:54:13 -0000, "Ian Williams"

> >Then go to http://www.*-*-*.com/
> >for ShellIconNotify to get your form to show up in the tray.

> That would be Shell_NotifyIcon.

> Are we all {*filter*}ed today ? :)

> Regards, Frank



Wed, 28 Apr 2004 06:35:55 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. How to minimize application to system tray

2. CoolHide - Help you hide/minimize window to Tray and hide icons from the system tray

3. CoolHide - Help you hide/minimize window to Tray and hide icons from the system tray

4. Minimize AC00 to system tray

5. minimized in system tray

6. Minimize to system tray [VB6]

7. VB3: Minimize to Win 95 System Tray?

8. Starting app minimized in system tray

9. Minimize into System Tray

10. Minimize to system tray [VB6]

11. Minimizing a form to the system tray instead of the taskbar

12. ***** Minimize VB5 app to system tray

 

 
Powered by phpBB® Forum Software