X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a5bcc4db0851bf8cd3063917511b0b17c7f9679..1a4b50d2f1a81aa390ff70f4387bc776563cbab7:/src/msw/clipbrd.cpp?ds=sidebyside diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 842a9c94aa..49cc833ca9 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -221,10 +221,13 @@ bool wxSetClipboardData(wxDataFormat dataFormat, { wxBitmap *bitmap = (wxBitmap *)data; - HGLOBAL hDIB = wxDIB::ConvertFromBitmap(GetHbitmapOf(*bitmap)); - if ( hDIB ) + if ( bitmap && bitmap->Ok() ) { - handle = ::SetClipboardData(CF_DIB, hDIB); + wxDIB dib(*bitmap); + if ( dib.IsOk() ) + { + handle = ::SetClipboardData(CF_DIB, dib.Detach()); + } } break; }