]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/mimetype.cpp
support undo patch applied
[wxWidgets.git] / src / msw / mimetype.cpp
index a453c99079fd80138c9054de71807a9fb1bf9388..6f488946c587ddfc4528c1782709b25688188f7e 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     23.09.98
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence:     wxWindows license (part of wxExtra library)
+// Licence:     wxWindows licence (part of wxExtra library)
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef    __GNUG__
@@ -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,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/...