Page 1 of 1

Program opens path in XYplorer and then in File Explorer

Posted: 21 Dec 2021 23:13
by undefiler
A program called HTTP Downloader has an option to Open Directory which should just open fine in XYplorer, which it does. The problem is, after 15-20 seconds, the same path also opened in File Explorer. I haven't noticed any other program producing a duplicate window in File Explorer after opening in XYplorer so I thought it may be HTTP Downloader's fault. The dev disagreed, here's a quote:
I wouldn't know why it's opening Explorer's window as well. The code to open a folder and highlight a file is pretty standard so if there's anything going on, then it's with XYplorer. HTTP Downloader will use SHOpenFolderAndSelectItems first and if that fails, then it'll fall back to ShellExecute (which opens the folder, but doesn't highlight the file). The code block that that code is in doesn't stall, so there should not be a 15-20 second delay. I would suspect that XYplorer's interception of one of those API calls is causing the issue.
It looks like HTTP Downloader is falling back to ShellExecute because the duplicate File Explorer window which opens doesn't highlight the file.

The only relevant configuration option I can think of is that I have "Open command line start path in new tab" enabled (I think this is disabled by default, and as a side note, I think should be the inverse -- was really quite annoying at the start until I found this option :) and something I think File Explorer users, i.e. potential new users, would not expect).

Maybe this is something you could look into?

Thanks!

XYplorer 22.60.0100
Windows 11 Pro (21H2 build 22000.376)

Re: Program opens path in XYplorer and then in File Explorer

Posted: 22 Dec 2021 09:20
by highend
I can confirm that...

When the folder for a download is opened via the context menu of HTTP Downloader, it will open it in XYplorer (when registered as the default file manager for the current user) and {x} seconds later, via Windows Explorer again.

When undoing the registration and registering e.g. Total Commander, the Windows Explorer instance won't get opened...

Code: Select all

Windows Registry Editor Version 5.00

 [HKEY_CLASSES_ROOT\Drive\shell]
 @="open"

 [HKEY_CLASSES_ROOT\Drive\shell\open]

 [HKEY_CLASSES_ROOT\Drive\shell\open\command]
 @="C:\\Program Files\\totalcmd\\TOTALCMD.EXE /O \"%1\""

 [HKEY_CLASSES_ROOT\Directory\shell]
 @="open"

 [HKEY_CLASSES_ROOT\Directory\shell\open]

 [HKEY_CLASSES_ROOT\Directory\shell\open\command]
 @="C:\\Program Files\\totalcmd\\TOTALCMD.EXE /O \"%1\""

Re: Program opens path in XYplorer and then in File Explorer

Posted: 22 Dec 2021 09:48
by admin
You might get better results using this tweak *before* making XY the default file manager:

Code: Select all

ShellIncludeSpecialFolders=1
The result of this tweak is a different kind of registration: in key "Folder" instead of keys "Drive" and "Directory".

Re: Program opens path in XYplorer and then in File Explorer

Posted: 22 Dec 2021 10:14
by highend
This doesn't change anything.

A virgin Windows 10 VM with no file manager on it before doing the test.

After registering XY:
1.png

Re: Program opens path in XYplorer and then in File Explorer

Posted: 22 Dec 2021 10:26
by admin
Too bad. Thanks for testing.

To open XYplorer and go to a file you simply pass the full path to that file in the command line, e.g. (quotes added because of the spaces in the path):
"C:\Program Files (x86)\XYplorer\XYplorer.exe" "C:\Program Files (x86)\XYplorer\Startup.ini"

Whatever SHOpenFolderAndSelectItems does, it seems to go a very different way, and I cannot find any documentation about it. I assume it's not even code that's needed but some kind of app registration or manifest.

Re: Program opens path in XYplorer and then in File Explorer

Posted: 22 Dec 2021 10:58
by highend

Re: Program opens path in XYplorer and then in File Explorer

Posted: 22 Dec 2021 11:03
by admin
Yep, seen that (RegisterPending). Technically not possible ATM. :|

Re: Program opens path in XYplorer and then in File Explorer

Posted: 22 Dec 2021 12:38
by Horst
I have since years the assigments for Total Commander as Highend posted.
There are no strange effects and TC doesn't do anything special to handle it.
It just works