Starting app minimized in system tray 
Author Message
 Starting app minimized in system tray

Hi.

I have 3 related questions (with sub-questions  : )

1. The following article:
http://www.*-*-*.com/
vbtsksettingformtobeinvisibleatitsinception.asp
says that it is impossible to have an application be invisible (no form
showing at all) when it is started. I have found out that I CAN do this,
just setting the 'visible' property to 'false'. Strange. The article seems
quite recent though. I have VB 6 with SP 5. Is that the reason? Is it safe
to do it that way or is it advised to have a separate module that is used as
startup object?

2. I want to have a system tray icon for my app. I've found numerous
examples of course. But, my app needs to startup and hide in the system tray
immediately (because it does its work silently, starting automatically when
Windows is started). When I try the system tray examples that I've found,
setting the form to invisible at startup (or at design time) will also make
invisible the system tray popup menu. Obviously because it belongs to the
form. But some example I've tried, hide the form with one of the menu's
commands, and then the system tray menu is still available. So at some point
the form needs to disappear. Ideas, anyone? I wouldn't like my form to
'flash' for a split second at startup, of course... I am looking for a
really neat solution (THE solution).

3. I keep the form loaded during the time the application is running. This
means my form is there all the time, active in the background, and ready to
be shown (quickly). I guess it needs to be loaded also, for the system tray
menu? And, secondly, I wonder, is there any advice against keeping a (just
one) form loaded when it is not used or should it be unloaded? (separate
from the fact that it probably needs to be loaded for the system tray menu).

OK that's it... I hope someone can help.

Best wishes for 2003.

Koen



Mon, 20 Jun 2005 02:34:13 GMT  
 Starting app minimized in system tray
For #2, just move the form off the screen in the load event and keep it
visible ...

  Me.Move -10000, -10000

For #3, when you need to "show" it, use the Move command again to centre on
the screen ...

  Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2

... and then vice-versa when "hiding" again.
--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.


| Hi.
|
| I have 3 related questions (with sub-questions  : )
|
| 1. The following article:
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbco...
| vbtsksettingformtobeinvisibleatitsinception.asp
| says that it is impossible to have an application be invisible (no form
| showing at all) when it is started. I have found out that I CAN do this,
| just setting the 'visible' property to 'false'. Strange. The article seems
| quite recent though. I have VB 6 with SP 5. Is that the reason? Is it safe
| to do it that way or is it advised to have a separate module that is used
as
| startup object?
|
| 2. I want to have a system tray icon for my app. I've found numerous
| examples of course. But, my app needs to startup and hide in the system
tray
| immediately (because it does its work silently, starting automatically
when
| Windows is started). When I try the system tray examples that I've found,
| setting the form to invisible at startup (or at design time) will also
make
| invisible the system tray popup menu. Obviously because it belongs to the
| form. But some example I've tried, hide the form with one of the menu's
| commands, and then the system tray menu is still available. So at some
point
| the form needs to disappear. Ideas, anyone? I wouldn't like my form to
| 'flash' for a split second at startup, of course... I am looking for a
| really neat solution (THE solution).
|
| 3. I keep the form loaded during the time the application is running. This
| means my form is there all the time, active in the background, and ready
to
| be shown (quickly). I guess it needs to be loaded also, for the system
tray
| menu? And, secondly, I wonder, is there any advice against keeping a (just
| one) form loaded when it is not used or should it be unloaded? (separate
| from the fact that it probably needs to be loaded for the system tray
menu).
|
| OK that's it... I hope someone can help.
|
| Best wishes for 2003.
|
| Koen
|
|
|



Mon, 20 Jun 2005 13:23:08 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. Minimize app in system tray

3. Minimize app to System Tray (VB5)

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

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

6. starting app in system tray?

7. Minimize AC00 to system tray

8. minimized in system tray

9. Minimize to system tray [VB6]

10. VB3: Minimize to Win 95 System Tray?

11. Minimize into System Tray

12. Minimize to system tray [VB6]

 

 
Powered by phpBB® Forum Software