Click here to Skip to main content
12,953,175 members (46,773 online)
Rate this:
Please Sign up or sign in to vote.
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) .
Posted 18-Jan-11 5:07am
Updated 18-Jan-11 5:37am
Espen Harlinn 18-Jan-11 11:10am
Good question
Nishant Sivakumar 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?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Nuri Ismail 18-Jan-11 11:22am
Good link to your useful article Nish! +5
Nishant Sivakumar 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.
Nishant Sivakumar 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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

In addition to Nish's answer here[^] is a C# example of using ShellExecute to display a file property dialog. :)
Nishant Sivakumar 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. :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

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

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,429
CHill60 3,490
Maciej Los 3,103
Jochen Arndt 1,975
ppolymorphe 1,920

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 18 Jan 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100