Skip to content

Commit

Permalink
HWND::is_null
Browse files Browse the repository at this point in the history
I vaguely dislike this, but I dislike fixing `hwnd` examples even more.
  • Loading branch information
MaulingMonkey committed Jan 10, 2024
1 parent 27bc172 commit ef6a685
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/values/hwnd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ impl From<Option<NonNullHWND>> for HWND { fn from(hwnd: Option<NonNullHWND>) ->
/// (including disabled, invisible, overlapped, and pop-up windows &mdash; *not* including *child* windows.)
pub const BROADCAST : Self = Self::from_constant(0xFFFF);

/// `self == HWND::NULL`
#[inline(always)] pub fn is_null(self) -> bool { self == HWND::NULL }

#[inline(always)] pub(crate) fn from_isize (hwnd: isize ) -> Self { Self(hwnd as _) }
#[inline(always)] pub(crate) fn from_usize (hwnd: usize ) -> Self { Self(hwnd as _) }
#[inline(always)] pub(crate) fn from_ptr<T> (hwnd: *mut T ) -> Self { Self(hwnd as _) }
Expand Down

0 comments on commit ef6a685

Please sign in to comment.