<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.2.25163.9" />

HWND

using System; using System.CodeDom.Compiler; using System.Diagnostics; using System.Runtime.CompilerServices; namespace Windows.Win32.Foundation { [DebuggerDisplay("{Value}")] [GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")] internal readonly struct HWND : IHandle<HWND>, IEquatable<HWND> { internal unsafe readonly void* Value; internal static readonly HWND HWND_BROADCAST = (HWND)(IntPtr)65535; internal static readonly HWND HWND_MESSAGE = (HWND)(IntPtr)(-3); internal static readonly HWND HWND_DESKTOP = (HWND)(IntPtr)0; internal static readonly HWND HWND_TOP = (HWND)(IntPtr)0; internal static readonly HWND HWND_BOTTOM = (HWND)(IntPtr)1; internal static readonly HWND HWND_TOPMOST = (HWND)(IntPtr)(-1); internal static readonly HWND HWND_NOTOPMOST = (HWND)(IntPtr)(-2); HWND IHandle<HWND>.Handle { get { return this; } } [Nullable(2)] object IHandle<HWND>.Wrapper { [NullableContext(2)] get { return null; } } internal static HWND Null => default(HWND); internal unsafe bool IsNull => Value == null; internal unsafe HWND(void* value) { Value = value; } internal unsafe HWND(IntPtr value) { this = new HWND((void*)(long)value); } public unsafe static implicit operator void*(HWND value) { return value.Value; } public unsafe static explicit operator HWND(void* value) { return new HWND(value); } public unsafe static bool operator ==(HWND left, HWND right) { return left.Value == right.Value; } public static bool operator !=(HWND left, HWND right) { return !(left == right); } public unsafe bool Equals(HWND other) { return Value == other.Value; } public override bool Equals(object obj) { if (obj is HWND) { HWND other = (HWND)obj; return Equals(other); } return false; } public unsafe override int GetHashCode() { return (int)Value; } public unsafe override string ToString() { DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 1); defaultInterpolatedStringHandler.AppendLiteral("0x"); defaultInterpolatedStringHandler.AppendFormatted((UIntPtr)Value, "x"); return defaultInterpolatedStringHandler.ToStringAndClear(); } public unsafe static implicit operator IntPtr(HWND value) { return new IntPtr(value.Value); } public unsafe static explicit operator HWND(IntPtr value) { return new HWND(value.ToPointer()); } public unsafe static explicit operator HWND(UIntPtr value) { return new HWND(value.ToPointer()); } public unsafe static implicit operator HANDLE(HWND value) { return new HANDLE(value.Value); } } }