+// TODO:
+/*
+ HANDLE handle = 0; // return value of SetClipboardData
+ switch (dataFormat)
+ {
+ case wxDF_BITMAP:
+ {
+ wxBitmap *bitmap = (wxBitmap *)data;
+
+ HDC hdcMem = CreateCompatibleDC((HDC) NULL);
+ HDC hdcSrc = CreateCompatibleDC((HDC) NULL);
+ HBITMAP old = (HBITMAP)
+ ::SelectObject(hdcSrc, (HBITMAP)bitmap->GetHBITMAP());
+ HBITMAP hBitmap = CreateCompatibleBitmap(hdcSrc,
+ bitmap->GetWidth(),
+ bitmap->GetHeight());
+ if (!hBitmap)
+ {
+ SelectObject(hdcSrc, old);
+ DeleteDC(hdcMem);
+ DeleteDC(hdcSrc);
+ return false;
+ }
+
+ HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap);
+ BitBlt(hdcMem, 0, 0, bitmap->GetWidth(), bitmap->GetHeight(),
+ hdcSrc, 0, 0, SRCCOPY);
+
+ // Select new bitmap out of memory DC
+ SelectObject(hdcMem, old1);
+
+ // Set the data
+ handle = ::SetClipboardData(CF_BITMAP, hBitmap);
+
+ // Clean up
+ SelectObject(hdcSrc, old);
+ DeleteDC(hdcSrc);
+ DeleteDC(hdcMem);
+ break;
+ }
+
+ 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
+ break;
+ }
+
+#if wxUSE_METAFILE
+ case wxDF_METAFILE:
+ {
+ wxMetafile *wxMF = (wxMetafile *)data;
+ HANDLE data = GlobalAlloc(GHND, sizeof(METAFILEPICT) + 1);
+ METAFILEPICT *mf = (METAFILEPICT *)GlobalLock(data);
+
+ mf->mm = wxMF->GetWindowsMappingMode();
+ mf->xExt = width;
+ mf->yExt = height;
+ mf->hMF = (HMETAFILE) wxMF->GetHMETAFILE();
+ GlobalUnlock(data);
+ wxMF->SetHMETAFILE((WXHANDLE) NULL);
+
+ handle = SetClipboardData(CF_METAFILEPICT, data);
+ break;
+ }
+#endif
+ case CF_SYLK:
+ case CF_DIF:
+ case CF_TIFF:
+ case CF_PALETTE:
+ default:
+ {
+ wxLogError(_("Unsupported clipboard format."));
+ return false;
+ }
+
+ case wxDF_OEMTEXT:
+ dataFormat = wxDF_TEXT;
+ // fall through
+
+ case wxDF_TEXT:
+ {
+ char *s = (char *)data;
+
+ width = strlen(s) + 1;
+ height = 1;
+ DWORD l = (width * height);
+ HANDLE hGlobalMemory = GlobalAlloc(GHND, l);
+ if ( hGlobalMemory )
+ {
+ LPSTR lpGlobalMemory = (LPSTR)GlobalLock(hGlobalMemory);
+
+ memcpy(lpGlobalMemory, s, l);
+
+ GlobalUnlock(hGlobalMemory);
+ }
+
+ handle = SetClipboardData(dataFormat, hGlobalMemory);
+ break;
+ }
+ }
+
+ if ( handle == 0 )
+ {
+ wxLogSysError(_("Failed to set clipboard data."));
+
+ return false;
+ }
+*/
+ return true;