[][src]Struct windows_win::Window

pub struct Window { /* fields omitted */ }

Convenient wrapper over Window.

Note that while you can use it with any window. It makes no sense in taking ownership of not created by you windows.

This struct destroys window on drop and it is bad idea to do it for not your own window. If lucky, it fails but still not great idea.

Methods

impl Window[src]

pub fn from_hwnd(window: HWND) -> Self[src]

Creates new instance by taking ownership over provided window.

pub fn from_builder(builder: &mut Builder) -> Result<Self>[src]

Creates window from instance of window builder.

pub fn inner(&self) -> HWND[src]

Returns underlying window.

Ownership is not passed.

pub fn into_inner(self) -> HWND[src]

Transfers ownership of underlying window.

pub fn show(&self) -> bool[src]

Shows window.

Returns true if previously it wasn't visible

pub fn hide(&self) -> bool[src]

Hide window.

Returns true if previously it was visible

pub fn is_visible(&self) -> bool[src]

Returns whether window is visible.

pub fn class(&self) -> Result<String>[src]

Retrieves window's class.

pub fn title(&self) -> Result<String>[src]

Retrieves window's title.

pub fn thread_pid(&self) -> (u32, u32)[src]

Retrieves tuple of thread and process ids.

pub fn send_message(
    &self,
    msg_type: UINT,
    w_param: WPARAM,
    l_param: LPARAM,
    timeout: Option<UINT>
) -> Result<LRESULT>
[src]

Sends message to underlying window.

For more information refer to send_message()

pub fn send_push_button(&self, timeout: Option<UINT>) -> Result<LRESULT>[src]

Sends BM_CLICK message to underlying window.

For mores information refer to send_push_button()

pub fn send_set_text<T: AsRef<OsStr>>(&self, text: T) -> bool[src]

Sends WM_SETTEXT message to underlying window with new text.

For more information refer to send_set_text()

pub fn send_get_text(&self) -> Option<String>[src]

Sends WM_GETTEXT message to underlying window and returns, if possible, corresponding text.

For more information refer to send_get_text()

pub fn send_sys_command(&self, cmd_type: WPARAM, l_param: LPARAM) -> bool[src]

Sends WM_SYSCOMMAND message to underlying window and returns, if possible, corresponding text.

For more information refer to send_sys_command()

pub fn destroy(self)[src]

Destroys underlying window and drops self.

Trait Implementations

impl Into<*mut HWND__> for Window[src]

impl Drop for Window[src]

impl From<*mut HWND__> for Window[src]

Auto Trait Implementations

impl !Send for Window

impl !Sync for Window

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]