From ab3d29eaab928b1b6da2abafa69799494fce8120 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Sep 2006 22:43:14 +0000 Subject: [PATCH] don't call ::GetSystemMetrics() unnecessarily in wxGetHiconSize() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/gdiimage.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 53b15e9dd7..1675b52c60 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -567,12 +567,10 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, wxSize wxGetHiconSize(HICON WXUNUSED_IN_WINCE(hicon)) { - // default icon size on this hardware - // usually 32x32 but can be other (smaller) on pocket devices - wxSize size(::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + wxSize size; #ifndef __WXWINCE__ - if (hicon) + if ( hicon ) { ICONINFO info; if ( !::GetIconInfo(hicon, &info) ) @@ -596,7 +594,14 @@ wxSize wxGetHiconSize(HICON WXUNUSED_IN_WINCE(hicon)) ::DeleteObject(info.hbmColor); } } -#endif + + if ( !size.x ) +#endif // !__WXWINCE__ + { + // use default icon size on this hardware + size.x = ::GetSystemMetrics(SM_CXICON); + size.y = ::GetSystemMetrics(SM_CYICON); + } return size; }