Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / October 2006



Tip: Looking for answers? Try searching our database.

Remain in SysTray at Logoff

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cjsmith411 - 24 Oct 2006 03:30 GMT
I have built a Secure FTP server program. Like other ftp server programs it
needs to remain running in the system tray. I am logging on to the server via
a remote desktop connection and when I run my program it runs as expected in
the system tray. However when I log off to disconnect from Remote Desktop my
program is automatically shut down. I have tried running it as a windows
service program but when I log back in while it remains running it does not
show up in the system tray. Attempting on two different servers on running
Windows Server 2003 and one running 2000.
DanS - 24 Oct 2006 03:44 GMT
> I have built a Secure FTP server program. Like other ftp server
> programs it needs to remain running in the system tray. I am logging
[quoted text clipped - 5 lines]
> tray. Attempting on two different servers on running Windows Server
> 2003 and one running 2000.

It must be run as a service to be available when noone is logged on.

Google for the Windows message WM_TASKBARCREATED and work from there.

The WM_TASKBARCREATED message is sent as a broadcast message to all
windows in the system when the shell is started, by default Explorer.exe.

Each top level window is supposed to respond to this message if it has a
system tray icon to display. When your program receives that message,
simply call the routine to add the icon to the taskbar again.

Have you ever noticed that if Explorer crashes, when it is re-started,
typically like only half of the existing system tray icons are shown ?
That is because many of programs aren't coded to listen for that
broadcast message the way they should.

In my Windows shell replacement app, that is the first thing I do right
after I create the system tray listview, broadcast that message. SysTray
programs then send me the info to add the icons.

Regards,

DanS
cjsmith411 - 24 Oct 2006 13:48 GMT
Thanks Dan
I'll work on adding this.  That explains why it doesn't show back up in the
system tray when I log back in.
- Caleb
cjsmith411 - 26 Oct 2006 21:55 GMT
I was able to use the TASKBARCREATED and it works now!  Still having problems
getting it to work on our Win 2000 server but i think it might be because i
don't have access to the system console when using remote desktop.  I know
that with server 2003 you can get access to the system console though remote
desktop.  Any other ideas on that?  I also can't run alot of command lines on
the Win 2000 server such as sc query to query the system tasks.  I just get a
bad command error.  Guessing that some of these were disabled for security
purposes by our ISP?
Bob Butler - 24 Oct 2006 14:14 GMT
> I have built a Secure FTP server program. Like other ftp server
> programs it needs to remain running in the system tray. I am logging
> on to the server via a remote desktop connection and when I run my
> program it runs as expected in the system tray.

Just to clarify, nothing runs "in" the system tray.  a running application
can display an icon there and respond to mouse events on that icon but it's
not a separate environment.

Signature

Reply to the group so all can participate
VB.Net: "Fool me once..."

cjsmith411 - 26 Oct 2006 21:56 GMT
Got you.
I realize it is just an icon displaying what is currently running.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.