|
// ------------------------------------------------------------------------------
// <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 UI.Shell
{
[Guid("DE5BF786-477A-11D2-839D-00C04FD918D0")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IDragSourceHelper
:IVTable<IDragSourceHelper,IDragSourceHelper.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]<IDragSourceHelper*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IDragSourceHelper*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IDragSourceHelper*,uint>)lpVtbl[1])((IDragSourceHelper*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IDragSourceHelper*,uint>)lpVtbl[2])((IDragSourceHelper*)Unsafe.AsPointer(ref this));
}
/// <inheritdoc cref="InitializeFromBitmap(winmdroot.UI.Shell.SHDRAGIMAGE*, winmdroot.System.Com.IDataObject*)"/>
internal unsafe winmdroot.Foundation.HRESULT InitializeFromBitmap(in winmdroot.UI.Shell.SHDRAGIMAGE pshdi, winmdroot.System.Com.IDataObject* pDataObject)
{
fixed (winmdroot.UI.Shell.SHDRAGIMAGE* pshdiLocal = &pshdi)
{
winmdroot.Foundation.HRESULT __result = this.InitializeFromBitmap(pshdiLocal, pDataObject);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT InitializeFromBitmap(IDragSourceHelper* pThis, winmdroot.UI.Shell.SHDRAGIMAGE* pshdi, winmdroot.System.Com.IDataObject* pDataObject)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.InitializeFromBitmap(pshdi, pDataObject);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Initializes the drag-image manager for a windowless control.</summary>
/// <param name="pshdi">
/// <para>Type: <b>LPSHDRAGIMAGE</b> The <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/ns-shobjidl_core-shdragimage">SHDRAGIMAGE</a> structure that contains information about the bitmap.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefrombitmap#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="pDataObject">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a>*</b> A pointer to the data object's <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a> interface.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefrombitmap#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para>
/// </returns>
/// <remarks>Because <b>InitializeFromBitmap</b> always performs the RGB multiplication step in calculating the alpha value, you should always pass a bitmap without premultiplied alpha blending. Note that no error will result from passing the method a bitmap with premultiplied alpha blending, but this method will multiply it again, doubling the resulting alpha value.</remarks>
public unsafe winmdroot.Foundation.HRESULT InitializeFromBitmap(winmdroot.UI.Shell.SHDRAGIMAGE* pshdi, winmdroot.System.Com.IDataObject* pDataObject)
{
return ((delegate *unmanaged [Stdcall]<IDragSourceHelper*,winmdroot.UI.Shell.SHDRAGIMAGE* ,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IDragSourceHelper*)Unsafe.AsPointer(ref this), pshdi, pDataObject);
}
/// <inheritdoc cref="InitializeFromWindow(winmdroot.Foundation.HWND, global::System.Drawing.Point*, winmdroot.System.Com.IDataObject*)"/>
internal unsafe winmdroot.Foundation.HRESULT InitializeFromWindow(winmdroot.Foundation.HWND hwnd, global::System.Drawing.Point? ppt, winmdroot.System.Com.IDataObject* pDataObject)
{
global::System.Drawing.Point pptLocal = ppt ?? default(global::System.Drawing.Point);
winmdroot.Foundation.HRESULT __result = this.InitializeFromWindow(hwnd, ppt.HasValue ? &pptLocal : null, pDataObject);
return __result;
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT InitializeFromWindow(IDragSourceHelper* pThis, winmdroot.Foundation.HWND hwnd, [Optional] global::System.Drawing.Point* ppt, winmdroot.System.Com.IDataObject* pDataObject)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.InitializeFromWindow(hwnd, ppt, pDataObject);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Initializes the drag-image manager for a control with a window.</summary>
/// <param name="hwnd">
/// <para>Type: <b>HWND</b> A handle to the window that receives the <b>DI_GETDRAGIMAGE</b> message. This value can be <b>NULL</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefromwindow#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="ppt">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/win32/api/windef/ns-windef-point">POINT</a>*</b> A pointer to a <a href="https://docs.microsoft.com/windows/win32/api/windef/ns-windef-point">POINT</a> structure that specifies the location of the cursor within the drag image. The structure should contain the offset from the upper-left corner of the drag image to the location of the cursor. This value can be <b>NULL</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefromwindow#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="pDataObject">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a>*</b> A pointer to the data object's <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a> interface.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefromwindow#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para>
/// </returns>
/// <remarks>The <b>DI_GETDRAGIMAGE</b> message allows you to source a drag image from a custom control. It is defined in Shlobj.h and must be registered with <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-registerwindowmessagea">RegisterWindowMessage</a>. When the window specified by <i>hwnd</i> receives the <b>DI_GETDRAGIMAGE</b> message, the <i>lParam</i> value holds a pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/ns-shobjidl_core-shdragimage">SHDRAGIMAGE</a> structure. The handler should fill the structure with the drag image bitmap information.</remarks>
public unsafe winmdroot.Foundation.HRESULT InitializeFromWindow(winmdroot.Foundation.HWND hwnd, [Optional] global::System.Drawing.Point* ppt, winmdroot.System.Com.IDataObject* pDataObject)
{
return ((delegate *unmanaged [Stdcall]<IDragSourceHelper*,winmdroot.Foundation.HWND ,global::System.Drawing.Point* ,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IDragSourceHelper*)Unsafe.AsPointer(ref this), hwnd, ppt, pDataObject);
}
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]<IDragSourceHelper*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IDragSourceHelper*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IDragSourceHelper*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IDragSourceHelper*,winmdroot.UI.Shell.SHDRAGIMAGE* ,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.HRESULT> InitializeFromBitmap_4;
internal delegate *unmanaged [Stdcall]<IDragSourceHelper*,winmdroot.Foundation.HWND ,global::System.Drawing.Point* ,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.HRESULT> InitializeFromWindow_5;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->InitializeFromBitmap_4 = &InitializeFromBitmap;
vtable->InitializeFromWindow_5 = &InitializeFromWindow;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{de5bf786-477a-11d2-839d-00c04fd918d0}</value>
internal static readonly Guid IID_Guid = new Guid(0xDE5BF786, 0x477A, 0x11D2, 0x83, 0x9D, 0x00, 0xC0, 0x4F, 0xD9, 0x18, 0xD0);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x86,0xF7,0x5B,0xDE,0x7A,0x47,0xD2,0x11,0x83,0x9D,0x00,0xC0,0x4F,0xD9,0x18,0xD0 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("DE5BF786-477A-11D2-839D-00C04FD918D0"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT InitializeFromBitmap(winmdroot.UI.Shell.SHDRAGIMAGE* pshdi, winmdroot.System.Com.IDataObject* pDataObject);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT InitializeFromWindow(winmdroot.Foundation.HWND hwnd, [Optional] global::System.Drawing.Point* ppt, winmdroot.System.Com.IDataObject* pDataObject);
}
}
}
}
|