To create an interactive service, do the following when calling the
CreateService function:
- Specify NULL for the lpServiceStartName parameter to run the service in the context of the LocalSystem account.
- Specify the SERVICE_INTERACTIVE_PROCESS flag.
To determine whether a service is running as an interactive service, call the
GetProcessWindowStation function to retrieve a handle to the window station, and the
GetUserObjectInformation function to test whether the window station has the
WSF_VISIBLE attribute.
However, note that the following registry key contains a value,
NoInteractiveServices, that controls the effect of SERVICE_INTERACTIVE_PROCESS: