From 8ab2bad7c19632ac64d401b55bcd9d5b2cdfa60e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 12 Jan 2014 14:13:24 +0000 Subject: [PATCH] Support file associations using "show" verb under MSW too. If we failed to find the "open" command, try the "show" one as some programs (notable Microsoft viewers for Office file formats) only define the latter but not the former. Closes #15821. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/mimetype.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 9bd56ad436..84ff99912a 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -339,6 +339,11 @@ wxFileTypeImpl::GetOpenCommand(wxString *openCmd, { wxString cmd = GetCommand(wxT("open")); + // Some viewers don't define the "open" verb but do define "show" one, try + // to use it as a fallback. + if ( cmd.empty() ) + cmd = GetCommand(wxT("show")); + *openCmd = wxFileType::ExpandCommand(cmd, params); return !openCmd->empty();