how to open a service properties dialog

2019-04-08 11:09发布

I would like to add a button to my application ( frontend to a service) that will open the service properties dialog (like in services mmc snapin ) for my service.

There are numerous examples to open file properties, but that is not what i want. i dont know where to start.

2条回答
相关推荐>>
2楼-- · 2019-04-08 11:24

You should develop you custom "Service Console", with .NET and WMI classes you can query the service list in the computer, get the actual status, aditionally you should execute Windows Commands from you application to Start, Stop Services.

查看更多
狗以群分
3楼-- · 2019-04-08 11:26

Based off of the services.msc, the page comes from filemgmt.dll and is called ServicePageGeneral. While the COM components are registered, I cannot find any documentation for the CLSID in question, nor for any of the other strings present in filemgmt.dll.

This does not rule out the possibility that there exists an established API, or a command line option to show the dialog, but I certainly can't find one.

Further substantiating the case that the dialog is not reusable, Process Explorer and SQL Server Configuration Manager both re-implement the dialog, rather than showing the services.msc version.

Related: How do I open properties box for individual services from command line or link?

查看更多
登录 后发表回答