Struct Window

Source
pub struct Window { /* private fields */ }
Expand description

A window created with a WindowClass.

The first calls of the window procedure are made during the constructor call; then during the message loop.

Implementations§

Source§

impl Window

Source

pub fn new_msg_only(class: &WindowClass<'_>) -> Result<Self>

Source

pub fn new_invisible(class: &WindowClass<'_>) -> Result<Self>

Meant for windows that stay invisible. Necessary instead of a message-only window, if you want to receive broadcast messages like WM_ENDSESSION or RegisterWindowMessageW(w!("TaskbarCreated")).

Source

pub fn with_details( class: &WindowClass<'_>, parent: Option<HWND>, style: WINDOW_STYLE, ex_style: Option<WINDOW_EX_STYLE>, placement: Option<(POINT, SIZE)>, text: Option<PCWSTR>, menu: Option<HMENU>, ) -> Result<Self>

Creates a window with CreateWindowExW().

None for placement uses CW_USEDEFAULT for all four values.

Source

pub fn hwnd(&self) -> HWND

Source

pub fn is_valid(&self) -> bool

Returns whether the associated HWND is still valid.

It isn’t valid anymore, if DestroyWindow() was called.

Trait Implementations§

Source§

impl Drop for Window

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Window

§

impl RefUnwindSafe for Window

§

impl !Send for Window

§

impl !Sync for Window

§

impl Unpin for Window

§

impl UnwindSafe for Window

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MapSelf for T

Source§

fn map_self<O, T>(self, op: O) -> T
where O: FnOnce(Self) -> T, Self: Sized,

Example: Read more
Source§

fn map_self_or_keep<O>(self, op: O) -> Self
where O: FnOnce(&Self) -> Option<Self>, Self: Sized,

Example: Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.