File: Windows.Win32.IOleInPlaceObjectWindowless.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("1C2056CC-5EF4-101B-8BC8-00AA003E3B29")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IOleInPlaceObjectWindowless
			:IVTable<IOleInPlaceObjectWindowless,IOleInPlaceObjectWindowless.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]<IOleInPlaceObjectWindowless*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleInPlaceObjectWindowless*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

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

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

			public void InPlaceDeactivate()
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleInPlaceObjectWindowless*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

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

			public void UIDeactivate()
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleInPlaceObjectWindowless*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			/// <inheritdoc cref="SetObjectRects(winmdroot.Foundation.RECT*, winmdroot.Foundation.RECT*)"/>
			internal unsafe void SetObjectRects(in winmdroot.Foundation.RECT lprcPosRect, in winmdroot.Foundation.RECT lprcClipRect)
			{
				fixed (winmdroot.Foundation.RECT* lprcClipRectLocal = &lprcClipRect)
				{
					fixed (winmdroot.Foundation.RECT* lprcPosRectLocal = &lprcPosRect)
					{
						this.SetObjectRects(lprcPosRectLocal, lprcClipRectLocal);
					}
				}
			}

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

			public unsafe void SetObjectRects(winmdroot.Foundation.RECT* lprcPosRect, winmdroot.Foundation.RECT* lprcClipRect)
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleInPlaceObjectWindowless*)Unsafe.AsPointer(ref this), lprcPosRect, lprcClipRect).ThrowOnFailure();
			}

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

			public void ReactivateAndUndo()
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleInPlaceObjectWindowless*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			/// <inheritdoc cref="OnWindowMessage(uint, winmdroot.Foundation.WPARAM, winmdroot.Foundation.LPARAM, winmdroot.Foundation.LRESULT*)"/>
			internal unsafe void OnWindowMessage(uint msg, winmdroot.Foundation.WPARAM wParam, winmdroot.Foundation.LPARAM lParam, out winmdroot.Foundation.LRESULT plResult)
			{
				fixed (winmdroot.Foundation.LRESULT* plResultLocal = &plResult)
				{
					this.OnWindowMessage(msg, wParam, lParam, plResultLocal);
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT OnWindowMessage(IOleInPlaceObjectWindowless* pThis, uint msg, winmdroot.Foundation.WPARAM wParam, winmdroot.Foundation.LPARAM lParam, winmdroot.Foundation.LRESULT* plResult)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.OnWindowMessage(msg, wParam, lParam, plResult);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Dispatches a message from a container to a windowless object that is in-place active.</summary>
			/// <param name="msg">The identifier for the window message provided to the container by Windows.</param>
			/// <param name="wParam">A parameter for the window message provided to the container by Windows.</param>
			/// <param name="lParam">A parameter for the window message provided to the container by Windows.</param>
			/// <param name="plResult">A pointer to result code for the window message.</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>A container calls this method to send window messages to a windowless object that is in-place active. The container should dispatch messages according to the following guidelines: For the following messages, the container should first dispatch the message to the windowless object that has captured the mouse, if any. Otherwise, the container should dispatch the message to the windowless object under the mouse cursor. If there is no such object, the container is free to process the following messages for itself: </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleinplaceobjectwindowless-onwindowmessage#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void OnWindowMessage(uint msg, winmdroot.Foundation.WPARAM wParam, winmdroot.Foundation.LPARAM lParam, winmdroot.Foundation.LRESULT* plResult)
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,uint ,winmdroot.Foundation.WPARAM ,winmdroot.Foundation.LPARAM ,winmdroot.Foundation.LRESULT* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IOleInPlaceObjectWindowless*)Unsafe.AsPointer(ref this), msg, wParam, lParam, plResult).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetDropTarget(IOleInPlaceObjectWindowless* pThis, winmdroot.System.Ole.IDropTarget** ppDropTarget)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetDropTarget(ppDropTarget);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the IDropTarget interface for an in-place active, windowless object that supports drag and drop.</summary>
			/// <param name="ppDropTarget">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-idroptarget">IDropTarget</a> pointer variable that receives the interface pointer to the windowless object.</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>A windowed object registers its <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-idroptarget">IDropTarget</a> interface by calling the <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-registerdragdrop">RegisterDragDrop</a> function and supplying its window handle as a parameter. Registering its <b>IDropTarget</b> interface enables the object to participate in drag and drop operations. Because it does not have a window when active, a windowless object cannot register its <b>IDropTarget</b> interface. Therefore, it cannot directly participate in drag and drop operations without support from its container. The following events occur during a drag and drop operation involving windowless objects: </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleinplaceobjectwindowless-getdroptarget#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void GetDropTarget(winmdroot.System.Ole.IDropTarget** ppDropTarget)
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.System.Ole.IDropTarget** ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IOleInPlaceObjectWindowless*)Unsafe.AsPointer(ref this), ppDropTarget).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]<IOleInPlaceObjectWindowless*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

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

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

				internal delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.Foundation.HRESULT> InPlaceDeactivate_6;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.Foundation.HRESULT> UIDeactivate_7;

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

				internal delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.Foundation.HRESULT> ReactivateAndUndo_9;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,uint ,winmdroot.Foundation.WPARAM ,winmdroot.Foundation.LPARAM ,winmdroot.Foundation.LRESULT* ,winmdroot.Foundation.HRESULT> OnWindowMessage_10;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceObjectWindowless*,winmdroot.System.Ole.IDropTarget** ,winmdroot.Foundation.HRESULT> GetDropTarget_11;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetWindow_4 = &GetWindow;
				vtable->ContextSensitiveHelp_5 = &ContextSensitiveHelp;
				vtable->InPlaceDeactivate_6 = &InPlaceDeactivate;
				vtable->UIDeactivate_7 = &UIDeactivate;
				vtable->SetObjectRects_8 = &SetObjectRects;
				vtable->ReactivateAndUndo_9 = &ReactivateAndUndo;
				vtable->OnWindowMessage_10 = &OnWindowMessage;
				vtable->GetDropTarget_11 = &GetDropTarget;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{1c2056cc-5ef4-101b-8bc8-00aa003e3b29}</value>
			internal static readonly Guid IID_Guid = new Guid(0x1C2056CC, 0x5EF4, 0x101B, 0x8B, 0xC8, 0x00, 0xAA, 0x00, 0x3E, 0x3B, 0x29);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xCC,0x56,0x20,0x1C,0xF4,0x5E,0x1B,0x10,0x8B,0xC8,0x00,0xAA,0x00,0x3E,0x3B,0x29					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("1C2056CC-5EF4-101B-8BC8-00AA003E3B29"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
				:winmdroot.System.Ole.IOleWindow.Interface,winmdroot.System.Ole.IOleInPlaceObject.Interface			{
				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT GetWindow(winmdroot.Foundation.HWND* phwnd);

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

				[PreserveSig()]
				new winmdroot.Foundation.HRESULT InPlaceDeactivate();

				[PreserveSig()]
				new winmdroot.Foundation.HRESULT UIDeactivate();

				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT SetObjectRects(winmdroot.Foundation.RECT* lprcPosRect, winmdroot.Foundation.RECT* lprcClipRect);

				[PreserveSig()]
				new winmdroot.Foundation.HRESULT ReactivateAndUndo();

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT OnWindowMessage(uint msg, winmdroot.Foundation.WPARAM wParam, winmdroot.Foundation.LPARAM lParam, winmdroot.Foundation.LRESULT* plResult);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetDropTarget(winmdroot.System.Ole.IDropTarget** ppDropTarget);
			}
		}
	}
}