In juce’s windows-specific code to handle drag-and-drop, there’s a call to IDataObject::GetData in JuceDropTarget::updateFileList. Only if GetData succeeds does updateFileList do anything, but I think that return value needs to bubble up to the callers of updateFileList and make its way back to the OS.
From the Notes to Implementers section of http://msdn.microsoft.com/en-us/library/windows/desktop/ms678431(v=vs.85).aspx:[quote]If the data object cannot comply with the information specified in the FORMATETC, the method should return DV_E_FORMATETC. If an attempt to allocate the medium fails, the method should return STG_E_MEDIUMFULL.[/quote]
Something like this at the beginning of DragEnter and Drop is what I’m talking about:
HRESULT hr = updateFileList (pDataObject);
if (hr != S_OK)
Without this change, I may get my filesDropped method called with 0 files. With this change the OS displays a do not enter symbol and doesn’t let the user drop data that IDataObject::GetData can’t handle. In my specific test, IDataObject::GetData returns DV_E_FORMATETC.