diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index ab9b671455..7dc72333fe 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -478,6 +478,11 @@ inline bool wxStyleHasBorder(long style) // may return NULL extern wxWindow *wxGetWindowFromHWND(WXHWND hwnd); + +// Get the size of an icon +wxSize wxGetHiconSize(HICON hicon); + + #endif // wxUSE_GUI #endif diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 26e9292110..b34abfe247 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -184,7 +184,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxObject) // private functions // ---------------------------------------------------------------------------- -static wxSize GetHiconSize(HICON hicon); #endif // __MICROWIN__ @@ -466,7 +465,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, return FALSE; } - size = GetHiconSize(hicon); + size = wxGetHiconSize(hicon); #else // Win16 HICON hicon = ReadIconFile((wxChar *)name.c_str(), wxGetInstance(), @@ -551,7 +550,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, } } - wxSize size = GetHiconSize(hicon); + wxSize size = wxGetHiconSize(hicon); icon->SetSize(size.x, size.y); icon->SetHICON((WXHICON)hicon); @@ -563,7 +562,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, // private functions // ---------------------------------------------------------------------------- -static wxSize GetHiconSize(HICON hicon) +wxSize wxGetHiconSize(HICON hicon) { wxSize size(32, 32); // default diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 53a0551e81..c5d5039212 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -41,7 +41,7 @@ #ifdef __WXMSW__ #include "wx/msw/registry.h" - #include "windows.h" + #include "wx/msw/private.h" #endif // OS #include "wx/msw/mimetype.h" @@ -374,6 +374,8 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon, default: icon->SetHICON((WXHICON)hIcon); + wxSize size = wxGetHiconSize(hIcon); + icon->SetSize(size); if ( iconIndex ) *iconIndex = nIndex; if ( iconFile )