Windows资源管理器类似应用程序资源管理器、应用程序、类似、Windows

2023-09-04 23:39:10 作者:失心者 ﹌

我正在寻找一种方法,使这个:

I am searching for a way to make this:

正如你看到的,我的目标是建立一些在资源管理器用户界面。此外,它看起来很喜欢像控制面板的东西。

As you see, my aim is to build something in explorer UI. Also, it looks very like like the Control Panel stuff.

我想获得code例子,如何做到这一点的C#(这是我的主要语言),C ++或其他编程语言。

I would like to get code example how to do this C# (which is my "primary" language), C++ or any other programming language.

感谢你。

PS:这有在Windows XP,Windows Vista和Windows 7的使这之间的差异,请说出来。

P.S: It there are any differences between making this in Windows XP, Windows Vista and Windows Seven, please say them.

编辑:应用程序会以某种方式(这是问题的)Windows资源管理器。 如何申请将被拼命地跑(实际上是看)?用户打开Windows资源管理器中输入我的应用在地址栏里,preSS进入,他会看到类似上面。

The application will be somehow (that's the question) into windows explorer. How application will be runned (actually "viewed")? User will open Windows Explorer, type "My Application" into address bar, press enter and he will see something like above.

感谢你。

编辑:呃......我刚刚在这个网站MSDN中的 http://msdn.microsoft.com/en-us/library/bb757044.aspx 。 我客串,要实现我的想法只有简单的办法就是让控制面板程序。

Eh... I just came in this website in MSDN http://msdn.microsoft.com/en-us/library/bb757044.aspx. I gues that the only simple way to accomplish my idea is to make control panel applet.

也许有人知道,如何描绘控制面板的路径。例如用户进入我的应用,而是被重定向到控制面板\我的应用?

Maybe anybody knows, how to map Control Panel paths. For example user goes to "My Application", but gets redirected to "Control Panel\My Application"?

感谢你。

推荐答案

我不完全知道这里的​​问题是,因为你不提到底什么问题是,你在试图设计接口所遇到你想要的。

I'm not entirely sure what the question here is because you don't mention what exactly the problems are that you've encountered in trying to design the interface that you want.

(编辑:我假设的WinForms这里,是因为原来的问题没有明确规定。如果你使用WPF,你可能会发现,有些事情是更简单,但很多的。同样的链接将仍然适用。)

( I'm assuming WinForms here because the original question doesn't specify. If you're using WPF, you may find that some things are even simpler, but a lot of the same links will still apply.)

老实说,大多数这看起来非常简单,在Visual Studio设计进行复制。该标签 LinkLabels 按钮您指示与是的WinForms应用所有可用的屏幕射出的箭,他们会看起来就像那个。为了确保他们复制的Windows本地外观和感觉正好,设置的 的FlatStyle 以系统在何处的财产暴露任何控制。

Honestly, most of this looks extremely simple to replicate in the Visual Studio Designer. The Labels, LinkLabels, and Buttons that you indicate with arrows in the screen shot are all available in WinForms applications, and they'll look just like that. To ensure that they replicate the Windows native look and feel exactly, set the FlatStyle to "System" on any controls where that property is exposed.

形式的背景是只是普通的老白,而不是3D色彩控制(哦,怎么UI设计进去圆)。您可以通过设置 背景色您的形式为白色属性。

The background of the form is just plain-old white instead of the 3D control color (oh, how UI design goes in circles). You can achieve the same by setting the BackColor property of your form to "White".

这给我们留下了重新实现的资源管理器风格的工具栏,在我看来,可能更接近实际的问题。你注意到的第一件事是工具栏上的Aero的玻璃效果。已经有在这里问怎么走的WinForms应用中的Aero玻璃特效许多问题,只是因为有更多的博客文章,code样本,多贴在互联网上。你只需要从窗口边框的玻璃效果延伸到客户区。当然,这种支持还没有被内置在.NET Framework和你将不得不P /调用的桌面窗口管理器(DWM)API 是present在Windows Vista和后来为了达到这种效果,它可以很快变得复杂。这些链接应该帮助你开始:

That leaves us with re-implementing the Explorer-style toolbar, which it seems to me might better approach your actual question. The first thing you notice is the Aero glass effect in the toolbar. There have been numerous questions asked here about how to get Aero glass effects in WinForms applications, and just as many more blog posts, code samples, and more posted across the Internet. You just need to extend the glass effect from the borders of your window into the client area. Of course, support for this has not been built into the .NET Framework and you're going to have to P/Invoke the Desktop Window Manager (DWM) API that is present in Windows Vista and later in order to achieve this effect, which can get complicated quickly. These links should help get you started:

http://www.the$c$cking.co.uk/2007/02/windows-vista-aero-glass-in-net-managed.html

HTTP://blogs.msdn .COM / B / TIMS /存档/ 2006/04/18 / 578637.aspx

http://www.wpftutorial.net/ExtendGlass.html

HTTP://aeroglassprovider.$c$cplex.com/

一旦你做到了这一点,所有剩下的就是增加了一些控制,以你现在已经呈现如镜的客户区域的顶部区域。上面的屏幕截图有两个前进/后退按钮和两个文本框。这些应该都是比较简单的重建。返回/向前的按钮图标都包含在Windows外壳程序标准的图像库,看看答案this问题,获取有关如何获取他们的一些想法。路径文本框并不像什么特别的东西给我,所以,除非你正在寻找它的自定义行为(面包屑导航等),你可以使用标准的WinForms 文本框控制。对于搜索文本框,一个快速谷歌搜索变成了一个链接的这篇文章人们如何可能在的WinForms重新实现它,这看起来非常有前途。

Once you've done that, all that's left is adding a few controls to the top region of the client area that you've now rendered as glass. The screen shot above has two back/forward buttons and two textboxes. Those should all be relatively simple to recreate. The back/foward button icons are standard images included in the Windows shell libraries—have a look at the answers to this question for some ideas on how to retrieve them. The path textbox doesn't look like anything special to me, so unless you're seeking its custom behavior (breadcrumb navigation, etc.), you can just use the standard WinForms TextBox control. For the search textbox, a quick Google search turned up a link to this article on how one might re-implement it in WinForms, which looks very promising.

我知道这可能看起来很多,但做的最好的事情是刚刚潜入它,使用标准控制,他们会做你想要什么,的创建自定义的控制,从这些标准控件派生的,你找到需要一点点额外的东西。如果/当您遇到的具体问题,随便问一个更具体的问题,我们可以提供更好的洞察力。祝你好运!

I realize this may seem like a lot, but the best thing to do is just dive into it, employing standard controls where they will do what you want and creating custom controls that derive from those standard controls where you find the need for a little something extra. If/when you run into specific problems, feel free to ask a more specific question where we can provide better insight. Good luck!

后记:据我所知,大部分的这种外观和工作在Windows Vista和Windows 7的相同方式的Windows XP不支持桌面窗口管理器,并因此没有Aero用户界面。 Windows资源管理器看起来在Windows XP非常不同。如果你想重新打造的Windows Vista + Windows XP上的样子,你真的有你的工作等着你。你将不得不检测你的用户所运行的操作系统,如果它比Vista低,恢复到自定义绘制全部由您自己的窗口镶边,其中的Aero玻璃将在更高版本的Windows中使用。

Postscript: As far as I know, most of this will look and work the same way on Windows Vista and Windows 7. Windows XP does not support the Desktop Window Manager, and therefore does not have the Aero user interface. Windows Explorer looks very different in Windows XP. If you're trying to re-create the look of Windows Vista+ on Windows XP, you really do have your work cut out for you. You're going to have to detect which operating system your user is running and if it's lower than Vista, revert to custom-drawing all of your own window chrome where Aero glass would be used in later versions of Windows.