From: Vadim Zeitlin Date: Sat, 2 Dec 2006 12:50:58 +0000 (+0000) Subject: reset the old disabled image list even if there is no new one (bug 1604374) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/24bc71f48bdf755884649c5ff15136adac300694 reset the old disabled image list even if there is no new one (bug 1604374) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 8cab9f682e..64a3802e26 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -784,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); } }