MCPcopy Create free account
hub / github.com/derceg/explorerplusplus / CheckDropFormatSupported

Method CheckDropFormatSupported

Explorer++/Helper/DropHandler.cpp:223–253  ·  view source on GitHub ↗

Some applications (e.g. Thunderbird) may indicate via QueryGetData() that they support a particular drop format, even though a corresponding call to GetData() fails. Therefore, we'll actually attempt to query the data using GetData(). */

Source from the content-addressed store, hash-verified

221Therefore, we'll actually attempt to query the data using
222GetData(). */
223BOOL DropHandler::CheckDropFormatSupported(IDataObject *pDataObject,FORMATETC *pftc)
224{
225 HRESULT hr;
226
227 /* When using QueryGetData(), the line index
228 must be -1. This may not be the case when calling
229 GetData(). */
230 LONG lindex = pftc->lindex;
231 pftc->lindex = -1;
232
233 hr = pDataObject->QueryGetData(pftc);
234
235 pftc->lindex = lindex;
236
237 if(hr != S_OK)
238 {
239 return FALSE;
240 }
241
242 STGMEDIUM stg;
243 hr = pDataObject->GetData(pftc,&stg);
244
245 if(hr != S_OK)
246 {
247 return FALSE;
248 }
249
250 ReleaseStgMedium(&stg);
251
252 return TRUE;
253}
254
255HRESULT DropHandler::CopyHDropData(IDataObject *pDataObject,
256 BOOL bPrefferedEffect,DWORD dwEffect)

Callers

nothing calls this directly

Calls 2

QueryGetDataMethod · 0.80
GetDataMethod · 0.80

Tested by

no test coverage detected