Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET dialog WinForm
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 6:07am
Edited 18-Jan-11 6:37am
v3
Comments
Espen Harlinn at 18-Jan-11 11:10am
   
Good question
Nishant Sivakumar at 18-Jan-11 11:16am
   
Agree, got my 5 too.
Nuri Ismail at 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
good
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.
  Permalink  
Comments
Nuri Ismail at 18-Jan-11 11:22am
   
Good link to your useful article Nish! +5
Nishant Sivakumar at 18-Jan-11 11:25am
   
Thanks :-)
creizlein at 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 at 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
good
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. Smile | :)
  Permalink  
v2
Comments
Nishant Sivakumar at 18-Jan-11 11:25am
   
Voted 5, for the P/Invoke stuff. Forgot that the OP wanted a C# solution.
Nuri Ismail at 18-Jan-11 11:27am
   
Thank you very much. :)
Rate this: bad
good
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 Smile | :)
 
Regards
Espen Harlinn
  Permalink  
v3

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

  Print Answers RSS
0 OriginalGriff 195
1 Afzaal Ahmad Zeeshan 132
2 ProgramFOX 130
3 Maciej Los 105
4 Sergey Alexandrovich Kryukov 75
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,657
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 18 Jan 2011
Copyright © CodeProject, 1999-2014
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