Doo Dah
Doo Dah

Reputation: 4029

Show status window from Windows Service

I have a Windows service written in .NET with C#. I know from here: Launching GUI App from Windows Service - Window Does Not Appear. that I can allow the service to interact with the desktop. From Windows 7, however, I just get a dialog telling me "A program running on this computer is trying to display a message". The service is an update service (think Windows update) I wanted to pop up a dialog telling the user that an update is taking place and informing them of the progress.

1) Can I display a window from a service in Windows 7?

2) Can I detect from within the service whether it can interact with the desktop?

Thanks, Scott

Upvotes: 0

Views: 2056

Answers (2)

David Heffernan
David Heffernan

Reputation: 612794

You can't display UI from a service.

The normal approach to this problem is to run a standard app in the user's desktop and have the service communicate with that app using your preferred form of IPC.

Upvotes: 2

Ron Skufca
Ron Skufca

Reputation: 2068

Check out .NET Remoting.

Upvotes: 0

Related Questions