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
impl Window
Sourcepub fn new_msg_only(class: &WindowClass<'_>) -> Result<Self>
pub fn new_msg_only(class: &WindowClass<'_>) -> Result<Self>
Creates a message-only window.
See https://learn.microsoft.com/en-us/windows/win32/winmsg/window-features#message-only-windows.
Sourcepub fn new_invisible(class: &WindowClass<'_>) -> Result<Self>
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"))
.
Sourcepub 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>
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.
pub fn hwnd(&self) -> HWND
Sourcepub fn is_valid(&self) -> bool
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§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more