From 5ac0638d9504153d6996b0bb588b67d8c293d258 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 12 Jan 2014 14:13:11 +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/branches/WX_3_0_BRANCH@75605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/msw/mimetype.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 2e93e4320a..64fe383693 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -605,6 +605,7 @@ wxMSW: - Fix wxRegion::Offset() with shared objects (Joost Nieuwenhuijse). - Fix wxSocket::Initialize() after Shutdown() (Laurent Poujoulat). - Fix coordinates of EVT_MOUSEWHEEL in frames with toolbars (LtJax). +- Support "show" verb as well as "open" in wxFileType (Eric Jensen). wxOSX: 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();