|
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
namespace System.Ole
{
[Guid("00000115-0000-0000-C000-000000000046")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IOleInPlaceUIWindow
:IVTable<IOleInPlaceUIWindow,IOleInPlaceUIWindow.Vtbl>,IComIID {
/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
internal unsafe winmdroot.Foundation.HRESULT QueryInterface(in global::System.Guid riid, out void* ppvObject)
{
fixed (void** ppvObjectLocal = &ppvObject)
{
fixed (global::System.Guid* riidLocal = &riid)
{
winmdroot.Foundation.HRESULT __result = this.QueryInterface(riidLocal, ppvObjectLocal);
return __result;
}
}
}
public unsafe winmdroot.Foundation.HRESULT QueryInterface(global::System.Guid* riid, void** ppvObject)
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,uint>)lpVtbl[1])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,uint>)lpVtbl[2])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this));
}
/// <inheritdoc cref="GetWindow(winmdroot.Foundation.HWND*)"/>
internal unsafe winmdroot.Foundation.HRESULT GetWindow(out winmdroot.Foundation.HWND phwnd)
{
fixed (winmdroot.Foundation.HWND* phwndLocal = &phwnd)
{
winmdroot.Foundation.HRESULT __result = this.GetWindow(phwndLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetWindow(IOleInPlaceUIWindow* pThis, winmdroot.Foundation.HWND* phwnd)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetWindow(phwnd);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
public unsafe winmdroot.Foundation.HRESULT GetWindow(winmdroot.Foundation.HWND* phwnd)
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this), phwnd);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT ContextSensitiveHelp(IOleInPlaceUIWindow* pThis, winmdroot.Foundation.BOOL fEnterMode)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.ContextSensitiveHelp(fEnterMode);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
public winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode)
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this), fEnterMode);
}
/// <inheritdoc cref="GetBorder(winmdroot.Foundation.RECT*)"/>
internal unsafe winmdroot.Foundation.HRESULT GetBorder(out winmdroot.Foundation.RECT lprectBorder)
{
fixed (winmdroot.Foundation.RECT* lprectBorderLocal = &lprectBorder)
{
winmdroot.Foundation.HRESULT __result = this.GetBorder(lprectBorderLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetBorder(IOleInPlaceUIWindow* pThis, winmdroot.Foundation.RECT* lprectBorder)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetBorder(lprectBorder);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves the outer rectangle for toolbars and controls while the object is active in place.</summary>
/// <param name="lprectBorder">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/windef/ns-windef-rect">RECT</a> structure where the outer rectangle is to be returned. The structure's coordinates are relative to the window being represented by the interface.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The <b>IOleInPlaceUIWindow::GetBorder</b> function, when called on a document or frame window object, returns the outer rectangle (relative to the window) where the object can put toolbars or similar controls. If the object is to install these tools, it should negotiate space for the tools within this rectangle using <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceuiwindow-requestborderspace">IOleInPlaceUIWindow::RequestBorderSpace</a> and then call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceuiwindow-setborderspace">IOleInPlaceUIWindow::SetBorderSpace</a> to get this space allocated. <div class="alert"><b>Note</b> While executing <b>IOleInPlaceUIWindow::GetBorder</b>, do not make calls to the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-peekmessagea">PeekMessage</a> or <a href="https://docs.microsoft.com/previous-versions/windows/desktop/fax/-mfax-faxaccountincomingarchive-getmessage-vb">GetMessage</a> functions, or a dialog box. Doing so may cause the system to deadlock. There are further restrictions on which OLE interface methods and functions can be called from within <b>GetBorder</b>.</div> <div> </div></para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceuiwindow-getborder#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT GetBorder(winmdroot.Foundation.RECT* lprectBorder)
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this), lprectBorder);
}
/// <inheritdoc cref="RequestBorderSpace(winmdroot.Foundation.RECT*)"/>
internal unsafe winmdroot.Foundation.HRESULT RequestBorderSpace(in winmdroot.Foundation.RECT pborderwidths)
{
fixed (winmdroot.Foundation.RECT* pborderwidthsLocal = &pborderwidths)
{
winmdroot.Foundation.HRESULT __result = this.RequestBorderSpace(pborderwidthsLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT RequestBorderSpace(IOleInPlaceUIWindow* pThis, winmdroot.Foundation.RECT* pborderwidths)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.RequestBorderSpace(pborderwidths);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Determines whether there is space available for tools to be installed around the object's window frame while the object is active in place.</summary>
/// <param name="pborderwidths">A pointer to a <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/cc136564(v=vs.85)">BORDERWIDTHS</a> structure containing the requested widths (in pixels) needed on each side of the window for the tools.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The active in-place object calls <b>IOleInPlaceUIWindow::RequestBorderSpace</b> to ask if tools can be installed inside the window frame. These tools would be allocated between the rectangle returned by <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceuiwindow-getborder">IOleInPlaceUIWindow::GetBorder</a> and the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/cc136564(v=vs.85)">BORDERWIDTHS</a> structure specified in the argument to this call. The space for the tools is not actually allocated to the object until it calls <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceuiwindow-setborderspace">IOleInPlaceUIWindow::SetBorderSpace</a>, allowing the object to negotiate for space (such as while dragging toolbars around), but deferring the moving of tools until the action is completed. The object can install these tools by passing the width in pixels that is to be used on each side. For example, if the object required 10 pixels on the top, 0 pixels on the bottom, and 5 pixels on the left and right sides, it would pass the following <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/cc136564(v=vs.85)">BORDERWIDTHS</a> structure to <b>IOleInPlaceUIWindow::RequestBorderSpace</b>:</para>
/// <para></para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceuiwindow-requestborderspace#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT RequestBorderSpace(winmdroot.Foundation.RECT* pborderwidths)
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this), pborderwidths);
}
/// <inheritdoc cref="SetBorderSpace(winmdroot.Foundation.RECT*)"/>
internal unsafe winmdroot.Foundation.HRESULT SetBorderSpace(in winmdroot.Foundation.RECT pborderwidths)
{
fixed (winmdroot.Foundation.RECT* pborderwidthsLocal = &pborderwidths)
{
winmdroot.Foundation.HRESULT __result = this.SetBorderSpace(pborderwidthsLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT SetBorderSpace(IOleInPlaceUIWindow* pThis, winmdroot.Foundation.RECT* pborderwidths)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.SetBorderSpace(pborderwidths);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Allocates space for the border requested in the call to IOleInPlaceUIWindow::RequestBorderSpace.</summary>
/// <param name="pborderwidths">Pointer to a <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/cc136564(v=vs.85)">BORDERWIDTHS</a> structure containing the requested width of the tools, in pixels. It can be <b>NULL</b>, indicating the object does not need any space.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>The object must call <b>IOleInPlaceUIWindow::SetBorderSpace</b>. It can do any one of the following: </para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceuiwindow-setborderspace#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT SetBorderSpace(winmdroot.Foundation.RECT* pborderwidths)
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this), pborderwidths);
}
/// <inheritdoc cref="SetActiveObject(winmdroot.System.Ole.IOleInPlaceActiveObject*, winmdroot.Foundation.PCWSTR)"/>
internal unsafe winmdroot.Foundation.HRESULT SetActiveObject(winmdroot.System.Ole.IOleInPlaceActiveObject* pActiveObject, string pszObjName)
{
fixed (char* pszObjNameLocal = pszObjName)
{
winmdroot.Foundation.HRESULT __result = this.SetActiveObject(pActiveObject, pszObjNameLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT SetActiveObject(IOleInPlaceUIWindow* pThis, winmdroot.System.Ole.IOleInPlaceActiveObject* pActiveObject, winmdroot.Foundation.PCWSTR pszObjName)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.SetActiveObject(pActiveObject, pszObjName);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Provides a direct channel of communication between the object and each of the frame and document windows.</summary>
/// <param name="pActiveObject">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceactiveobject">IOleInPlaceActiveObject</a> interface on the active in-place object.</param>
/// <param name="pszObjName">A pointer to a string containing a name that describes the object an embedding container can use in composing its window title. It can be <b>NULL</b> if the object does not require the container to change its window titles. Containers should ignore this parameter and always use their own name in the title bar.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>Generally, an embedded object should pass <b>NULL</b> for the <i>pszObjName</i> parameter (see Notes to Implementers below). However, if you are working in conjunction with a container that does display the name of the in-place active object in its title bar, then you should compose a string in the following form: <<i>application name</i>> – <<i>object short-type name</i>>. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> <b>IOleInPlaceUIWindow::SetActiveObject</b> is called by the object to establish a direct communication link between itself and the document and frame windows. When deactivating, the object calls <b>IOleInPlaceUIWindow::SetActiveObject</b>, passing <b>NULL</b> for the <i>pActiveObject</i> and pszObjName parameters. An object must call <b>IOleInPlaceUIWindow::SetActiveObject</b> before calling <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceframe-setmenu">IOleInPlaceFrame::SetMenu</a> to give the container the pointer to the active object. The container then uses this pointer in processing <b>IOleInPlaceFrame::SetMenu</b> and to pass to <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-olesetmenudescriptor">OleSetMenuDescriptor</a>. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> The Microsoft Windows User Interface Design Guide recommends that an in-place container ignore the <i>pszObjName</i> parameter passed in this method. The guide says "The title bar is not affected by in-place activation. It always displays the top-level container's name."</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceuiwindow-setactiveobject#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT SetActiveObject(winmdroot.System.Ole.IOleInPlaceActiveObject* pActiveObject, winmdroot.Foundation.PCWSTR pszObjName)
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.System.Ole.IOleInPlaceActiveObject* ,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleInPlaceUIWindow*)Unsafe.AsPointer(ref this), pActiveObject, pszObjName);
}
internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv)
where T : unmanaged
{
var hr = this.QueryInterface(typeof(T).GUID, out void* pv);
if (hr.Succeeded)
{
ppv = (T*)pv;
}
else
{
ppv = null;
}
return hr;
}
internal struct Vtbl
{
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT> GetWindow_4;
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> ContextSensitiveHelp_5;
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT> GetBorder_6;
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT> RequestBorderSpace_7;
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT> SetBorderSpace_8;
internal delegate *unmanaged [Stdcall]<IOleInPlaceUIWindow*,winmdroot.System.Ole.IOleInPlaceActiveObject* ,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetActiveObject_9;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->GetWindow_4 = &GetWindow;
vtable->ContextSensitiveHelp_5 = &ContextSensitiveHelp;
vtable->GetBorder_6 = &GetBorder;
vtable->RequestBorderSpace_7 = &RequestBorderSpace;
vtable->SetBorderSpace_8 = &SetBorderSpace;
vtable->SetActiveObject_9 = &SetActiveObject;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{00000115-0000-0000-c000-000000000046}</value>
internal static readonly Guid IID_Guid = new Guid(0x00000115, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x15,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("00000115-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
:winmdroot.System.Ole.IOleWindow.Interface {
[PreserveSig()]
unsafe new winmdroot.Foundation.HRESULT GetWindow(winmdroot.Foundation.HWND* phwnd);
[PreserveSig()]
new winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetBorder(winmdroot.Foundation.RECT* lprectBorder);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT RequestBorderSpace(winmdroot.Foundation.RECT* pborderwidths);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT SetBorderSpace(winmdroot.Foundation.RECT* pborderwidths);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT SetActiveObject(winmdroot.System.Ole.IOleInPlaceActiveObject* pActiveObject, winmdroot.Foundation.PCWSTR pszObjName);
}
}
}
}
|