explorer

Programmatically select multiple files in windows explorer

淺唱寂寞╮ 提交于 2019-11-26 08:23:58
问题 I can display and select a single file in windows explorer like this: explorer.exe /select, \"c:\\path\\to\\file.txt\" However, I can\'t work out how to select more than one file. None of the permutations of select I\'ve tried work. Note: I looked at these pages for docs, neither helped. https://support.microsoft.com/kb/314853 http://www.infocellar.com/Win98/explorer-switches.htm 回答1: This should be possible with the shell function SHOpenFolderAndSelectItems EDIT Here is some sample code

Integrating into Windows Explorer context menu

耗尽温柔 提交于 2019-11-26 08:15:49
问题 I want to write a small tool, that does the following: When you right click on a file with a certain file-extension the Windows Explorer context menu shows an additional entry. When you click this entry a certain EXE is launched with this file as one of its parameters. I would like to use C#/.NET 2.0 for this. If it\'s not possible I could also do it with C++/Win32. My questions are: Is it possible with C# .NET 2.0? What are the necessary functions for integrating into the Windows Explorer

How to create an Explorer-like folder browser control?

限于喜欢 提交于 2019-11-26 07:29:40
问题 Using C# and WinForms in VS2008, I want to create a file browser control that looks and acts like the left pane in Windows Explorer. To my astonishment, such a control does not ship with .NET by default. Ideally, I would like its contents to be exactly the same as in Explorer. For example, on Windows 7, it should show the Favorites and Libraries pseudo-folders. Of course, I do not want to code specifically for each version of Windows if I can help it. I have browsed around, and there are some

Opening a folder in explorer and selecting a file

北城以北 提交于 2019-11-26 05:00:57
问题 I\'m trying to open a folder in explorer with a file selected. The following code produces a file not found exception: System.Diagnostics.Process.Start( \"explorer.exe /select,\" + listView1.SelectedItems[0].SubItems[1].Text + \"\\\\\" + listView1.SelectedItems[0].Text); How can I get this command to execute in C#? 回答1: Use this method: Process.Start(String, String) First argument is an application (explorer.exe), second method argument are arguments of the application you run. For example:

Drag and drop to Desktop / Explorer

旧城冷巷雨未停 提交于 2019-11-26 03:41:50
问题 Following my scenario. I got an Application which loads a Filestructure (Folders, Files) from a Database into a WPF ListView. Now I\'d like to grab a file from this ListView, drag it over my Desktop (or some open explorer window) and drop it there. Basic Drag and Drop, nothing fancy. This sounds like a \"standard\" function for a windows application - but google won\'t help. So how can I achieve this? Interops? Thanks Edit : Thanks for the solution, I still had to do some googling. Here\'s my