X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05d3cd45e5991ee8275ca870d17b28b17ca34c87..4760fa91097407e9967efd21f90ef04d69e5bb9c:/src/msw/mimetype.cpp diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 6ce8557e4e..6f488946c5 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -336,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; @@ -367,7 +368,11 @@ 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