packages/Windows API Code Pack 1.1/source/WindowsAPICodePack/Shell/ExplorerBrowser/ExplorerBrowser.cs
/// <summary>
/// Gets the selected items in the explorer browser as an IShellItemArray
/// </summary>
/// <returns></returns>
Gets the selected items in the explorer browser as an IShellItemArray
Gets the selected items in the explorer browser as an IShellItemArray
internal IShellItemArray GetSelectedItemsArray()
        {
            IShellItemArray iArray = null;
            IFolderView2 iFV2 = GetFolderView2();
            if (iFV2 != null)
            {
                try
                {
                    Guid iidShellItemArray = new Guid(ShellIIDGuid.IShellItemArray);
                    object oArray = null;
                    HResult hr = iFV2.Items((uint)ShellViewGetItemObject.Selection, ref iidShellItemArray, out oArray);
                    iArray = oArray as IShellItemArray;
                    if (hr != HResult.Ok &&
                        hr != HResult.ElementNotFound &&
                        hr != HResult.Fail)
                    {
                        throw new CommonControlException(LocalizedMessages.ExplorerBrowserUnexpectedError, hr);
                    }
                }
                finally
                {
                    Marshal.ReleaseComObject(iFV2);
                    iFV2 = null;
                }
            }
            return iArray;
        }
internal IShellItemArray GetSelectedItemsArray ( ) { IShellItemArray iArray = null ; IFolderView2 iFV2 = GetFolderView2 ( ) ; if ( iFV2 != null ) { try { Guid iidShellItemArray = new Guid ( ShellIIDGuid . IShellItemArray ) ; object oArray = null ; HResult hr = iFV2 . Items ( ( uint ) ShellViewGetItemObject . Selection , ref iidShellItemArray , out oArray ) ; iArray = oArray as IShellItemArray ; if ( hr != HResult . Ok && hr != HResult . ElementNotFound && hr != HResult . Fail ) { throw new CommonControlException ( LocalizedMessages . ExplorerBrowserUnexpectedError , hr ) ; } } finally { Marshal . ReleaseComObject ( iFV2 ) ; iFV2 = null ; } } return iArray ; }
Gets the selected items in the explorer browser as an IShellItemArray
Gets the selected items in the explorer browser as an IShellItemArray
None