Is it possible to create a tray icon from a service application in Windows Vista or later?

Is it possible to create a tray icon from a Delphi service application under Windows Vista or later?

Answers


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!


Need Your Help

T-SQL View type conversion error; DROP and CREATE view makes issue vanish?

tsql

This error is really strange (SQL Server 2008 R2 (RTM). I am SELECTing from a view in some application code, and very infrequently, I get an error about an invalid data type conversion. The SQL i...

Compiling with cython and mingw produces gcc: error: unrecognized command line option '-mno-cygwin'

python mingw distutils cython

I'm trying to compile a python extension with cython in win 7 64-bit using mingw (64-bit).

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.