]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toplevel.cpp
fixed VC++ warning in optimized build
[wxWidgets.git] / src / msw / toplevel.cpp
index 0c5ef7d3b33e2a8cc072c9a67df3527bc8eea685..03ef96e8d8d2fad0bb3fec690bd944e650fd000d 100644 (file)
 
 #include "wx/msw/private.h"
 
+#ifndef ICON_BIG
+    #define ICON_BIG 1
+#endif
+
+#ifndef ICON_SMALL
+    #define ICON_SMALL 0
+#endif
+
 // ----------------------------------------------------------------------------
 // stubs for missing functions under MicroWindows
 // ----------------------------------------------------------------------------
@@ -584,14 +592,26 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
 
 void wxTopLevelWindowMSW::SetIcon(const wxIcon& icon)
 {
-    // this sets m_icon
-    wxTopLevelWindowBase::SetIcon(icon);
+    SetIcons( wxIconBundle( icon ) );
+}
+
+void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons)
+{
+    wxTopLevelWindowBase::SetIcons(icons);
 
 #if defined(__WIN95__) && !defined(__WXMICROWIN__)
-    if ( m_icon.Ok() )
+    const wxIcon& sml = icons.GetIcon( wxSize( 16, 16 ) );
+    if( sml.Ok() && sml.GetWidth() == 16 && sml.GetHeight() == 16 )
+    {
+        ::SendMessage( GetHwndOf( this ), WM_SETICON, ICON_SMALL,
+                       (LPARAM)GetHiconOf(sml) );
+    }
+
+    const wxIcon& big = icons.GetIcon( wxSize( 32, 32 ) );
+    if( big.Ok() && big.GetWidth() == 32 && big.GetHeight() == 32 )
     {
-        ::SendMessage(GetHwnd(), WM_SETICON,
-                      (WPARAM)TRUE, (LPARAM)GetHiconOf(m_icon));
+        ::SendMessage( GetHwndOf( this ), WM_SETICON, ICON_BIG,
+                       (LPARAM)GetHiconOf(big) );
     }
 #endif // __WIN95__
 }