]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/clipbrd.cpp
X11-specific code doesn't work so well on wxCocoa
[wxWidgets.git] / src / msw / clipbrd.cpp
index c33ba4313da76725a04d27f5194867a50d22f855..b18e7bd98b3ac8a2bcc3aa6072bbb97888abbab5 100644 (file)
@@ -220,13 +220,13 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
 
         case wxDF_DIB:
             {
-#if wxUSE_IMAGE_LOADING_IN_MSW
                 wxBitmap *bitmap = (wxBitmap *)data;
-                HBITMAP hBitmap = (HBITMAP)bitmap->GetHBITMAP();
-                // NULL palette means to use the system one
-                HANDLE hDIB = wxBitmapToDIB(hBitmap, (HPALETTE)NULL);
-                handle = SetClipboardData(CF_DIB, hDIB);
-#endif // wxUSE_IMAGE_LOADING_IN_MSW
+
+                HGLOBAL hDIB = wxDIB::ConvertFromBitmap(GetHbitmapOf(*bitmap));
+                if ( hDIB )
+                {
+                    handle = ::SetClipboardData(CF_DIB, hDIB);
+                }
                 break;
             }