X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f1f21d2a54124859b1fbeaa31ebf373bb5f0114..2edac25b2ea3876bf57a54d314d59050b5fbd8e7:/src/msw/bmpbuttn.cpp diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index 83f7efc9d5..b05541c635 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -27,6 +27,7 @@ #endif #include "wx/msw/private.h" +#include "wx/msw/dc.h" // for wxDCTemp #include "wx/msw/uxtheme.h" @@ -175,7 +176,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, msStyle, 0, 0, 0, 0, GetWinHwnd(parent), - (HMENU)m_windowId, + (HMENU)wxUIntToPtr(m_windowId.GetValue()), wxGetInstance(), NULL ); @@ -227,7 +228,7 @@ void wxBitmapButton::OnMouseEnterOrLeave(wxMouseEvent& event) void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap) { #if wxUSE_IMAGE - if ( !HasFlag(wxBU_AUTODRAW) && !m_disabledSetByUser ) + if ( !HasFlag(wxBU_AUTODRAW) && !m_disabledSetByUser && bitmap.IsOk() ) { m_bmpDisabled = wxBitmap(bitmap.ConvertToImage().ConvertToGreyscale()); }