using System; using System.Runtime.InteropServices; namespace Vanara.PInvoke { public static partial class Shell32 { /// /// Exposes a method through which a client can provide an owner window to a Windows Runtime object used in a desktop application. /// /// /// When to implement /// /// Implement this interface if your object needs to be provided with an owner window, generally to display UI. Most third-party /// applications will not need to implement this interface. /// /// When to use /// /// Use this interface if you will provide a window to an object. A common scenario in which this interface is used is a Windows /// Store desktop browser. /// /// /// This interface is implemented by the following objects. Note that this is necessarily an incomplete list; refer to an individual /// object's documentation to determine whether that object implements this interface. /// /// /// /// Windows.UI.Popups.PopupMenu /// /// /// Windows.UI.Popups.MessageDialog /// /// /// Windows.Storage.Pickers.FileOpenPicker /// /// /// Windows.Storage.Pickers.FileSavePicker /// /// /// Windows.Storage.Pickers.FolderPicker /// /// /// CLSID_DragDropHelper /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-iinitializewithwindow [ComImport, Guid("3E68D4BD-7135-4D10-8018-9FB6D9F33FA1"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IInitializeWithWindow { /// Specifies an owner window to be used by a Windows Runtime object that is used in a desktop app. /// The handle of the window to be used as the owner window. /// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iinitializewithwindow-initialize HRESULT // Initialize( HWND hwnd ); [PreserveSig] HRESULT Initialize(HWND hwnd); } } }