// old-style clipboard functions using Windows API
// ---------------------------------------------------------------------------
// old-style clipboard functions using Windows API
// ---------------------------------------------------------------------------
// Now go back, calculate all the lengths, and write out the
// necessary header information. Note, wsprintf() truncates the
// string when you overwrite it so you follow up with code to replace
// Now go back, calculate all the lengths, and write out the
// necessary header information. Note, wsprintf() truncates the
// string when you overwrite it so you follow up with code to replace
char *ptr = strstr(buf, "StartHTML");
wsprintf(ptr+10, "%08u", strstr(buf, "<html>") - buf);
*(ptr+10+8) = '\r';
char *ptr = strstr(buf, "StartHTML");
wsprintf(ptr+10, "%08u", strstr(buf, "<html>") - buf);
*(ptr+10+8) = '\r';
ptr = strstr(buf, "EndHTML");
wsprintf(ptr+8, "%08u", strlen(buf));
*(ptr+8+8) = '\r';
ptr = strstr(buf, "EndHTML");
wsprintf(ptr+8, "%08u", strlen(buf));
*(ptr+8+8) = '\r';
ptr = strstr(buf, "StartFragment");
wsprintf(ptr+14, "%08u", strstr(buf, "<!--StartFrag") - buf);
*(ptr+14+8) = '\r';
ptr = strstr(buf, "StartFragment");
wsprintf(ptr+14, "%08u", strstr(buf, "<!--StartFrag") - buf);
*(ptr+14+8) = '\r';
ptr = strstr(buf, "EndFragment");
wsprintf(ptr+12, "%08u", strstr(buf, "<!--EndFrag") - buf);
*(ptr+12+8) = '\r';
ptr = strstr(buf, "EndFragment");
wsprintf(ptr+12, "%08u", strstr(buf, "<!--EndFrag") - buf);
*(ptr+12+8) = '\r';
// Allocate global memory for transfer...
HGLOBAL hText = GlobalAlloc(GMEM_MOVEABLE |GMEM_DDESHARE, strlen(buf)+4);
// Allocate global memory for transfer...
HGLOBAL hText = GlobalAlloc(GMEM_MOVEABLE |GMEM_DDESHARE, strlen(buf)+4);
// using OLE clipboard when the app terminates - by default, we call
// OleSetClipboard(NULL) which won't waste RAM, but the app can call
// wxClipboard::Flush() to chaneg this
// using OLE clipboard when the app terminates - by default, we call
// OleSetClipboard(NULL) which won't waste RAM, but the app can call
// wxClipboard::Flush() to chaneg this
// enumerate all explicit formats on the clipboard.
// note that this does not include implicit / synthetic (automatically
// enumerate all explicit formats on the clipboard.
// note that this does not include implicit / synthetic (automatically
// if the format is not available, try the next one
// this test includes implicit / sythetic formats
if ( !::IsClipboardFormatAvailable(cf) )
continue;
// if the format is not available, try the next one
// this test includes implicit / sythetic formats
if ( !::IsClipboardFormatAvailable(cf) )
continue;
wxTextDataObject& textDataObject = (wxTextDataObject &)data;
char* s = (char*)wxGetClipboardData(format);
if ( !s )
wxTextDataObject& textDataObject = (wxTextDataObject &)data;
char* s = (char*)wxGetClipboardData(format);
if ( !s )
wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data;
wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data.GetPreferredFormat());
if ( !bitmap )
wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data;
wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data.GetPreferredFormat());
if ( !bitmap )
wxMetafileDataObject& metaFileDataObject = (wxMetafileDataObject &)data;
wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE);
if ( !metaFile )
wxMetafileDataObject& metaFileDataObject = (wxMetafileDataObject &)data;
wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE);
if ( !metaFile )