Interact With Desktop Service installation

T

ThunderMusic

Hi,
I created a service application. This service, can possibly start other
applications or display message boxes, so it needs to interact with the
desktop. The question is the following : How can I make the "interact with
the desktop" checkbox checked automaticaly when my service is installed? I
looked at the ServiceInstaller and ServiceProcessInstaller classes, but none
give me this option (or maybe I didn't see it).

Thanks

ThunderMusic_80
 
W

William DePalo [MVP VC++]

ThunderMusic said:
I created a service application. This service, can possibly start other
applications or display message boxes, so it needs to interact with the
desktop. The question is the following : How can I make the "interact with
the desktop" checkbox checked automaticaly when my service is installed? I
looked at the ServiceInstaller and ServiceProcessInstaller classes, but
none
give me this option (or maybe I didn't see it).

If no one suggests a .Net way of doing this you can check the docs for the
native functions OpenSCManager(), ChangeServiceConfig() and
CloseServiceHandle() and use Platform Invoke services to call them from your
managed code.

Regards,
Will

P.S. You do know that running a service like this opens you up to the
Shattered Windows attack, yes?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top