Is it possible to create a tray icon from a Delphi service application under Windows Vista or later?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No it is not. Services run in session 0. Your interactive processes, your desktop, all run in a different session, one per logged on user.
This isolation is important and is designed to enhance security. Even in Windows XP you were not meant to have direct interaction between services and the desktop. Developers all did it anyway so Microsoft banned it in Vista.
Standard practice is to create the tray icon process by some other means, e.g. HKLM\Software…\Run. That interactive process can then communicate with the service using IPC. For example named pipes.
Now, it is technically possible, in some extremely limited situations for a service to launch a process on the desktop. Read about it here: http://blogs.msdn.com/b/winsdk/archive/2009/07/14/launching-an-interactive-process-from-windows-service-in-windows-vista-and-later.aspx
If you still want to try it, after reading that, then I wish you all the good luck in the world!