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.106+a37a0b4b70")]
internal readonly struct HWND : IHandle<HWND>, IEquatable<HWND>
{
internal readonly IntPtr 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 bool IsNull => Value == (IntPtr)0;
internal HWND(IntPtr value)
{
Value = value;
}
public static implicit operator IntPtr(HWND value)
{
return value.Value;
}
public static explicit operator HWND(IntPtr value)
{
return new HWND(value);
}
public static bool operator ==(HWND left, HWND right)
{
return left.Value == right.Value;
}
public static bool operator !=(HWND left, HWND right)
{
return !(left == right);
}
public 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 override int GetHashCode()
{
return Value.GetHashCode();
}
public override string ToString()
{
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(2, 1);
defaultInterpolatedStringHandler.AppendLiteral("0x");
defaultInterpolatedStringHandler.AppendFormatted(Value, "x");
return defaultInterpolatedStringHandler.ToStringAndClear();
}
public static implicit operator HANDLE(HWND value)
{
return new HANDLE(value.Value);
}
}
}