public override bool Equals(object obj) { if (Object.ReferenceEquals(obj, null)) { return handle == IntPtr.Zero; } else { HWND other = obj as HWND; return other != null && Equals(other); } }