setting "Allow service to interact with the desktop" property through coding in windows service [modified]
-
i have a windows service in vb.net. i want to set the property "Allow service to interact with the desktop" through code, instead of doing it manually everytime the service is installed. how can i do that? i have done enough searching on google but haven't found anything relative. -- modified at 2:12 Monday 17th July, 2006
-
i have a windows service in vb.net. i want to set the property "Allow service to interact with the desktop" through code, instead of doing it manually everytime the service is installed. how can i do that? i have done enough searching on google but haven't found anything relative. -- modified at 2:12 Monday 17th July, 2006
You can use WMI and the System.Management namespace to change this. The .NET ServiceInstaller class doesn't support changing this, yet at least. Handle your ServiceInstaller class'
Committed
event where you can use WMI'sWin32_BaseService
class to change the DesktopInteract property of the service after it's installed. Dave Kreskowiak Microsoft MVP - Visual Basic