Click here to Skip to main content
15,745,433 members
Please Sign up or sign in to vote.
5.00/5 (4 votes)
See more:
Is there any way to programmatically call and host the default property dialog for a file and/or for a service ? So far I haven't found anything related but I'm pretty sure that there has to be a way; at least using some Win32 API calls.

As answers start to appear i found that display the default file property dialog is doable and pretty easy, but, on the other hand i did not explain the service property dialog part properly.

What i want to be able to programmatically open is the default dialog you get when you double click a service or when you go to properties of a service in the services management console (aka services.msc) .
Updated 18-Jan-11 5:37am
Espen Harlinn 18-Jan-11 11:10am    
Good question
Nish Nishant 18-Jan-11 11:16am    
Agree, got my 5 too.
Nuri Ismail 18-Jan-11 11:27am    
Yes, your question is interesting but you should elaborate a little about this service property dialog. Is this the dialog displayed from context menu of each item (service) in "services.msc" management console?

One easy way to show file/folder properties is via ShellExecute. See:

A newbie's elementary guide to spawning processes[^]

Scroll down a bit to see how this is done.

Not sure what you mean by property dialog for a service though.
Share this answer
Nuri Ismail 18-Jan-11 11:22am    
Good link to your useful article Nish! +5
Nish Nishant 18-Jan-11 11:25am    
Thanks :-)
creizlein 18-Jan-11 11:35am    
By Service Property dialog i mean the default dialog you get when you double click a service from the services.msc console, where you can view/change the properties of the service.
Nish Nishant 18-Jan-11 11:39am    
I believe that's a child dialog of the services control panel applet. Not sure if it's exposed via a command line call to the applet. But probably worth researching.
In addition to Nish's answer here[^] is a C# example of using ShellExecute to display a file property dialog. :)
Share this answer
Nish Nishant 18-Jan-11 11:25am    
Voted 5, for the P/Invoke stuff. Forgot that the OP wanted a C# solution.
Nuri Ismail 18-Jan-11 11:27am    
Thank you very much. :)
Here is an example opening, among other things, the properties dialog:
C# does Shell, Part 2[^] using ShellExecute. Actually part of a very nice series by Arik Poznanski

Doing this for a service though ... that's the interesting part of this question :)

Espen Harlinn
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900