Windows Service Application + Launch in the system tray

I have a Delphi application running on a server. This application does some critical work with my database, which is used in other applications and is executed when the user logs into Windows. Everything works fine, but it turns out that the server administrator sometimes reboots the server and does not enter Windows. The server remains in Windows Login and my application does not start.

After a little research, I decided to create a Windows service to run my application before the user logs into Windows. But I have two forms. One form shows the current process that my application is running, and the other shows the .ini file, which is used to configure the first form.

What I need to do is create a service that launches my application before the user logs into Windows and after logging in, shows my forms or opens it, but minimize it to the system tray.

Can I use the Windows Service with this behavior and minimize my forms in the system tray?

+4
source share
2 answers

The service cannot display the user interface at all (including the System Tray icon) in Vista and is not recommended in earlier versions. In all versions of Windows, you must separate the user interface from your own non-service application, which can be run by a registered user, manage the system tray icon for this user tray and, if necessary, communicate with the backend service using any number of available IPC mechanisms ( pipes, sockets, COM, RPC, WCF, etc.).

+14
source

Well, you may have a form in the service, but it should run as an administrator and should be configured as an online service.

I used SVCOM to create good services with tray icons and a form that can minimize the system tray.

Look here: http://www.aldyn.ru/products/index.html

Hope this helps

+1
source

All Articles