windows-explorer

How can I open Windows Explorer to a certain directory from within a WPF app?

断了今生、忘了曾经 提交于 2019-11-27 17:24:57
In a WPF application, when a user clicks on a button I want to open the Windows explorer to a certain directory, how do I do that? I would expect something like this: Windows.OpenExplorer("c:\test"); Why not Process.Start(@"c:\test"); ? This should work: Process.Start(@"<directory goes here>") Or if you'd like a method to run programs/open files and/or folders: private void StartProcess(string path) { ProcessStartInfo StartInformation = new ProcessStartInfo(); StartInformation.FileName = path; Process process = Process.Start(StartInformation); process.EnableRaisingEvents = true; } And then

ShellIconOverlayIdentifiers - why so few?

江枫思渺然 提交于 2019-11-27 17:14:12
At this point, everyone knows that there's a limit to the number of ShellIconOverlayIdentifiers (from MSDN): The number of different icon overlay handlers that the system can support is limited by the amount of space available for icon overlays in the system image list. There are currently fifteen slots allotted for icon overlays, some of which are reserved by the system. For this reason, icon overlay handlers should be implemented only if there are no satisfactory alternatives I can understand the 15 overlay limt in Windows 95. But in an environment where there's Gigs of RAM, numerous Cores,

How to programmatically restart windows explorer process

谁说胖子不能爱 提交于 2019-11-27 15:13:19
I'm working on a windows shell extension, and unfortunately, when making changes to the DLL, I must restart windows explorer (since it keeps the DLL in memory). I found this program from Dino Esposito, but it doesn't work for me. void SHShellRestart(void) { HWND hwnd; hwnd = FindWindow("Progman", NULL ); PostMessage(hwnd, WM_QUIT, 0, 0 ); ShellExecute(NULL, NULL, "explorer.exe", NULL, NULL, SW_SHOW ); return; } Does any one have something they can share to do this? P.S. I realize that I can go to task manager and kill the explorer process, but I just want to do it the lazy way. Besides, this

Can you send a signal to Windows Explorer to make it refresh the systray icons?

我怕爱的太早我们不能终老 提交于 2019-11-27 12:30:42
This problem has been afflicting me for quite a while and it's been really annoying. Every time I login after a reboot/power cycle the explorer takes some time to show up. I've taken the step of waiting for all the services to boot up and then I login, but it doesn't make any difference. The result is always the same: Some of the icons do not show up even if the applications have started. I've dug a bit on the code that makes one application "stick" an icon in there, but is there an API call that one can perform so explorer re-reads all that icon info? Like invalidate or redraw or something of

How can I programmatically refresh Windows Explorer?

霸气de小男生 提交于 2019-11-27 11:42:44
I have a Windows shell extension that uses IShellIconOverlayIdentifier interface to display overlay icons on files and folders. My extension is a little like TortoiseCVS or TortoiseSVN . Sometimes I need to make Windows Explorer redraw all it's icons. To do this, I call SHChangeNotify like this: SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL) This refreshes the desktop and right hand pane of any open explorer windows. It doesn't refresh the folder tree on the left hand side of any Explorer windows. So I tried sending WM_SETTINGCHANGE like this: SendMessage(HWND_BROADCAST, WM

C#: How to open Windows Explorer windows with a number of files selected

人走茶凉 提交于 2019-11-27 11:15:32
In the Library of Windows Media Player you can select one or more music files. You can then right-click and in their context menu choose Open File Location . This will open up one windows explorer window for each directory that the files are in, and the files will be selected for you. So let's say we have a bunch of mp3 files in our library where three of them are these: Z:\Music\Thursday Blues\01. I wish it was friday.mp3 Z:\Music\Counting Sheep\01. Sheep #1.mp3 Z:\Music\Counting Sheep\02. Sheep #2.mp3 If we select those three (in a view where all of them are visible) and do Open File

How to add a “open git-bash here…” context menu to the windows explorer?

∥☆過路亽.° 提交于 2019-11-27 06:15:27
How to add a context (aka right click) menu to the windows explorer that, when clicked, opens the git-bash console in the current explorer folder? I had a similar issue and I did this. Step 1 : Type "regedit" in start menu Step 2 : Run the registry editor Step 3 : Navigate to HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell Step 4 : Right-click on "shell" and choose New > Key. name the Key "Bash" Step 5 : Modify the value and set it to "open in Bash" This is the text that appears in the right click. Step 6 : Create a new key under Bash and name it "command". Set the value of this

Drag and drop onto Python script in Windows Explorer

我的梦境 提交于 2019-11-27 06:11:26
I would like to drag and drop my data file onto a Python script and have it process the file and generate output. The Python script accepts the name of the data file as a command-line parameter, but Windows Explorer doesn't allow the script to be a drop target. Is there some kind of configuration that needs to be done somewhere for this work? Sure. From a mindless technology article called "Make Python Scripts Droppable in Windows" , you can add a drop handler by adding a registry key: Here’s a registry import file that you can use to do this. Copy the following into a .reg file and run it

Refresh Windows Explorer in Win7

♀尐吖头ヾ 提交于 2019-11-27 05:45:42
问题 My program sets "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" value "Hidden" . Hovewer I'm not able to refresh the explorer to take into account this change. I've tried: 1) SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);` 2) SHELLSTATE state = new SHELLSTATE(); state.fShowAllObjects = (uint)1; SHGetSetSettings(ref state, SSF.SSF_SHOWALLOBJECTS, true); 3) SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS, 0, SMTO

How can I add a context menu to the Windows Explorer for a Java application?

假装没事ソ 提交于 2019-11-27 01:04:06
How would one go about adding a submenu item to the windows explorer context menu (like for example 7-Zip does) for a Java application? I am aware of two ways to do it. The fancy way is to write a windows shell extension, which is how powerarchiver, winzip etc do it I believe (this involves running code to determine what the context menu items will be dependent on the file chosen). The simple way, for simple functionality, is you can add an entry in the registry : HKEY_CLASSES_ROOT\<file type>\shell\<display text>\command Where <file type> is the files that this context menu should apply to i