Hello again,
thank for Informations. I try to get drag drop container Information by thiscode:
private void listView1_DragDrop(object sender, DragEventArgs e)
{
try
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
string[] FileNames = null;
FileNames = (string[])e.Data.GetData(DataFormats.FileDrop);
if (FileNames != null)
{
//foreach (string file in FileNames)
//uploadDocument(file);
//getDocumentList();
return;
}
}
else if (e.Data.GetDataPresent(“FileGroupDescriptor”) || e.Data.GetDataPresent(“FileGroupDescriptorW”))
{
/// Variables
System.Windows.Forms.IDataObject underlyingDataObject;
System.Runtime.InteropServices.ComTypes.IDataObject comUnderlyingDataObject;
System.Windows.Forms.IDataObject oleUnderlyingDataObject;
MethodInfo getDataFromHGLOBLALMethod;
//get the underlying dataobject and its ComType IDataObject interface to it
underlyingDataObject = e.Data;
comUnderlyingDataObject = (System.Runtime.InteropServices.ComTypes.IDataObject)underlyingDataObject;
//get the internal ole dataobject and its GetDataFromHGLOBLAL so it can be called later
FieldInfo innerDataField = underlyingDataObject.GetType().GetField(“innerData”, BindingFlags.NonPublic | BindingFlags.Instance); /// OUTLOOK have a “innerData” Field
if (innerDataField == null)
innerDataField = underlyingDataObject.GetType().GetField(“m_ObjectToDataMap”, BindingFlags.NonPublic | BindingFlags.Instance); /// EM-CLIENT have NO “innerData” Field only “m_ObjectToDataMap” Field
oleUnderlyingDataObject = (System.Windows.Forms.IDataObject)innerDataField.GetValue(underlyingDataObject);
getDataFromHGLOBLALMethod = oleUnderlyingDataObject.GetType().GetMethod(“GetDataFromHGLOBLAL”, BindingFlags.NonPublic | BindingFlags.Instance);
//get the names and data streams of the files dropped
//string[] filenames = (string[])dataObject.GetData(“FileGroupDescriptorW”);
//MemoryStream[] filestreams = (MemoryStream[])dataObject.GetData(“FileContents”);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
As against to MS Outlook the EM-Client DragDrop-Container doesn’t have a field “innerData”. The innerdata-field of the MS Outlook Container contains the infos of the dragging email. The EM-Client contains only a field “m_ObjectToDataMap”. Unfortunaly the value of this field is null. It must exist a a way to get the data of your DragDrop-Container but it is possibel to drag a EM Email to MS Outlook or to files system. Did you have any idea?
Members of ECleint DragDrop Container
GetIUnknown
GetData
SetData
ReleaseAllData
GetEventProvider
ReleaseSelf
FinalReleaseSelf
CreateEventProvider
GetComIUnknown
IsInstanceOfType
InvokeMember
MemberwiseClone
__RaceSetServerIdentity
__ResetServerIdentity
CanCastToXmlType
Finalize
MemberwiseClone
.ctor
m_ObjectToDataMap
Members of MS Outlool DragDrop Container
get_RestrictedFormats
set_RestrictedFormats
System.Runtime.InteropServices.ComTypes.IDataObject.DAdvise
System.Runtime.InteropServices.ComTypes.IDataObject.DUnadvise
System.Runtime.InteropServices.ComTypes.IDataObject.EnumDAdvise
System.Runtime.InteropServices.ComTypes.IDataObject.EnumFormatEtc
System.Runtime.InteropServices.ComTypes.IDataObject.GetCanonicalFormatEtc
System.Runtime.InteropServices.ComTypes.IDataObject.GetData
System.Runtime.InteropServices.ComTypes.IDataObject.GetDataHere
System.Runtime.InteropServices.ComTypes.IDataObject.QueryGetData
System.Runtime.InteropServices.ComTypes.IDataObject.SetData
GetCompatibleBitmap
GetTymedUseable
GetDataIntoOleStructs
SaveDataToHandle
SaveObjectToHandle
SaveStreamToHandle
SaveFileListToHandle
SaveStringToHandle
SaveHtmlToHandle
Finalize
MemberwiseClone
.ctor
.ctor
RestrictedFormats
innerData
k__BackingField
FormatEnumerator
OleConverter
DataStore