int IShellExtInit.Initialize(IntPtr pidlFolder, IntPtr lpdobj, uint hKeyProgID) { try { _CurrentDataObject = null; if (lpdobj != (IntPtr)0) { _CurrentDataObject = (Win32API.IDataObject)Marshal.GetObjectForIUnknown(lpdobj); FORMATETC formatEtc = new FORMATETC(); formatEtc.cfFormat = 15; formatEtc.ptd = IntPtr.Zero; formatEtc.dwAspect = DVASPECT.DVASPECT_CONTENT; formatEtc.lindex = -1; formatEtc.tymed = TYMED.TYMED_HGLOBAL; STGMEDIUM stgMedium = new STGMEDIUM(); _CurrentDataObject.GetData(ref formatEtc, ref stgMedium); _UnionMember = stgMedium.unionmember.ToInt32(); } } catch (Exception) { } return(S_OK); }
int IShellExtInit.Initialize(IntPtr pidlFolder, IntPtr lpdobj, uint hKeyProgID) { try { _CurrentDataObject = null; if (lpdobj != (IntPtr)0) { _CurrentDataObject = (Win32API.IDataObject)Marshal.GetObjectForIUnknown(lpdobj); FORMATETC formatEtc = new FORMATETC(); formatEtc.cfFormat = 15; formatEtc.ptd = IntPtr.Zero; formatEtc.dwAspect = DVASPECT.DVASPECT_CONTENT; formatEtc.lindex = -1; formatEtc.tymed = TYMED.TYMED_HGLOBAL; STGMEDIUM stgMedium = new STGMEDIUM(); _CurrentDataObject.GetData(ref formatEtc, ref stgMedium); _UnionMember = stgMedium.unionmember.ToInt32(); } } catch (Exception) { } return S_OK; }