Struct winsafe::HWND

source ·
pub struct HWND(/* private fields */);
Available on crate feature user only.
Expand description

Handle to a window.

Trait Implementations§

source§

impl Debug for HWND

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for HWND

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Handle for HWND

source§

const NULL: Self = _

Available on crate feature kernel only.
The null, uninitialized handle; equals to 0.
source§

const INVALID: Self = _

Available on crate feature kernel only.
The invalid handle; equals to -1. Read more
source§

unsafe fn from_ptr(p: *mut c_void) -> Self

Available on crate feature kernel only.
Creates a new handle object by wrapping a pointer. Read more
source§

unsafe fn as_mut(&mut self) -> &mut *mut c_void

Available on crate feature kernel only.
Returns a mutable reference to the underlying raw pointer. Read more
source§

unsafe fn raw_copy(&self) -> Self

Available on crate feature kernel only.
Returns a raw copy of the underlying handle pointer. Read more
source§

fn ptr(&self) -> *mut c_void

Available on crate feature kernel only.
Returns the underlying raw pointer. Read more
source§

fn as_opt(&self) -> Option<&Self>

Available on crate feature kernel only.
Returns None if the handle is null or invalid, otherwise returns Some(&self). Read more
source§

impl Hash for HWND

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for HWND

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl PartialEq for HWND

source§

fn eq(&self, other: &HWND) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl UpperHex for HWND

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl comctl_Hwnd for HWND

Available on crate feature comctl only.
source§

fn DefSubclassProc<M>(&self, msg: M) -> M::RetType
where M: MsgSend,

source§

fn InitializeFlatSB(&self) -> HrResult<()>

source§

fn RemoveWindowSubclass( &self, subclass_func: SUBCLASSPROC, subclass_id: usize ) -> SysResult<()>

source§

unsafe fn SetWindowSubclass( &self, subclass_proc: SUBCLASSPROC, subclass_id: usize, ref_data: usize ) -> SysResult<()>

source§

fn TaskDialog( &self, hinstance: Option<&HINSTANCE>, window_title: Option<&str>, main_instruction: Option<&str>, content: Option<&str>, common_buttons: TDCBF, icon: IconRes ) -> HrResult<DLGID>

source§

fn UninitializeFlatSB(&self) -> HrResult<()>

source§

impl dwm_Hwnd for HWND

Available on crate feature dwm only.
source§

impl ole_Hwnd for HWND

Available on crate feature ole only.
source§

impl shell_Hwnd for HWND

Available on crate feature shell only.
source§

fn DragAcceptFiles(&self, accept: bool)

DragAcceptFiles function.
source§

fn ShellAbout( &self, title_bar: &str, first_line: Option<&str>, other_stuff: Option<&str>, hicon: Option<&HICON> ) -> SysResult<()>

ShellAbout function.
source§

fn ShellExecute( &self, operation: &str, file: &str, parameters: Option<&str>, directory: Option<&str>, show_cmd: SW ) -> Result<HINSTANCE, SE_ERR>

ShellExecute function.
source§

impl user_Hwnd for HWND

source§

const BROADCAST: HWND = _

Represents all top-level windows in HWND::PostMessage and HWND::SendMessage.
source§

const DESKTOP: HWND = _

Represents the desktop window in HWND::GetDC.
source§

fn hinstance(&self) -> HINSTANCE

Calls HWND::GetWindowLongPtr to retrieve the window HINSTANCE.
source§

fn is_dialog(&self) -> bool

Calls HWND::GetClassLongPtr to retrieve the class atom and check whether the window was created from a dialog resource.
source§

fn styles(&self) -> WS

Calls HWND::GetWindowLongPtr to retrieve the window styles.
source§

fn styles_ex(&self) -> WS_EX

Calls HWND::GetWindowLongPtr to retrieve the extended window styles.
source§

fn ArrangeIconicWindows(&self) -> SysResult<u32>

source§

fn BeginPaint(&self) -> SysResult<EndPaintGuard<'_, Self>>

source§

fn BringWindowToTop(&self) -> SysResult<()>

source§

fn ChildWindowFromPoint(&self, pt: POINT) -> Option<HWND>

source§

fn ClientToScreen(&self, pt: &mut POINT) -> SysResult<()>

source§

fn ClientToScreenRc(&self, rc: &mut RECT) -> SysResult<()>

ClientToScreen method for a RECT.
source§

fn CloseWindow(&self) -> SysResult<()>

source§

