In FireDaemon Pro, services are designed to run silently under the control of the Service Control Manager (SCM).


One main point to remember is that a service will only interact with the desktop when it is either runs as the LocalSystem account, or runs under an account that has sufficient security privileges, e.g. an account that is a member of the Windows Administrative group.


When you log off, Windows sends a variety of broadcast messages to every application running on the system. Some of these are WM_QUERYENDSESSION and WM_ENDSESSION for GUI based applications (see the WindowProc method in the Win32 API) and CTRL_LOGOFF_EVENT for console based applications (see the SetConsoleCtrlHandler method in the Win32 API). These messages advise each application that the user is about to logoff or shut the machine down and give the application a chance to respond to it.


If the application that you are running as a service does not handle these correctly (i.e. process it and consent to termination) then it will be terminated by the logoff process, and FireDaemon will restart it for you in the background.


So, what can you do about this? Not a great deal unless you contact the authors of the program you are attempting to run and ask them to allow their application to be modified so that it handles these events appropriately when run as a service. The Bulletproof FTP (BFTP) Server does this. It provides a service parameter. When this parameter is supplied BFTP dutifully ignores the logoff events. When you log back on again the BFTP is still running and rebinds to the System Tray.


The System Tray is another sticking point. When an application runs in the System Tray, it initially binds to the system tray (so it can display the icon, menus etc.). If the System Tray is not present (i.e. at system boot) this binding process might fail. Unless the application you are running is intelligent enough to poll for the existence of the System Tray and rebind then you are most likely to never see it.