private SHCreateShellItem ( |
||
pidlParent | ||
psfParent | [ | |
pidl | ||
ppsi | [ | |
Résultat | int |
/// <summary>Constructs a new Shell object from IDList pointer</summary> /// <param name="idListPtr"></param> /// <param name="parent"></param> /// <returns></returns> internal static ShellObject Create(IntPtr idListPtr, ShellContainer parent) { var retCode = ShellNativeMethods.SHCreateShellItem( IntPtr.Zero, parent.NativeShellFolder, idListPtr, out var nativeShellItem); if (!CoreErrorHelper.Succeeded(retCode)) { return(null); } return(ShellObjectFactory.Create(nativeShellItem)); }
/// <summary> /// Constructs a new Shell object from IDList pointer /// </summary> /// <param name="idListPtr"></param> /// <param name="parent"></param> /// <returns></returns> internal static ShellObject Create(IntPtr idListPtr, ShellContainer parent) { IShellItem nativeShellItem; int retCode = ShellNativeMethods.SHCreateShellItem( IntPtr.Zero, parent.NativeShellFolder, idListPtr, out nativeShellItem); if (CoreErrorHelper.Succeeded(retCode)) { return(ShellObjectFactory.Create(nativeShellItem)); } else { // Since this is an internal method, return null instead of throwing an exception. // Let the caller know we weren't able to create a valid ShellObject with the given PIDL return(null); } }