using System; using System.Runtime.InteropServices; namespace Vanara.PInvoke { public static partial class Shell32 { /// /// Exposes methods that notify the docking window object of changes, including showing, hiding, and impending removal. This /// interface is implemented by window objects that can be docked within the border space of a Windows Explorer window. /// /// /// /// IDockingWindow is derived from IOleWindow. See the following topics for details on these methods also available to /// IDockingWindow through that inheritance. /// /// /// /// Additional IDockingWindow Methods /// /// /// IDockingWindow::GetWindow /// /// /// IDockingWindow::ContextSensitiveHelp /// /// /// When to Implement /// /// Implement IDockingWindow when you want to display a window inside a browser frame. This is typically used for user /// interface windows, such as toolbars. /// /// When to Use /// /// You do not usually use the IDockingWindow interface directly. The Shell browser uses this interface to support docked /// windows inside the browser frame. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-idockingwindow [ComImport, Guid("012dd920-7b26-11d0-8ca9-00a0c92dbfe8"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IDockingWindow : Ole32.IOleWindow { /// /// Retrieves a handle to one of the windows participating in in-place activation (frame, document, parent, or in-place object window). /// /// A pointer to a variable that receives the window handle. new HWND GetWindow(); /// Determines whether context-sensitive help mode should be entered during an in-place activation session. /// true if help mode should be entered; false if it should be exited. new void ContextSensitiveHelp([MarshalAs(UnmanagedType.Bool)] bool fEnterMode); /// Instructs the docking window object to show or hide itself. /// /// Type: BOOL /// /// TRUE if the docking window object should show its window. FALSE if the docking window object should hide its /// window and return its border space by calling SetBorderSpaceDW with zero values. /// /// /// /// Type: HRESULT /// 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-idockingwindow-showdw HRESULT ShowDW( BOOL // fShow ); [PreserveSig] HRESULT ShowDW([MarshalAs(UnmanagedType.Bool)] bool fShow); /// /// Notifies the docking window object that it is about to be removed from the frame. The docking window object should save any /// persistent information at this time. /// /// /// Type: DWORD /// Reserved. This parameter should always be zero. /// /// /// Type: HRESULT /// 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-idockingwindow-closedw HRESULT CloseDW( // DWORD dwReserved ); [PreserveSig] HRESULT CloseDW(uint dwReserved); /// /// Notifies the docking window object that the frame's border space has changed. In response to this method, the IDockingWindow /// implementation must call SetBorderSpaceDW, even if no border space is required or a change is not necessary. /// /// /// Type: LPCRECT /// Pointer to a RECT structure that contains the frame's available border space. /// /// /// Type: IUnknown* /// /// Pointer to the site's IUnknown interface. The docking window object should call the QueryInterface method for this /// interface, requesting IID_IDockingWindowSite. The docking window object then uses that interface to negotiate its border /// space. It is the docking window object's responsibility to release this interface when it is no longer needed. /// /// /// /// Type: BOOL /// Reserved. This parameter should always be zero. /// /// /// Type: HRESULT /// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// /// /// /// The prcBorder parameter contains the frame's entire available border space. The docking window object should negotiate its /// border space and then use this information to position itself. /// /// /// For example, if the docking window object requires 25 pixels at the top of the border space, it should negotiate for this /// through the following steps: /// /// /// /// Allocate a BORDERWIDTHS structure and set its top member to 25. /// /// /// Call RequestBorderSpaceDW to request the space. /// /// /// If the request is approved by RequestBorderSpaceDW, call SetBorderSpaceDW to allocate the space. /// /// /// /// The docking window object can then position its window at prcBorder->left and prcBorder->top. The width of the docking /// window object's window is determined by subtracting prcBorder->left from prcBorder->right. Its height is contained in /// the top member of the BORDERWIDTHS structure. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idockingwindow-resizeborderdw HRESULT // ResizeBorderDW( LPCRECT prcBorder, IUnknown *punkToolbarSite, BOOL fReserved ); [PreserveSig] HRESULT ResizeBorderDW([In, Optional] PRECT prcBorder, [In, Optional, MarshalAs(UnmanagedType.IUnknown)] object punkToolbarSite, [MarshalAs(UnmanagedType.Bool)] bool fReserved); } } }