Skip to content

Replace our custom OpenWithDlg() with system SHOpenWithDialog() #1269

Description

@zufuliu

Our custom open with dialog (from menu Tools -> Open Document With...):
Image

System open with dialog (same as click "Open with..." context menu in Windows Explorer):
Image

System dialog looks more useful, as it listed registered applications for current file extension.

--- a/src/Notepad4.cpp
+++ b/src/Notepad4.cpp
@@ -2825,7 +2825,10 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) {
                if (bSaveBeforeRunningTools && !FileSave(FileSaveFlag_Ask)) {
                        break;
                }
-               OpenWithDlg(hwnd, szCurFile);
+               if (StrNotEmpty(szCurFile)) {
+                       const OPENASINFO info {szCurFile, nullptr, OAIF_ALLOW_REGISTRATION | OAIF_EXEC};
+                       SHOpenWithDialog(hwnd, &info);
+               }
                break;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions