<p>In prior versions of Windows before Vista you could have a Windows Service interact with the current logged in desktop user to easy display information on the screen from the service. In Windows Vista Session 0 was added for security to isolate the services from the desktop. What is an easy way to communicate between a service and an application running outside of Session 0? So far I have gotten around this by using TCP/IP to communicate between the two but it seems to be kind of a sloppy way to do it.</p>

[{'answer_id': 55664, 'author': 'Rob Walker', 'author_id': 3631, 'author_profile': 'https://Stackoverflow.com/users/3631', 'pm_score': 3, 'selected': True, 'text': '<p>You can use shared memory or named pipe to facilitate IPC as well. Conceptually this is similar to TCP/IP, but you don\'t have to worry about finding an unused port.</p>\n\n<p>You have to make sure that the named objects you create are prefixed with "Global\\" to allow them to be accessed by all sessions as described <a href="http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx" rel="nofollow noreferrer">here</a>.</p>\n\n<p>AFAIK there is no way for a service to directly interact with the desktop any more.</p>\n'}, {'answer_id': 55667, 'author': 'jsight', 'author_id': 1432, 'author_profile': 'https://Stackoverflow.com/users/1432', 'pm_score': 2, 'selected': False, 'text': '<p>Indeed, for security reasons it is no longer possible to communicate directly with the "desktop".  What exactly is the "desktop" anyway, when you live in a machine with multiple active users + remote sessions?</p>\n\n<p>The general way to solve the problem is to use service apps which communicate via some RPC mechanism (TCP/IP, IPC, .Net Remoting Channels over one of those, etc).  Its kind of a pain, but I think the benefits are worth the change.</p>\n'}, {'answer_id': 55698, 'author': 'Bob Nadler', 'author_id': 2514, 'author_profile': 'https://Stackoverflow.com/users/2514', 'pm_score': 1, 'selected': False, 'text': '<p>For the service to talk to the desktop, you\'re pretty much stuck with one of the RPC mechanisms. The .NET remoting mechanism (<a href="http://msdn.microsoft.com/en-us/library/system.runtime.remoting.channels.ipc.ipcserverchannel.aspx" rel="nofollow noreferrer">IpcServerChannel</a>) isn\'t to hard to implement for this purpose. </p>\n\n<p>Also with .NET a desktop application can send messages directly to the service with the <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.executecommand.aspx" rel="nofollow noreferrer">ServiceController.ExecuteCommand</a>. These commands are received by the service via <a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase.oncustomcommand.aspx" rel="nofollow noreferrer">ServiceBase.OnCustomCommand</a>. This is even easier to do, and would be all you need if controlling the service is your only requirement.</p>\n'}]
['https://Stackoverflow.com/questions/55639', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1096640/']