]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/tbar95.cpp
unused parameter warning fix after last change
[wxWidgets.git] / src / msw / tbar95.cpp
index 16a2ec95c957691b8f97f6884ded3c566cdb038c..64a3802e260ea5492881730cc2b425b450ef07f0 100644 (file)
@@ -234,6 +234,8 @@ bool wxToolBar::Create(wxWindow *parent,
     if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
         return false;
 
+    FixupStyle();
+
     // MSW-specific initialisation
     if ( !MSWCreateToolbar(pos, size) )
         return false;
@@ -782,17 +784,21 @@ bool wxToolBar::Realize()
             }
         }
 
-        if ( m_disabledImgList )
+        // disable image lists are only supported in comctl32.dll 4.70+
+        if ( wxApp::GetComCtl32Version() >= 470 )
         {
+            HIMAGELIST hil = m_disabledImgList
+                                ? GetHimagelistOf(m_disabledImgList)
+                                : 0;
+
+            // notice that we set the image list even if don't have one right
+            // now as we could have it before and need to reset it in this case
             HIMAGELIST oldImageList = (HIMAGELIST)
-                ::SendMessage(GetHwnd(),
-                              TB_SETDISABLEDIMAGELIST,
-                              0,
-                              (LPARAM)GetHimagelistOf(m_disabledImgList));
+              ::SendMessage(GetHwnd(), TB_SETDISABLEDIMAGELIST, 0, (LPARAM)hil);
 
             // delete previous image list if any
             if ( oldImageList )
-                ::DeleteObject( oldImageList );
+                ::DeleteObject(oldImageList);
         }
     }