调用文件属性对话框和服务属性对话框 [英] Invoke File Property Dialog and Service Property Dialog
问题描述
有没有办法以编程方式调用和托管文件和/或服务的默认属性对话框?到目前为止,我还没有发现任何相关的东西,但是我很确定一定有办法.至少使用一些Win32 API调用.
当答案开始出现时,我发现显示默认文件属性对话框是可行且非常容易的,但是,另一方面,我没有正确解释服务属性对话框部分.
我希望能够以编程方式打开的是当您双击服务或在服务管理控制台中访问服务属性时获得的默认对话框(aka services.msc).
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) .
推荐答案
一种显示文件/文件夹属性的简单方法是通过ShellExecute
.参见:
新手生成程序的基本指南 [
One easy way to show file/folder properties is viaShellExecute
. 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.
除了Nish的回答 ^ ]是使用ShellExecute
显示文件属性对话框的C#
示例. :)
In addition to Nish''s answer here[^] is aC#
example of usingShellExecute
to display a file property dialog. :)
以下是示例对话框,其中包括属性对话框:
C#可以Shell,第2部分 [
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 :)
Regards
Espen Harlinn
这篇关于调用文件属性对话框和服务属性对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!