|
// ------------------------------------------------------------------------------
// <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("00000117-0000-0000-C000-000000000046")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IOleInPlaceActiveObject
:IVTable<IOleInPlaceActiveObject,IOleInPlaceActiveObject.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]<IOleInPlaceActiveObject*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,uint>)lpVtbl[1])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,uint>)lpVtbl[2])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this));
}
/// <inheritdoc cref="GetWindow(winmdroot.Foundation.HWND*)"/>
internal unsafe void GetWindow(out winmdroot.Foundation.HWND phwnd)
{
fixed (winmdroot.Foundation.HWND* phwndLocal = &phwnd)
{
this.GetWindow(phwndLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetWindow(IOleInPlaceActiveObject* 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 void GetWindow(winmdroot.Foundation.HWND* phwnd)
{
((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this), phwnd).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT ContextSensitiveHelp(IOleInPlaceActiveObject* 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 void ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode)
{
((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this), fEnterMode).ThrowOnFailure();
}
/// <inheritdoc cref="TranslateAccelerator(winmdroot.UI.WindowsAndMessaging.MSG*)"/>
internal unsafe winmdroot.Foundation.HRESULT TranslateAccelerator(winmdroot.UI.WindowsAndMessaging.MSG? lpmsg)
{
winmdroot.UI.WindowsAndMessaging.MSG lpmsgLocal = lpmsg ?? default(winmdroot.UI.WindowsAndMessaging.MSG);
winmdroot.Foundation.HRESULT __result = this.TranslateAccelerator(lpmsg.HasValue ? &lpmsgLocal : null);
return __result;
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT TranslateAccelerator(IOleInPlaceActiveObject* pThis, [Optional] winmdroot.UI.WindowsAndMessaging.MSG* lpmsg)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.TranslateAccelerator(lpmsg);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Processes menu accelerator-key messages from the container's message queue. This method should only be used for objects created by a DLL object application.</summary>
/// <param name="lpmsg">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/winuser/ns-winuser-msg">MSG</a> structure for the message that might need to be translated.</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> Active in-place objects must always be given the first chance at translating accelerator keystrokes. You can provide this opportunity by calling <b>IOleInPlaceActiveObject::TranslateAccelerator</b> from your container's message loop before doing any other translation. You should apply your own translation only when this method returns S_FALSE. If you call <b>IOleInPlaceActiveObject::TranslateAccelerator</b> for an object that is not created by a DLL object application, the default object handler returns S_FALSE. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> An object created by an EXE object application gets keystrokes from its own message pump, so the container does not get those messages. If you need to implement this method, you can do so by simply wrapping the call to the <a href="https://docs.microsoft.com/windows/desktop/DirectShow/cbasepropertypage-translateaccelerator">TranslateAccelerator</a> function.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceactiveobject-translateaccelerator#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT TranslateAccelerator([Optional] winmdroot.UI.WindowsAndMessaging.MSG* lpmsg)
{
return ((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.UI.WindowsAndMessaging.MSG* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this), lpmsg);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT OnFrameWindowActivate(IOleInPlaceActiveObject* pThis, winmdroot.Foundation.BOOL fActivate)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.OnFrameWindowActivate(fActivate);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Notifies the object when the container's top-level frame window is activated or deactivated.</summary>
/// <param name="fActivate">The state of the container's top-level frame window. This parameter is <b>TRUE</b> if the window is activating and <b>FALSE</b> if it is deactivating.</param>
/// <returns>This method returns S_OK on success.</returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceactiveobject-onframewindowactivate">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public void OnFrameWindowActivate(winmdroot.Foundation.BOOL fActivate)
{
((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this), fActivate).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT OnDocWindowActivate(IOleInPlaceActiveObject* pThis, winmdroot.Foundation.BOOL fActivate)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.OnDocWindowActivate(fActivate);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Notifies the active in-place object when the container's document window is activated or deactivated.</summary>
/// <param name="fActivate">The state of the MDI child document window. If this parameter is <b>TRUE</b>, the window is in the act of activating; if it is <b>FALSE</b>, it is in the act of deactivating.</param>
/// <returns>This method returns S_OK on success.</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> Call <b>IOleInPlaceActiveObject::OnDocWindowActivate</b> when the MDI child document window is activated or deactivated and the object is currently the active object for the document. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> You should include code in this method that installs frame-level tools during object activation. These tools include the shared composite menu and/or optional toolbars and frame adornments. You should then take focus. When deactivating, the object should remove the frame-level tools. Note that if you do not call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceuiwindow-setborderspace">IOleInPlaceUIWindow::SetBorderSpace</a> with pborderwidths set to <b>NULL</b>, you can avoid having to renegotiate border space. While executing <b>IOleInPlaceActiveObject::OnDocWindowActivate</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>IOleInPlaceActiveObject::OnDocWindowActivate</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceactiveobject-ondocwindowactivate#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void OnDocWindowActivate(winmdroot.Foundation.BOOL fActivate)
{
((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this), fActivate).ThrowOnFailure();
}
/// <inheritdoc cref="ResizeBorder(winmdroot.Foundation.RECT*, winmdroot.System.Ole.IOleInPlaceUIWindow*, winmdroot.Foundation.BOOL)"/>
internal unsafe void ResizeBorder(in winmdroot.Foundation.RECT prcBorder, winmdroot.System.Ole.IOleInPlaceUIWindow* pUIWindow, winmdroot.Foundation.BOOL fFrameWindow)
{
fixed (winmdroot.Foundation.RECT* prcBorderLocal = &prcBorder)
{
this.ResizeBorder(prcBorderLocal, pUIWindow, fFrameWindow);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT ResizeBorder(IOleInPlaceActiveObject* pThis, winmdroot.Foundation.RECT* prcBorder, winmdroot.System.Ole.IOleInPlaceUIWindow* pUIWindow, winmdroot.Foundation.BOOL fFrameWindow)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.ResizeBorder(prcBorder, pUIWindow, fFrameWindow);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Alerts the object that it needs to resize its border space.</summary>
/// <param name="prcBorder">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/windef/ns-windef-rect">RECT</a> structure containing the new outer rectangle within which the object can request border space for its tools.</param>
/// <param name="pUIWindow">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceuiwindow">IOleInPlaceUIWindow</a> interface pointer for the frame or document window object whose border has changed.</param>
/// <param name="fFrameWindow">This parameter is <b>TRUE</b> if the frame window object is calling <b>IOleInPlaceActiveObject::ResizeBorder</b>; otherwise, it is <b>FALSE</b>.</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> <b>IOleInPlaceActiveObject::ResizeBorder</b> is called by the top-level container's document or frame window object when the border space allocated to the object should change. Because the active in-place object is not informed about which window has changed (the frame- or document-level window), <b>IOleInPlaceActiveObject::ResizeBorder</b> must be passed the pointer to the window's <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceuiwindow">IOleInPlaceUIWindow</a> interface.</para>
/// <para><h3><a id="Notes_to_Implemeters"></a><a id="notes_to_implemeters"></a><a id="NOTES_TO_IMPLEMETERS"></a>Notes to Implementers</h3> In most cases, resizing only requires that you grow, shrink, or scale your object's frame adornments. However, for more complicated adornments, you may be required to renegotiate for border space with calls to <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceuiwindow-setborderspace">IOleInPlaceUIWindow::SetBorderSpace</a> and <b>IOleInPlaceUIWindow::SetBorderSpace</b>. <div class="alert"><b>Note</b> While executing <b>IOleInPlaceActiveObject::ResizeBorder</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>IOleInPlaceActiveObject::ResizeBorder</b>.</div> <div> </div></para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceactiveobject-resizeborder#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void ResizeBorder(winmdroot.Foundation.RECT* prcBorder, winmdroot.System.Ole.IOleInPlaceUIWindow* pUIWindow, winmdroot.Foundation.BOOL fFrameWindow)
{
((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.RECT* ,winmdroot.System.Ole.IOleInPlaceUIWindow* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this), prcBorder, pUIWindow, fFrameWindow).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT EnableModeless(IOleInPlaceActiveObject* pThis, winmdroot.Foundation.BOOL fEnable)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.EnableModeless(fEnable);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Enables or disables modeless dialog boxes when the container creates or destroys a modal dialog box.</summary>
/// <param name="fEnable">Indicates whether to enable modeless dialog box windows (<b>TRUE</b>) or disable them <b>FALSE</b>.</param>
/// <returns>This method returns S_OK on success.</returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceactiveobject-enablemodeless">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public void EnableModeless(winmdroot.Foundation.BOOL fEnable)
{
((delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IOleInPlaceActiveObject*)Unsafe.AsPointer(ref this), fEnable).ThrowOnFailure();
}
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]<IOleInPlaceActiveObject*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT> GetWindow_4;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> ContextSensitiveHelp_5;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.UI.WindowsAndMessaging.MSG* ,winmdroot.Foundation.HRESULT> TranslateAccelerator_6;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> OnFrameWindowActivate_7;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> OnDocWindowActivate_8;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.RECT* ,winmdroot.System.Ole.IOleInPlaceUIWindow* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> ResizeBorder_9;
internal delegate *unmanaged [Stdcall]<IOleInPlaceActiveObject*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> EnableModeless_10;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->GetWindow_4 = &GetWindow;
vtable->ContextSensitiveHelp_5 = &ContextSensitiveHelp;
vtable->TranslateAccelerator_6 = &TranslateAccelerator;
vtable->OnFrameWindowActivate_7 = &OnFrameWindowActivate;
vtable->OnDocWindowActivate_8 = &OnDocWindowActivate;
vtable->ResizeBorder_9 = &ResizeBorder;
vtable->EnableModeless_10 = &EnableModeless;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{00000117-0000-0000-c000-000000000046}</value>
internal static readonly Guid IID_Guid = new Guid(0x00000117, 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[] {
0x17,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("00000117-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 TranslateAccelerator([Optional] winmdroot.UI.WindowsAndMessaging.MSG* lpmsg);
[PreserveSig()]
winmdroot.Foundation.HRESULT OnFrameWindowActivate(winmdroot.Foundation.BOOL fActivate);
[PreserveSig()]
winmdroot.Foundation.HRESULT OnDocWindowActivate(winmdroot.Foundation.BOOL fActivate);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT ResizeBorder(winmdroot.Foundation.RECT* prcBorder, winmdroot.System.Ole.IOleInPlaceUIWindow* pUIWindow, winmdroot.Foundation.BOOL fFrameWindow);
[PreserveSig()]
winmdroot.Foundation.HRESULT EnableModeless(winmdroot.Foundation.BOOL fEnable);
}
}
}
}
|