unsafe fn CreateWindowEx( ex_style: WS_EX, class_name: AtomStr, title: Option<&str>, style: WS, pos: POINT, size: SIZE, hwnd_parent: Option<&HWND>, hmenu: IdMenu<'_>, hinstance: &HINSTANCE, lparam: Option<isize> ) -> SysResult<HWND>

source§

fn DefWindowProc<M>(&self, msg: M) -> M::RetType
where M: MsgSend,

source§

fn DestroyWindow(&self) -> SysResult<()>

source§

fn DragDetect(&self, pt: POINT) -> bool

DragDetect function.
source§

fn DrawCaption( &self, hdc: &HDC, rect: &RECT, flags: Option<DC> ) -> SysResult<()>

DrawCaption function.
source§

fn DrawMenuBar(&self) -> SysResult<()>

DrawMenuBar function.
source§

fn EnableScrollBar(&self, sb_flags: SBB, arrows: ESB) -> SysResult<()>

EnableScrollBar function.
source§

fn EnableWindow(&self, enable: bool) -> bool

EnableWindow function.
source§

fn EndDialog(&self, result: isize) -> SysResult<()>

EndDialog function.
source§

fn EnumChildWindows<F>(&self, func: F)
where F: FnMut(HWND) -> bool,

source§

fn FindWindow( class_name: Option<AtomStr>, title: Option<&str> ) -> SysResult<Option<HWND>>

FindWindow function.
source§

fn FindWindowEx( &self, hwnd_child_after: Option<&HWND>, class_name: AtomStr, title: Option<&str> ) -> SysResult<Option<HWND>>

FindWindowEx function.
source§

fn GetActiveWindow() -> Option<HWND>

GetActiveWindow function.
source§

fn GetAltTabInfo( &self, item: Option<u32>, ati: &mut ALTTABINFO, sz_item_text: Option<u32> ) -> SysResult<String>

source§

fn GetAncestor(&self, flags: GA) -> Option<HWND>

GetAncestor function.
source§

fn GetCapture() -> Option<HWND>

GetCapture function.
source§

fn GetClassLongPtr(&self, index: GCLP) -> usize

source§

fn GetClassName(&self) -> SysResult<String>

GetClassName function.
source§

fn GetClientRect(&self) -> SysResult<RECT>

GetClientRect function.
source§

fn GetDC(&self) -> SysResult<ReleaseDCGuard<'_, Self>>

GetDC function. Read more
source§

fn GetDesktopWindow() -> HWND

source§

fn GetDialogDpiChangeBehavior(&self) -> SysResult<DDC>

source§

fn GetDlgCtrlID(&self) -> SysResult<u16>

GetDlgCtrlID function.
source§

fn GetDlgItem(&self, ctrl_id: u16) -> SysResult<HWND>

GetDlgItem function.
source§

fn GetDpiForWindow(&self) -> u32

GetDpiForWindow function.
source§

fn GetFocus() -> Option<HWND>

GetFocus function.
source§

fn GetForegroundWindow() -> Option<HWND>

source§

fn GetLastActivePopup(&self) -> Option<HWND>

source§

fn GetMenu(&self) -> Option<HMENU>

GetMenu function.
source§

fn GetMenuBarInfo( &self, obj_id: OBJID, item_id: u32, mbi: &mut MENUBARINFO ) -> SysResult<()>

GetMenuBarInfo function.
source§

fn GetMenuItemRect(&self, hmenu: &HMENU, item_pos: u32) -> SysResult<RECT>

GetMenuItemRect function.
source§

fn GetNextDlgGroupItem( &self, hwnd_ctrl: &HWND, previous: bool ) -> SysResult<HWND>

source§

fn GetNextDlgTabItem(&self, hwnd_ctrl: &HWND, previous: bool) -> SysResult<HWND>

source§

fn GetParent(&self) -> SysResult<HWND>

GetParent function.
source§

fn GetScrollInfo(&self, bar: SBB, si: &mut SCROLLINFO) -> SysResult<()>

GetScrollInfo function.
source§

fn GetScrollPos(&self, bar: SBB) -> SysResult<i32>

GetScrollPos function.
source§

fn GetShellWindow() -> Option<HWND>

GetShellWindow function.
source§

fn GetSystemMenu(&self, revert: bool) -> Option<HMENU>

GetSystemMenu function.
source§

fn GetTopWindow(&self) -> SysResult<Option<HWND>>

GetTopWindow function.
source§

fn GetUpdateRect(&self, erase: bool) -> Option<RECT>

GetUpdateRect function.
source§

fn GetUpdateRgn(&self, hrgn: &HRGN, erase: bool) -> SysResult<REGION>

GetUpdateRgn function.
source§

fn GetWindow(&self, cmd: GW) -> SysResult<HWND>

GetWindow function.
source§

fn GetWindowDC(&self) -> SysResult<ReleaseDCGuard<'_, Self>>

GetWindowDC function.
source§

fn GetWindowDisplayAffinity(&self) -> SysResult<WDA>

source§

fn GetWindowDpiHostingBehavior(&self) -> DPI_HOSTING_BEHAVIOR

source§

fn GetWindowInfo(&self, wi: &mut WINDOWINFO) -> SysResult<()>

GetWindowInfo function.
source§

fn GetWindowLongPtr(&self, index: GWLP) -> isize

GetWindowLong function (x32) or GetWindowLongPtr function (x64). Read more
source§

fn GetWindowModuleFileName(&self) -> String

source§

fn GetWindowPlacement(&self, wp: &mut WINDOWPLACEMENT) -> SysResult<()>

source§

fn GetWindowRect(&self) -> SysResult<RECT>

GetWindowRect function.
source§

fn GetWindowRgn(&self, hrgn: &HRGN) -> SysResult<REGION>

GetWindowRgn function.
source§

fn GetWindowRgnBox(&self) -> SysResult<(RECT, REGION)>

GetWindowRgnBox function.
source§

fn GetWindowText(&self) -> SysResult<String>

source§

fn GetWindowTextLength(&self) -> SysResult<i32>

source§

fn GetWindowThreadProcessId(&self) -> (u32, u32)

source§

fn HiliteMenuItem(&self, hmenu: &HMENU, id_or_pos: IdPos, hilite: bool) -> bool

HiliteMenuItem function.
source§

fn InheritWindowMonitor(&self, hwnd_inherit: &HWND) -> SysResult<()>

source§

fn InvalidateRect(&self, rc: Option<&RECT>, erase: bool) -> SysResult<()>

source§

fn InvalidateRgn(&self, hrgn: &HRGN, erase: bool)

InvalidateRgn function.
source§

fn IsChild(&self, hwnd_possible_child: &HWND) -> bool

IsChild function.
source§

fn IsDialogMessage(&self, msg: &mut MSG) -> bool

IsDialogMessage function.
source§

fn IsIconic(&self) -> bool

IsIconic function.
source§

fn IsWindow(&self) -> bool

IsWindow function.
source§

fn IsWindowEnabled(&self) -> bool

IsWindowEnabled function.
source§

fn IsWindowUnicode(&self) -> bool

IsWindowUnicode function.
source§

fn IsWindowVisible(&self) -> bool

IsWindowVisible function.
source§

fn IsZoomed(&self) -> bool

IsZoomed function.
source§

fn KillTimer(&self, event_id: usize) -> SysResult<()>

source§

fn LockWindowUpdate(&self) -> SysResult<()>

source§

fn LogicalToPhysicalPoint(&self, pt: *mut POINT) -> SysResult<()>

source§

fn MapDialogRect(&self, rc: &mut RECT) -> SysResult<()>

MapDialogRect function.
source§

fn MapWindowPoints( &self, hdest: &HWND, points: PtsRc<'_> ) -> SysResult<(i16, i16)>

source§

fn MessageBox(&self, text: &str, caption: &str, flags: MB) -> SysResult<DLGID>

source§

fn MonitorFromWindow(&self, flags: MONITOR) -> HMONITOR

source§

fn MoveWindow(&self, pos: POINT, size: SIZE, repaint: bool) -> SysResult<()>

MoveWindow function.
source§

fn OpenClipboard(&self) -> SysResult<CloseClipboardGuard<'_>>

source§

fn PostMessage<M>(&self, msg: M) -> SysResult<()>
where M: MsgSend + Send + Copy + 'static,

source§

fn RealChildWindowFromPoint( &self, pt_parent_client_coords: POINT ) -> Option<HWND>

source§

fn RealGetWindowClass(&self) -> SysResult<String>

source§

fn RedrawWindow( &self, rc_update: &RECT, hrgn_update: &HRGN, flags: RDW ) -> SysResult<()>

RedrawWindow function.
source§

fn ScreenToClient(&self, pt: &mut POINT) -> SysResult<()>

source§

fn ScreenToClientRc(&self, rc: &mut RECT) -> SysResult<()>

ScreenToClient method for a RECT.
source§

fn ScrollWindowEx( &self, dx: i32, dy: i32, client_area_portion: Option<&RECT>, clipping_rect: Option<&RECT>, hrgn_update: Option<&HRGN>, updated_boundaries: Option<&mut RECT>, flags: SCROLLW ) -> SysResult<REGION>

ScrollWindowEx function.
source§

fn SendMessage<M>(&self, msg: M) -> M::RetType
where M: MsgSend,

source§

fn SendMessageTimeout<M>( &self, msg: M, flags: SMTO, timeout_ms: u32 ) -> SysResult<M::RetType>
where M: MsgSend,

source§

fn SetActiveWindow(&self) -> SysResult<HWND>

SetActiveWindow function.
source§

fn SetCapture(&self) -> ReleaseCaptureGuard<'_, Self>

SetCapture function.
source§

fn SetDialogDpiChangeBehavior(&self, mask: DDC, values: DDC) -> SysResult<()>

source§

fn SetFocus(&self) -> Option<HWND>

SetFocus function.
source§

fn SetForegroundWindow(&self) -> bool

source§

fn SetLayeredWindowAttributes( &self, transparency_color_key: COLORREF, alpha: u8, flags: LWA ) -> SysResult<()>

source§

fn SetMenu(&self, hmenu: &HMENU) -> SysResult<()>

SetMenu function.
source§

fn SetParent(&self, hwnd_new_parent: &HWND) -> SysResult<Option<HWND>>

SetParent function.
source§

fn SetScrollInfo(&self, bar: SBB, si: &SCROLLINFO, redraw: bool) -> i32

SetScrollInfo function.
source§

fn SetScrollPos(&self, b: SBB, pos: i32, redraw: bool) -> SysResult<i32>

SetScrollPos function.
source§

fn SetScrollRange( &self, bar: SBB, min_pos: i32, max_pos: i32, redraw: bool ) -> SysResult<()>

SetScrollRange function.
source§

fn SetTimer( &self, event_id: usize, elapse_ms: u32, timer_func: Option<TIMERPROC> ) -> SysResult<usize>

This method returns the timer ID, to be passed to HWND::KillTimer. Read more
source§

fn SetWindowDisplayAffinity(&self, affinity: WDA) -> SysResult<()>

source§

fn SetWindowLongPtr(&self, index: GWLP, new_long: isize) -> isize

source§

fn SetWindowPlacement(&self, wp: &WINDOWPLACEMENT) -> SysResult<()>

source§

fn SetWindowPos( &self, hwnd_insert_after: HwndPlace, pos: POINT, size: SIZE, flags: SWP ) -> SysResult<()>

source§

fn SetWindowRgn(&self, hrgn: &HRGN, redraw: bool) -> SysResult<()>

SetWindowRgn function.
source§

fn SetWindowText(&self, text: &str) -> SysResult<()>

SetWindowText function.
source§

fn ShowCaret(&self) -> SysResult<()>

ShowCaret function.
source§

fn ShowOwnedPopups(&self, show: bool) -> SysResult<()>

ShowOwnedPopups function.
source§

fn ShowWindow(&self, show_cmd: SW) -> bool

ShowWindow function.
source§

fn ShowWindowAsync(&self, show_cmd: SW) -> SysResult<()>

ShowWindowAsync function.
source§

fn TileWindows( &self, how: MDITILE, rect: Option<RECT>, kids: Option<&[&HWND]> ) -> SysResult<u16>

TileWindows function.
source§

fn TranslateAccelerator( &self, haccel_table: &HACCEL, msg: &mut MSG ) -> SysResult<()>

source§

fn UpdateLayeredWindow( &self, hdc_dest: Option<&HDC>, pt_dest: Option<&POINT>, size: Option<&SIZE>, hdc_src: Option<&HDC>, pt_src: Option<&POINT>, key: COLORREF, blend: &BLENDFUNCTION, flags: ULW ) -> SysResult<()>

source§

fn UpdateWindow(&self) -> SysResult<()>

UpdateWindow function.
source§

fn ValidateRect(&self, rc: &RECT) -> SysResult<()>

ValidateRect function.
source§

fn ValidateRgn(&self, hrgn: &HRGN) -> SysResult<()>

ValidateRgn function.
source§

fn WindowFromPhysicalPoint(pt: POINT) -> Option<HWND>

source§

fn WindowFromPoint(pt: POINT) -> Option<HWND>

WindowFromPoint function.
source§

fn WinHelp(&self, help_file: &str, cmd: HELPW, data: usize) -> SysResult<()>

WinHelp function.
source§

impl uxtheme_Hwnd for HWND

Available on crate feature uxtheme only.
source§

impl Eq for HWND

source§

impl Send for HWND

source§

impl StructuralPartialEq for HWND

Auto Trait Implementations§

§

impl RefUnwindSafe for HWND

§

impl !Sync for HWND

§

impl Unpin for HWND

§

impl UnwindSafe for HWND

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.