Struct windows_win::Window
[−]
[src]
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]
fn from_hwnd(window: HWND) -> Self
Creates new instance by taking ownership over provided window.
fn from_builder(builder: &mut Builder) -> Result<Self>
Creates window from instance of window builder.
fn inner(&self) -> HWND
Returns underlying window.
Ownership is not passed.
fn into_inner(self) -> HWND
Transfers ownership of underlying window.
fn is_visible(&self) -> bool
Returns whether window is visible.
fn class(&self) -> Result<String>
Retrieves window's class.
fn title(&self) -> Result<String>
Retrieves window's title.
fn thread_pid(&self) -> (u32, u32)
Retrieves tuple of thread and process ids.
fn send_message(
&self,
msg_type: UINT,
w_param: WPARAM,
l_param: LPARAM,
timeout: Option<UINT>
) -> Result<LRESULT>
&self,
msg_type: UINT,
w_param: WPARAM,
l_param: LPARAM,
timeout: Option<UINT>
) -> Result<LRESULT>
Sends message to underlying window.
For more information refer to send_message()
Sends BM_CLICK message to underlying window.
For mores information refer to send_push_button()
fn send_set_text<T: AsRef<OsStr>>(&self, text: T) -> bool
Sends WM_SETTEXT message to underlying window with new text.
For more information refer to send_set_text()
fn send_get_text(&self) -> Option<String>
Sends WM_GETTEXT message to underlying window and returns, if possible, corresponding text.
For more information refer to send_get_text()
fn send_sys_command(&self, cmd_type: WPARAM, l_param: LPARAM) -> bool
Sends WM_SYSCOMMAND message to underlying window and returns, if possible, corresponding text.
For more information refer to send_sys_command()
fn destroy(self)
Destroys underlying window and drops self.