You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SHAssocEnumHandlers1 can be used to directly invoke a handler, and doesn't rely on registry hacks to find OpenWithList and shell/open/command to be defined.
This would make all implementations for finding applications currently in place in Cyberduck Windows obsolete, as I'd like to just create one implementation which is capable of opening a file with any application, through Windows Shell.
Discussion here:
This will result in preferences having to remove the Default-editor setting, as everything will be handled by underlying User preference in Windows.
New behavior for editing files:
If none is returned in SHAssocEnumHandlers use SHOpenWithDialog1.
If any is returned, use isRecommended property to determine first and Edit toolbar option default application
Append last item "Open With …" which uses SHOpenWithDialog.
Unsure how to fit this into EditorFactory and ApplicationFinder though.
Need to extend Application class to allow for passing IAssocHandler down the line and invoked with a file path.
Cannot use ApplicationLauncher or ApplicationFinder as provided by AbstractEditor as that relies on Process.Start, which is unavailable here.
CLI behavior changes to following: --edit downloads file and opens default/recommended handler. If non available use SHOpenWithDialog
Adding --edit=with or --edit-with always uses SHOpenWithDialog. Opinions here?
Behavior will need to address for situations where there is no editor defined for a file type, i.e.:
For .mp4 there is no editor defined on my system, but an application which is set as default viewer.
Do we want to allow fast editing (Ctrl+K) for files with no registered application capable of editing a file type?
SHAssocEnumHandlers will return any application with registered open verb of file type, not necessarily only handlers which are edit capable. There is no way of determining whether IAssocHandler can edit a particular file.
We can ShellExecuteEx any arbitrary ProgId with specified verbs. This will need PInvoke, as ProcessStartInfo/Process.Start cannot use lpClass-field for starting a ProgId.
Need to differentiate in ApplicationLauncher between ProgIdApplication and ShellApplication, which use different ways of invoking (IAssocHandler.Invoke/ShellExecuteEx).
Activity
dkocher commentedon Jan 20, 2022
Might also help to resolve #11770.
AliveDevil commentedon Jan 20, 2022
This would make all implementations for finding applications currently in place in Cyberduck Windows obsolete, as I'd like to just create one implementation which is capable of opening a file with any application, through Windows Shell.
AliveDevil commentedon Mar 29, 2022
Discussion here:
This will result in preferences having to remove the Default-editor setting, as everything will be handled by underlying User preference in Windows.
New behavior for editing files:
isRecommendedproperty to determine first and Edit toolbar option default applicationUnsure how to fit this into EditorFactory and ApplicationFinder though.
Need to extend Application class to allow for passing IAssocHandler down the line and invoked with a file path.
Cannot use ApplicationLauncher or ApplicationFinder as provided by AbstractEditor as that relies on Process.Start, which is unavailable here.
Footnotes
https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shopenwithdialog ↩
https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ienumassochandlers ↩
AliveDevil commentedon Mar 29, 2022
CLI behavior changes to following:
--editdownloads file and opens default/recommended handler. If non available use SHOpenWithDialogAdding
--edit=withor--edit-withalways uses SHOpenWithDialog. Opinions here?AliveDevil commentedon Mar 29, 2022
Currently blocked by microsoft/win32metadata#918.
AliveDevil commentedon Mar 30, 2022
Behavior will need to address for situations where there is no editor defined for a file type, i.e.:
For .mp4 there is no editor defined on my system, but an application which is set as default viewer.
Do we want to allow fast editing (Ctrl+K) for files with no registered application capable of editing a file type?
SHAssocEnumHandlerswill return any application with registered open verb of file type, not necessarily only handlers which are edit capable. There is no way of determining whetherIAssocHandlercan edit a particular file.AliveDevil commentedon Mar 30, 2022
cyberduck/core/src/main/csharp/ch/cyberduck/core/local/ShellApplicationFinder.cs
Line 69 in 4128201
We can
ShellExecuteExany arbitrary ProgId with specified verbs. This will need PInvoke, as ProcessStartInfo/Process.Start cannot uselpClass-field for starting a ProgId.Need to differentiate in ApplicationLauncher between ProgIdApplication and ShellApplication, which use different ways of invoking (
IAssocHandler.Invoke/ShellExecuteEx).AliveDevil commentedon Mar 31, 2022
It's something.
2022-03-31.12-47-06.mp4
Merge branch 'feature/GH-12802' into build-modern
Merge pull request #13030 from iterate-ch/feature/GH-12802