views:

45

answers:

5

When running a program, such as notepad, as a service do you not see the program visually? I see notepad running in the task manager but I can't actually see its instance running. Why is this?

+1  A: 

Services are meant as background applications, not foreground applications. Generally they run without direct user input or with user input through IPC (often providing a centralized point for multiple applications to communicate).

It's not common to setup any applications to just run as a service. Applications that run as a service are generally specifically engineered to do so because they perform certain tasks and may want to always be running to perform such tasks.

Quintin Robinson
A: 

An application actually needs to support running as a service - typically it is done by recognizing the "\service" command line key. Some applications will recognize the absence of the "\service" key and either do nothing or show a warning.

When an application is started "as a service" it usually means that it has to work continuously in background and there's a chance that no user is currently logged on. That's why it should not expect any user input and therefore doesn't show the window.

sharptooth
A: 

Adding on @Quintin Robinson's answer, the reason why they doesn't show up on task manager is because they are (usually) run from an umbrella process.

To give you a better picture, download and run Microsoft's Process Explorer, then hold your mouse over one of the "svchost.exe" process running.

You should see some of the services that are running under it.

Carlos Lima
It's obvious to me now that I got the question backwards.
Carlos Lima
A: 

All user interaction in Windows takes place via Windowstations. By default, Windows services "interact" with a non-interactive station. It's not the station you're connected to, so you don't see any output.

You can change this behavior by changing the service properties, and enabling "Allow service to interact with desktop".

You can read more about this here.

Michael Petrotta
A: 

Applications that run as a service (or that are launched by other applications that run as a service) by default run on a separate desktop that cannot interact with the desktop you see.

If you want to be able to interact with a service, you have set the service properties accordingly.

That being said, what you're seeing with Notepad almost certainly has nothing to do with services.

tylerl