X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6bad4c327cb73463176096cdc8f30e50b6af7978..a67e6e5438039aee7f0dd37acaea483037c89a62:/src/msw/mimetype.cpp diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index c5d5039212..6f488946c5 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -6,7 +6,7 @@ // Created: 23.09.98 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license (part of wxExtra library) +// Licence: wxWindows licence (part of wxExtra library) ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -88,7 +88,7 @@ void wxFileTypeImpl::Init(const wxString& strFileType, const wxString& ext) m_strFileType = strFileType; if ( !strFileType ) { - m_strFileType = m_ext.AfterFirst('.') + "_auto_file"; + m_strFileType = m_ext.AfterFirst('.') + _T("_auto_file"); } } @@ -237,6 +237,9 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const wxRegKey(wxRegKey::HKCR, strKey + _T("\\Topic")). QueryValue(_T(""), ddeTopic); + if (ddeTopic.IsEmpty()) + ddeTopic = wxT("System"); + // HACK: we use a special feature of wxExecute which exists // just because we need it here: it will establish DDE // conversation with the program it just launched @@ -333,7 +336,8 @@ bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const bool wxFileTypeImpl::GetIcon(wxIcon *icon, wxString *iconFile, - int *iconIndex) const + int *iconIndex, + int iconSize) const { #if wxUSE_GUI wxString strIconKey; @@ -364,7 +368,12 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon, // here we need C based counting! int nIndex = wxAtoi(strIndex); - HICON hIcon = ExtractIcon(GetModuleHandle(NULL), strExpPath, nIndex); + HICON hIcon, hIconLarge, hIconSmall; + ExtractIconEx(strExpPath, nIndex, &hIconLarge, &hIconSmall, 1); + + hIcon = (iconSize == wxICON_LARGE) ? hIconLarge : hIconSmall; + + switch ( (int)hIcon ) { case 0: // means no icons were found case 1: // means no such file or it wasn't a DLL/EXE/OCX/ICO/...