Displaying GUI in an automation object created by an ATL service.

Using an ATL NT Service, I need to create automation objects and have them display a GUI. In some cases it is a dialog in others it is SDI. When an ATL NT Service runs NOT as an NT service, but as a normal exe, any automation object which it creates will display itself by calling a 'ShowWindow' method in the object. When an ATL NT Service runs AS an NT service, it can still create automation objects, however the automation objects don’t seem to be able to display themselves. After the NT Service creates the automation object, I attach to it in a Debugging session. I can step over the calls in the 'ShowWindow' method. All return fine but nothing was ever displayed.

Is it possible to do this?
pdelineAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dkremerConnect With a Mentor Commented:
NT Services by nature don't have a user-interface - by their definition they should run without any attention.
Usually when you need to display data of a service you run a different executable which communicates to the service and displays the appropriate data.

0
 
piano_boxerCommented:
You can allow a service it have a GUI by setting the 'Allow service to interact with desktop' flag in the service control manager.
0
 
pdelineAuthor Commented:
dkremer was not helpful.
piano_boxer was.
0
 
piano_boxerCommented:
...and you gave the points to dkremer !!!!! (hmmm)
0
 
dkremerCommented:
Services by definition shouldn't interact with the user - they should run unattended.
It is possible for a service to interact with the desktop but it's a bad design. Usually (*again*) when a service needs to display some output of it's activity it has an 'sibling' application that displays that information.
I really don't care about the stupid points, if anyone else wants them pdeline can give it away, I don't care
0
All Courses

From novice to tech pro — start learning today.