pub struct PlatformWindow(/* private fields */);Expand description
Represents a window in the Windows platform.
Implementations§
Source§impl WindowsWindow
impl WindowsWindow
Sourcepub fn new(hwnd: HWND) -> WindowsWindow
pub fn new(hwnd: HWND) -> WindowsWindow
Creates a new WindowsWindow from a raw HWND.
§Warning
You must ensure that the hwnd is a valid window handle. If you pass an invalid handle,
it may lead to errors on methods.
You can use get_window to safely retrieve a WindowsWindow.
Sourcepub fn rect(&self) -> Result<RECT, Error>
pub fn rect(&self) -> Result<RECT, Error>
Returns the raw rectangle of the window by [GetWindowRect].
It includes the invisible resize borders. So it may not be the same as the window rectangle that is actually seen.
Sourcepub fn bounds(&self) -> Result<Bounds, Error>
pub fn bounds(&self) -> Result<Bounds, Error>
This will return rect value wrapped in WindowsBounds.
Sourcepub fn extended_frame_bounds(&self) -> Result<RECT, Error>
pub fn extended_frame_bounds(&self) -> Result<RECT, Error>
Returns the extended frame bounds of the window
by [DwmGetWindowAttribute] with [DWMWA_EXTENDED_FRAME_BOUNDS].
Sourcepub fn visible_bounds(&self) -> Result<Bounds, Error>
pub fn visible_bounds(&self) -> Result<Bounds, Error>
Returns the bounds of the window.
This will return extended_frame_bounds
value wrapped in WindowsBounds.
Sourcepub fn owner_pid(&self) -> Result<u32, Error>
pub fn owner_pid(&self) -> Result<u32, Error>
Returns the process ID of the owner of this window.
Sourcepub fn owner_process_handle(&self) -> Result<HANDLE, Error>
pub fn owner_process_handle(&self) -> Result<HANDLE, Error>
Returns the handle to the process that owns this window.
Sourcepub fn owner_name(&self) -> Result<String, Error>
pub fn owner_name(&self) -> Result<String, Error>
Returns the file name of the process that owns this window. This will return the name of the executable file.
Sourcepub fn is_foreground(&self) -> bool
pub fn is_foreground(&self) -> bool
Checks if the window is foreground.
Trait Implementations§
Source§impl Clone for WindowsWindow
impl Clone for WindowsWindow
Source§fn clone(&self) -> WindowsWindow
fn clone(&self) -> WindowsWindow
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more