pub struct Window { /* private fields */ }
Expand description
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.
Implementations§
Source§impl Window
impl Window
Sourcepub fn from_hwnd(window: HWND) -> Self
pub fn from_hwnd(window: HWND) -> Self
Creates new instance by taking ownership over provided window.
Sourcepub fn from_builder(builder: &mut Builder) -> Result<Self>
pub fn from_builder(builder: &mut Builder) -> Result<Self>
Creates window from instance of window builder.
Sourcepub fn into_inner(self) -> HWND
pub fn into_inner(self) -> HWND
Transfers ownership of underlying window.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Returns whether window is visible.
Sourcepub fn thread_pid(&self) -> (u32, u32)
pub fn thread_pid(&self) -> (u32, u32)
Retrieves tuple of thread and process ids.
Sourcepub fn send_message(
&self,
msg_type: UINT,
w_param: WPARAM,
l_param: LPARAM,
timeout: Option<UINT>,
) -> Result<LRESULT>
pub fn send_message( &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()
Sourcepub fn send_set_text<T: AsRef<OsStr>>(&self, text: T) -> bool
pub 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()
Sourcepub fn send_get_text(&self) -> Option<String>
pub 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()
Sourcepub fn send_sys_command(&self, cmd_type: WPARAM, l_param: LPARAM) -> bool
pub 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()