File: Windows.Win32.IOleInPlaceFrame.g.cs
Project: src\src\System.Windows.Forms.Primitives\src\System.Windows.Forms.Primitives.csproj (System.Windows.Forms.Primitives)
// ------------------------------------------------------------------------------
// <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("00000116-0000-0000-C000-000000000046")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IOleInPlaceFrame
			:IVTable<IOleInPlaceFrame,IOleInPlaceFrame.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]<IOleInPlaceFrame*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

			public uint AddRef()
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,uint>)lpVtbl[1])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this));
			}

			public uint Release()
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,uint>)lpVtbl[2])((IOleInPlaceFrame*)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(IOleInPlaceFrame* 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]<IOleInPlaceFrame*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), phwnd);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT ContextSensitiveHelp(IOleInPlaceFrame* 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]<IOleInPlaceFrame*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleInPlaceFrame*)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(IOleInPlaceFrame* 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;
				}
			}

			public unsafe winmdroot.Foundation.HRESULT GetBorder(winmdroot.Foundation.RECT* lprectBorder)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleInPlaceFrame*)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(IOleInPlaceFrame* 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;
				}
			}

			public unsafe winmdroot.Foundation.HRESULT RequestBorderSpace(winmdroot.Foundation.RECT* pborderwidths)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleInPlaceFrame*)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(IOleInPlaceFrame* 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;
				}
			}

			public unsafe winmdroot.Foundation.HRESULT SetBorderSpace(winmdroot.Foundation.RECT* pborderwidths)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleInPlaceFrame*)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(IOleInPlaceFrame* 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;
				}
			}

			public unsafe winmdroot.Foundation.HRESULT SetActiveObject(winmdroot.System.Ole.IOleInPlaceActiveObject* pActiveObject, winmdroot.Foundation.PCWSTR pszObjName)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.System.Ole.IOleInPlaceActiveObject* ,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), pActiveObject, pszObjName);
			}

			/// <inheritdoc cref="InsertMenus(winmdroot.UI.WindowsAndMessaging.HMENU, winmdroot.System.Ole.OLEMENUGROUPWIDTHS*)"/>
			internal unsafe winmdroot.Foundation.HRESULT InsertMenus(winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared, ref winmdroot.System.Ole.OLEMENUGROUPWIDTHS lpMenuWidths)
			{
				fixed (winmdroot.System.Ole.OLEMENUGROUPWIDTHS* lpMenuWidthsLocal = &lpMenuWidths)
				{
					winmdroot.Foundation.HRESULT __result = this.InsertMenus(hmenuShared, lpMenuWidthsLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT InsertMenus(IOleInPlaceFrame* pThis, winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared, winmdroot.System.Ole.OLEMENUGROUPWIDTHS* lpMenuWidths)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.InsertMenus(hmenuShared, lpMenuWidths);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Enables the container to insert menu groups into the composite menu to be used during the in-place session.</summary>
			/// <param name="hmenuShared">A handle to an empty menu.</param>
			/// <param name="lpMenuWidths">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ns-oleidl-olemenugroupwidths">OLEMENUGROUPWIDTHS</a> array with six elements. The container fills in elements 0, 2, and 4 to reflect the number of menu elements it provided in the <b>File</b>, <b>View</b>, and <b>Window</b> menu groups.</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> This method is called by object applications when they are first being activated. They call it to insert their menus into the frame-level user interface. The object application asks the container to add its menus to the menu specified in <i>hmenuShared</i> and to set the group counts in the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ns-oleidl-olemenugroupwidths">OLEMENUGROUPWIDTHS</a> array pointed to by <i>lpMenuWidths</i>. The object application then adds its own menus and counts. Objects can call <b>IOleInPlaceFrame::InsertMenus</b> as many times as necessary to build up the composite menus. The container should use the initial menu handle associated with the composite menu for all menu items in the drop-down menus.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceframe-insertmenus#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT InsertMenus(winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared, winmdroot.System.Ole.OLEMENUGROUPWIDTHS* lpMenuWidths)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.UI.WindowsAndMessaging.HMENU ,winmdroot.System.Ole.OLEMENUGROUPWIDTHS* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), hmenuShared, lpMenuWidths);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetMenu(IOleInPlaceFrame* pThis, winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared, nint holemenu, winmdroot.Foundation.HWND hwndActiveObject)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetMenu(hmenuShared, holemenu, hwndActiveObject);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Adds a composite menu to the window frame containing the object being activated in place.</summary>
			/// <param name="hmenuShared">A handle to the composite menu constructed by calls to <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceframe-insertmenus">IOleInPlaceFrame::InsertMenus</a> and the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-insertmenua">InsertMenu</a> function.</param>
			/// <param name="holemenu">A handle to the menu descriptor returned by the <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-olecreatemenudescriptor">OleCreateMenuDescriptor</a> function.</param>
			/// <param name="hwndActiveObject">A handle to a window owned by the object and to which menu messages, commands, and accelerators are to be sent.</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 object calls <b>IOleInPlaceFrame::SetMenu</b> to ask the container to install the composite menu structure set up by calls to <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceframe-insertmenus">IOleInPlaceFrame::InsertMenus</a>. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> An SDI container's implementation of this method should call the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-setmenu">SetMenu</a> function. An MDI container should send a <a href="https://docs.microsoft.com/windows/desktop/winmsg/wm-mdisetmenu">WM_MDISETMENU</a> message, using <i>hmenuShared</i> as the menu to install. The container should call <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-olesetmenudescriptor">OleSetMenuDescriptor</a> to install the OLE dispatching code. When deactivating, the container must call <b>IOleInPlaceFrame::SetMenu</b>, specifying <b>NULL</b> to remove the shared menu. This is done to help minimize window repaints. The container should also call <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-olesetmenudescriptor">OleSetMenuDescriptor</a>, specifying <b>NULL</b> to unhook the dispatching code. Finally, the object application calls <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-oledestroymenudescriptor">OleDestroyMenuDescriptor</a> to free the data structure. <div class="alert"><b>Note</b>  While executing <b>IOleInPlaceFrame::SetMenu</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>IOleInPlaceFrame::SetMenu</b>.</div> <div> </div></para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceframe-setmenu#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT SetMenu(winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared, nint holemenu, winmdroot.Foundation.HWND hwndActiveObject)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.UI.WindowsAndMessaging.HMENU ,nint ,winmdroot.Foundation.HWND ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), hmenuShared, holemenu, hwndActiveObject);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT RemoveMenus(IOleInPlaceFrame* pThis, winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.RemoveMenus(hmenuShared);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Removes a container's menu elements from the composite menu.</summary>
			/// <param name="hmenuShared">A handle to the in-place composite menu that was constructed by calls to <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceframe-insertmenus">IOleInPlaceFrame::InsertMenus</a> and the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-insertmenua">InsertMenu</a> function.</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 should always give the container a chance to remove its menu elements from the composite menu before deactivating the shared user interface. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> This method is called by the object application while it is being UI-deactivated to remove its menus.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceframe-removemenus#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT RemoveMenus(winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.UI.WindowsAndMessaging.HMENU ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), hmenuShared);
			}

			/// <inheritdoc cref="SetStatusText(winmdroot.Foundation.PCWSTR)"/>
			internal unsafe winmdroot.Foundation.HRESULT SetStatusText(string pszStatusText)
			{
				fixed (char* pszStatusTextLocal = pszStatusText)
				{
					winmdroot.Foundation.HRESULT __result = this.SetStatusText(pszStatusTextLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetStatusText(IOleInPlaceFrame* pThis, winmdroot.Foundation.PCWSTR pszStatusText)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetStatusText(pszStatusText);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Sets and displays status text about the in-place object in the container's frame window status line.</summary>
			/// <param name="pszStatusText">The message to be displayed.</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> You should call <b>IOleInPlaceFrame::SetStatusText</b> when you need to ask the container to display object text in its frame's status line, if it has one. Because the container's frame window owns the status line, calling <b>IOleInPlaceFrame::SetStatusText</b> is the only way an object can display status information in the container's frame window. If the container refuses the object's request, the object application can, however, negotiate for border space to display its own status window. When switching between menus owned by the container and the in-place active object, the status bar text is not reflected properly if the object does not call the container's <b>IOleInPlaceFrame::SetStatusText</b> method. For example, if, during an in-place session, the user were to select the <b>File</b> menu, the status bar would reflect the action that would occur if the user selected this menu. If the user then selects the <b>Edit</b> menu (which is owned by the in-place object), the status bar text would not change unless the <b>IOleInPlaceFrame::SetStatusText</b> happened to be called. This is because there is no way for the container to recognize that one of the object's menus has been made active because all the messages that the container would trap are now going to the object. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> To avoid potential problems, all objects being activated in place should process the <a href="https://docs.microsoft.com/windows/desktop/menurc/wm-menuselect">WM_MENUSELECT</a> message and call <b>IOleInPlaceFrame::SetStatusText</b>, even if the object does not usually provide status information (in which case the object can just pass a <b>NULL</b> string for the requested status text). <div class="alert"><b>Note</b>  While executing <b>IOleInPlaceFrame::SetStatusText</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 <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceuiwindow-getborder">IOleInPlaceUIWindow::GetBorder</a>.</div> <div> </div></para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceframe-setstatustext#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT SetStatusText(winmdroot.Foundation.PCWSTR pszStatusText)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[12])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), pszStatusText);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT EnableModeless(IOleInPlaceFrame* 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 a frame's modeless dialog boxes.</summary>
			/// <param name="fEnable">Specifies whether the modeless dialog box windows are to be enabled (<b>TRUE</b>) or disabled (<b>FALSE</b>).</param>
			/// <returns>This method returns S_OK if the dialog box was either enabled or disabled successfully, depending on the value for <i>fEnable</i>.</returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceframe-enablemodeless">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT EnableModeless(winmdroot.Foundation.BOOL fEnable)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[13])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), fEnable);
			}

			/// <inheritdoc cref="TranslateAccelerator(winmdroot.UI.WindowsAndMessaging.MSG*, ushort)"/>
			internal unsafe winmdroot.Foundation.HRESULT TranslateAccelerator(in winmdroot.UI.WindowsAndMessaging.MSG lpmsg, ushort wID)
			{
				fixed (winmdroot.UI.WindowsAndMessaging.MSG* lpmsgLocal = &lpmsg)
				{
					winmdroot.Foundation.HRESULT __result = this.TranslateAccelerator(lpmsgLocal, wID);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT TranslateAccelerator(IOleInPlaceFrame* pThis, winmdroot.UI.WindowsAndMessaging.MSG* lpmsg, ushort wID)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.TranslateAccelerator(lpmsg, wID);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Translates accelerator keystrokes intended for the container's frame while an object is active in place.</summary>
			/// <param name="lpmsg">A pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/ns-winuser-msg">MSG</a> structure that contains the keystroke message.</param>
			/// <param name="wID">The command identifier value corresponding to the keystroke in the container-provided accelerator table. Containers should use this value instead of translating again.</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>IOleInPlaceFrame::TranslateAccelerator</b> method is called indirectly by <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-oletranslateaccelerator">OleTranslateAccelerator</a> when a keystroke accelerator intended for the container (frame) is received. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> The container application should perform its usual accelerator processing, or use <i>wID</i> directly, and then return, indicating whether the keystroke accelerator was processed. If the container is an MDI application and the <a href="https://docs.microsoft.com/windows/desktop/DirectShow/cbasepropertypage-translateaccelerator">TranslateAccelerator</a> function fails, the container can call the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-translatemdisysaccel">TranslateMDISysAccel</a> function, just as it does for its usual message processing. In-place objects should be given first chance at translating accelerator messages. However, because objects implemented by DLL object applications do not have their own message pump, they receive their messages from the container's message queue. To ensure that the object has first chance at translating messages, a container should always call <b>IOleInPlaceFrame::TranslateAccelerator</b> before doing its own accelerator translation. Conversely, an executable object application should call <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-oletranslateaccelerator">OleTranslateAccelerator</a> after calling <a href="https://docs.microsoft.com/windows/desktop/DirectShow/cbasepropertypage-translateaccelerator">TranslateAccelerator</a>, calling <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-translatemessage">TranslateMessage</a> and <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-dispatchmessage">DispatchMessage</a> only if both translation functions fail. You should define accelerator tables for containers so they will work properly with object applications that do their own accelerator keystroke translations. Tables should be defined as follows.</para>
			/// <para></para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplaceframe-translateaccelerator#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT TranslateAccelerator(winmdroot.UI.WindowsAndMessaging.MSG* lpmsg, ushort wID)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.UI.WindowsAndMessaging.MSG* ,ushort ,winmdroot.Foundation.HRESULT>)lpVtbl[14])((IOleInPlaceFrame*)Unsafe.AsPointer(ref this), lpmsg, wID);
			}

			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]<IOleInPlaceFrame*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,uint> AddRef_2;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,uint> Release_3;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT> GetWindow_4;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> ContextSensitiveHelp_5;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT> GetBorder_6;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT> RequestBorderSpace_7;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT> SetBorderSpace_8;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.System.Ole.IOleInPlaceActiveObject* ,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetActiveObject_9;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.UI.WindowsAndMessaging.HMENU ,winmdroot.System.Ole.OLEMENUGROUPWIDTHS* ,winmdroot.Foundation.HRESULT> InsertMenus_10;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.UI.WindowsAndMessaging.HMENU ,nint ,winmdroot.Foundation.HWND ,winmdroot.Foundation.HRESULT> SetMenu_11;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.UI.WindowsAndMessaging.HMENU ,winmdroot.Foundation.HRESULT> RemoveMenus_12;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetStatusText_13;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> EnableModeless_14;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceFrame*,winmdroot.UI.WindowsAndMessaging.MSG* ,ushort ,winmdroot.Foundation.HRESULT> TranslateAccelerator_15;
			} 
			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;
				vtable->InsertMenus_10 = &InsertMenus;
				vtable->SetMenu_11 = &SetMenu;
				vtable->RemoveMenus_12 = &RemoveMenus;
				vtable->SetStatusText_13 = &SetStatusText;
				vtable->EnableModeless_14 = &EnableModeless;
				vtable->TranslateAccelerator_15 = &TranslateAccelerator;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{00000116-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x00000116, 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[]					{
0x16,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("00000116-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
				:winmdroot.System.Ole.IOleWindow.Interface,winmdroot.System.Ole.IOleInPlaceUIWindow.Interface			{
				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT GetWindow(winmdroot.Foundation.HWND* phwnd);

				[PreserveSig()]
				new winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode);

				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT GetBorder(winmdroot.Foundation.RECT* lprectBorder);

				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT RequestBorderSpace(winmdroot.Foundation.RECT* pborderwidths);

				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT SetBorderSpace(winmdroot.Foundation.RECT* pborderwidths);

				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT SetActiveObject(winmdroot.System.Ole.IOleInPlaceActiveObject* pActiveObject, winmdroot.Foundation.PCWSTR pszObjName);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT InsertMenus(winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared, winmdroot.System.Ole.OLEMENUGROUPWIDTHS* lpMenuWidths);

								[PreserveSig()]
winmdroot.Foundation.HRESULT SetMenu(winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared, nint holemenu, winmdroot.Foundation.HWND hwndActiveObject);

								[PreserveSig()]
winmdroot.Foundation.HRESULT RemoveMenus(winmdroot.UI.WindowsAndMessaging.HMENU hmenuShared);

								[PreserveSig()]
winmdroot.Foundation.HRESULT SetStatusText(winmdroot.Foundation.PCWSTR pszStatusText);

								[PreserveSig()]
winmdroot.Foundation.HRESULT EnableModeless(winmdroot.Foundation.BOOL fEnable);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT TranslateAccelerator(winmdroot.UI.WindowsAndMessaging.MSG* lpmsg, ushort wID);
			}
		}
	}
}