ole32: Add support for rendering HENHMETAFILE clipboard objects.

This commit is contained in:
Vincent Povirk 2009-06-19 14:26:48 -05:00 committed by Alexandre Julliard
parent a30624143a
commit 51385a98cc
1 changed files with 28 additions and 0 deletions

View File

@ -744,6 +744,30 @@ static HRESULT get_data_from_global(IDataObject *data, FORMATETC *fmt, HGLOBAL *
return hr;
}
static HRESULT get_data_from_enhmetafile(IDataObject *data, FORMATETC *fmt, HGLOBAL *mem)
{
HENHMETAFILE copy;
HRESULT hr;
FORMATETC mem_fmt;
STGMEDIUM med;
*mem = NULL;
mem_fmt = *fmt;
mem_fmt.tymed = TYMED_ENHMF;
hr = IDataObject_GetData(data, &mem_fmt, &med);
if(FAILED(hr)) return hr;
copy = CopyEnhMetaFileW(med.u.hEnhMetaFile, NULL);
if(copy) *mem = (HGLOBAL)copy;
else hr = E_FAIL;
ReleaseStgMedium(&med);
return hr;
}
/***********************************************************************
* render_format
*
@ -773,6 +797,10 @@ static HRESULT render_format(IDataObject *data, LPFORMATETC fmt)
{
hr = get_data_from_global(data, fmt, &clip_data);
}
else if(fmt->tymed & TYMED_ENHMF)
{
hr = get_data_from_enhmetafile(data, fmt, &clip_data);
}
else
{
FIXME("Unhandled tymed %x\n", fmt->tymed);