Hi,
XY is set as my default file manager. If I now click on "Show in folder" in the Chrome Downloads Tab the system switches correctly to XY and XY shows the download folder. Unfortunately the file downloaded is not set as current selected item, it is always the first element in the tab selected.
Is it possible to automatically go to the downloaded file as Windows Explorer would do?
Thanks
Exo
Chrome - Show in folder
-
- Site Admin
- Posts: 60622
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Chrome - Show in folder
Probably not. I'm not sure which technique Explorer uses to do this.
FAQ | XY News RSS | XY Twitter
Re: Chrome - Show in folder
Chrome seems to somehow call the DCom Server Process Launcher Service (DcomLaunch) hosted in a generic services.exe-process which in turn calls Windows Explorer with a command line like so:admin wrote:Probably not. I'm not sure which technique Explorer uses to do this.
Code: Select all
C:\Windows\explorer.exe /factory,{ceff45ee-c862-41de-aee2-a022c81eda92} -Embedding
-
- Site Admin
- Posts: 60622
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Chrome - Show in folder
nas8e9 wrote:Chrome seems to somehow call the DCom Server Process Launcher Service (DcomLaunch) hosted in a generic services.exe-process which in turn calls Windows Explorer with a command line like so:admin wrote:Probably not. I'm not sure which technique Explorer uses to do this.(No, I don't know what that means and yes, I was bored. )Code: Select all
C:\Windows\explorer.exe /factory,{ceff45ee-c862-41de-aee2-a022c81eda92} -Embedding
@Exolon: Menu Help / Various Information (in XYplorer) gives you the command line this instance of XYplorer was called with. Can you copy/paste this info into this thread please?
FAQ | XY News RSS | XY Twitter
Re: Chrome - Show in folder
Hmm, there is no filename in the string:
Command: "F:\Downloads"
CommandW: "F:\Downloads"
Command Normalized: "F:\Downloads\"
Command: "F:\Downloads"
CommandW: "F:\Downloads"
Command Normalized: "F:\Downloads\"
Re: Chrome - Show in folder
O.k. I (tried) to check the Chrome code to check what happened (and why the Command line omits the filename):
The default case is to open and select the file via the API, if this fails (like in case with XY) it simply shows the folder:
Does this help in any way?
The default case is to open and select the file via the API, if this fails (like in case with XY) it simply shows the folder:
Code: Select all
typedef HRESULT (WINAPI *SHOpenFolderAndSelectItemsFuncPtr)(
PCIDLIST_ABSOLUTE pidl_Folder,
UINT cidl,
PCUITEMID_CHILD_ARRAY pidls,
DWORD flags);
static SHOpenFolderAndSelectItemsFuncPtr open_folder_and_select_itemsPtr =
NULL;
static bool initialize_open_folder_proc = true;
if (initialize_open_folder_proc) {
initialize_open_folder_proc = false;
// The SHOpenFolderAndSelectItems API is exposed by shell32 version 6
// and does not exist in Win2K. We attempt to retrieve this function export
// from shell32 and if it does not exist, we just invoke ShellExecute to
// open the folder thus losing the functionality to select the item in
// the process.
HMODULE shell32_base = GetModuleHandle(L"shell32.dll");
if (!shell32_base) {
NOTREACHED() << " " << __FUNCTION__ << "(): Can't open shell32.dll";
return;
}
open_folder_and_select_itemsPtr =
reinterpret_cast<SHOpenFolderAndSelectItemsFuncPtr>
(GetProcAddress(shell32_base, "SHOpenFolderAndSelectItems"));
}
if (!open_folder_and_select_itemsPtr) {
ShellExecute(NULL, L"open", dir.value().c_str(), NULL, NULL, SW_SHOW);
return;
}
base::win::ScopedComPtr<IShellFolder> desktop;
HRESULT hr = SHGetDesktopFolder(desktop.Receive());
if (FAILED(hr))
return;
[SNIP]
hr = (*open_folder_and_select_itemsPtr)(dir_item, arraysize(highlight),
highlight, NULL);
if (FAILED(hr)) {
// On some systems, the above call mysteriously fails with "file not
// found" even though the file is there. In these cases, ShellExecute()
// seems to work as a fallback (although it won't select the file).
if (hr == ERROR_FILE_NOT_FOUND) {
ShellExecute(NULL, L"open", dir.value().c_str(), NULL, NULL, SW_SHOW);
} else {
LPTSTR message = NULL;
DWORD message_length = FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
0, hr, 0, reinterpret_cast<LPTSTR>(&message), 0, NULL);
LOG(WARNING) << " " << __FUNCTION__
<< "(): Can't open full_path = \""
<< full_path.value() << "\""
<< " hr = " << hr
<< " " << reinterpret_cast<LPTSTR>(&message);
if (message)
LocalFree(message);
}
}
Re: Chrome - Show in folder
... here is the corresponding Log Message:
[4428:4688:6897787:WARNING:platform_util_win.cc(99)] platform_util::ShowItemInFolder(): Can't open full_path = "F:\Downloads\Mercurial-2.0.exe" hr = -2147467260 躈E
[4428:4688:6897787:WARNING:platform_util_win.cc(99)] platform_util::ShowItemInFolder(): Can't open full_path = "F:\Downloads\Mercurial-2.0.exe" hr = -2147467260 躈E
-
- Site Admin
- Posts: 60622
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Chrome - Show in folder
Thanks, but XYplorer only seems to receive "F:\Downloads" from Windows. No chance.
FAQ | XY News RSS | XY Twitter
Re: Chrome - Show in folder
Much water has flown down the Thames since the last post, in this thread,
But do we have some workaround for it, as 'For ONLY UNAIDED-EYES without the blue strip on the file' it seems really hard to correctly pin-point at the required file in a huge collection of downloaded items
But do we have some workaround for it, as 'For ONLY UNAIDED-EYES without the blue strip on the file' it seems really hard to correctly pin-point at the required file in a huge collection of downloaded items
-
- Posts: 49
- Joined: 17 Jul 2022 11:59
Re: Chrome - Show in folder
Hi. I searched for this problem and get me to here.
It is solved? When I select in my chrome: Show folder, XYplorer always opens with first file, not the last one that I downloaded.
It is solved? When I select in my chrome: Show folder, XYplorer always opens with first file, not the last one that I downloaded.