windows-explorer

How to tell if there's no default file extension association on OS post-Windows XP?

孤街浪徒 提交于 2019-12-05 19:14:18
Going back to the days of Windows XP one could use the following code to tell if there's no file association existed for an extension: TCHAR buffPath[MAX_PATH] = {0}; DWORD dwszBuffPath = MAX_PATH; HRESULT hR = ::AssocQueryString( ASSOCF_NOFIXUPS | ASSOCF_VERIFY, ASSOCSTR_EXECUTABLE, _T(".weirdassextension"), NULL, buffPath, &dwszBuffPath); if(hR != S_OK && hR != E_POINTER) { //Association does not exist } But since Windows 8, the AssocQueryString API returns S_OK and buffPath is set to something like C:\WINDOWS\system32\OpenWith.exe if it doesn't find anything. Is there a better way now to

Windows Explorer Shell Extension: create file and enter “rename” mode

帅比萌擦擦* 提交于 2019-12-05 18:34:22
For a shell extension (UI is similar to "New/" context menu), I need to create a file, select it and enter "rename" mode, so the user can adjust the default name. Q: How do I enter "rename" mode for a file? The correct way to do this is to use IShellView::SelectItem with the SVSI_EDIT flag. Have you tried sending "F2" to the window? 来源: https://stackoverflow.com/questions/6258846/windows-explorer-shell-extension-create-file-and-enter-rename-mode

Pass multiple files / folders from windows explorer to external application

流过昼夜 提交于 2019-12-05 13:33:32
Hi does anyone know how to get windows explorer to pass multiple files / folders through to an external app (c#) referenced in the registry? I am current able to act upon a single file / folder using the %1 syntax but not sure how to get explorer to pass through multiple items. Does anyone know how to do this? When you select multiple files in Explorer, your shell context menu extension's IShellExtInit::Initialize method will be called and pdtobj contains the selection. Note writing managed shell extension is not supported. I don't think this is possible. When you open multiple files using

Manipulating the Windows 7 Explorer navigation pane

删除回忆录丶 提交于 2019-12-05 11:11:05
Based on the answers I received at superuser , it's clear that I'll have to add the following to a custom Explorer Window launcher. I want to launch a rooted explorer view, and for just that window make the navigation pane look like the old Windows XP folders pane. I already wrote a program to place shortcuts to these folder views on the Start Menu, so changing the shortcuts to run through a launcher is trivial. Here's the XP folders pane: Here's the Windows 7 Navigation Pane: (source: 280z28.org ) tyranid Okay well I haven't got the time to completely finish this code (and it is in C# which I

How to get HWND of the currently active Windows Explorer window?

烈酒焚心 提交于 2019-12-04 19:35:07
I know how to get the HWND of the desktop: GetDesktopWindow() . But I haven't been able to find a function that returns the HWND of the currently active Windows Explorer main window. How do I get the HWND of the currently active Windows Explorer window in a safe and reliable manner? You can get the currently active window via GetForegroundWindow() . You could then do GetWindowThreadProcessId() to get a PID which you can then convert to a process handle with OpenProcess() (you will want PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights) and then you can check the process name with

How to rename a folder in c# which is currently opened by windows explorer

我与影子孤独终老i 提交于 2019-12-04 19:21:15
问题 When renaming a folder in C#, System.IO.Directory.Move throws System.IO.IOException (message "access denied") if that folder or any subfolder is currently opened by a (Windows 7) explorer window. Using the commandline RENAME fails, too. Using a second explorer windows succeeds. The error persists even after collapsing the parent folder (or its parents). In fact the particular explorer window needs to be closed. So the explorer seems to create some locks just to show the folder structure and

Can I modify the Windows 7 preview pane so HTML files display just the text in the preview instead of rendering the html?

元气小坏坏 提交于 2019-12-04 11:56:10
问题 When I click on html files in explorer the preview pane currently tries to render the html for the preview. I'd like the behavior to just show me the text without interpreting the tags. Is there a way to do this by messing with the registry or changing a setting somewhere? 回答1: Update: Just use the PreviewConfig utility (zip file download), which makes the required changes to the registry for you. Here is a detailed explanation of how the registry changes work. To view HTML files as text in

Selecting file in Windows Explorers does not always work

那年仲夏 提交于 2019-12-04 11:55:40
问题 Using the following explorer.exe /select, "c:\path\to\file.txt" I can open Windows Explorer and select the file. In Delphi I do this to select "Parm" file: ShellExecute(Application.MainForm.Handle, 'OPEN', PChar('explorer.exe'), PChar('/select,"' + Parm + '"'), nil, SW_NORMAL); And it works. My problem is this: if I select a different file in the recently opened Explorer (clicking in a different file) and then call the above code the "Parm" file is not selected again. Interestingly, there are

Opening a file system folder/directory from web browser

淺唱寂寞╮ 提交于 2019-12-04 09:10:44
I distribute my desktop application on flash drives to thousands of users on Windows, Mac, and Linux. I have a HTML starter page that has links to the documentation, install guide, release notes, etc. which are all on the flash drive. I would love for the user to just install directly from the browser, but that's exactly what anti-virus programs are trying to prevent (and rightly so). Instead of trying to launch the installer, it's enough to locate the installer and let the user take the last step by themselves. Is it possible to cause the file system manager (Explorer, Finder, etc.) on the

How to rename a folder in c# which is currently opened by windows explorer

≡放荡痞女 提交于 2019-12-03 12:29:59
When renaming a folder in C#, System.IO.Directory.Move throws System.IO.IOException (message "access denied") if that folder or any subfolder is currently opened by a (Windows 7) explorer window. Using the commandline RENAME fails, too. Using a second explorer windows succeeds. The error persists even after collapsing the parent folder (or its parents). In fact the particular explorer window needs to be closed. So the explorer seems to create some locks just to show the folder structure and does not release them even if the actual folder isnt displayed anymore (which is pure nonsens IMO). Is