void Initialize(IListItemEx item) { Guid iise = typeof(IShellExtInit).GUID; var ishellViewPtr = (item.IsDrive || !item.IsFileSystem || item.IsNetworkPath) ? item.GetIShellFolder().CreateViewObject(IntPtr.Zero, typeof(IShellView).GUID) : item.Parent.GetIShellFolder().CreateViewObject(IntPtr.Zero, typeof(IShellView).GUID); var view = Marshal.GetObjectForIUnknown(ishellViewPtr) as IShellView; view?.GetItemObject(SVGIO.SVGIO_BACKGROUND, typeof(IContextMenu).GUID, out _Result); if (view != null) Marshal.ReleaseComObject(view); m_ComInterface = (IContextMenu)Marshal.GetTypedObjectForIUnknown(_Result, typeof(IContextMenu)); m_ComInterface2 = m_ComInterface as IContextMenu2; m_ComInterface3 = m_ComInterface as IContextMenu3; IntPtr iShellExtInitPtr; if (Marshal.QueryInterface(_Result, ref iise, out iShellExtInitPtr) == (int)HResult.S_OK) { var iShellExtInit = Marshal.GetTypedObjectForIUnknown(iShellExtInitPtr, typeof(IShellExtInit)) as IShellExtInit; try { var hhh = IntPtr.Zero; iShellExtInit?.Initialize(_ShellView.CurrentFolder.PIDL, null, 0); if (iShellExtInit != null) Marshal.ReleaseComObject(iShellExtInit); Marshal.Release(iShellExtInitPtr); } catch { } } m_MessageWindow = new MessageWindow(this); }