pub struct HDWP(/* private fields */);
user
only.Expand description
Handle to a deferred window position.
Implementations§
Source§impl HDWP
impl HDWP
Sourcepub const unsafe fn from_ptr(p: *mut c_void) -> Self
pub const unsafe fn from_ptr(p: *mut c_void) -> Self
Constructs a new handle object by wrapping a pointer.
This method can be used as an escape hatch to interoperate with other libraries.
§Safety
Be sure the pointer has the correct type and isn’t owned by anyone else, otherwise you may cause memory access violations.
Sourcepub const unsafe fn raw_copy(&self) -> Self
pub const unsafe fn raw_copy(&self) -> Self
Returns a raw copy of the underlying handle pointer.
§Safety
As the name implies, raw_copy
returns a raw copy of the
handle, so closing one of the copies won’t close the others.
This means a handle can be used after it has been closed, what
can lead to errors and undefined behavior. Even worse: sometimes
Windows reuses handle values, so you can call a method on a
completely different handle type, what can be catastrophic.
However, in some cases the Windows API demands a copy of the
handle – raw_copy
is an escape hatch to fill this gap.
Sourcepub const unsafe fn as_mut(&mut self) -> &mut *mut c_void
pub const unsafe fn as_mut(&mut self) -> &mut *mut c_void
Returns a mutable reference to the underlying raw pointer.
This method can be used as an escape hatch to interoperate with other libraries.
§Safety
This method exposes the raw pointer used by raw Windows calls. It’s an opaque pointer to an internal Windows structure, and no dereferencings should be attempted.
Sourcepub const fn ptr(&self) -> *mut c_void
pub const fn ptr(&self) -> *mut c_void
Returns the underlying raw pointer.
This method exposes the raw pointer used by raw Windows calls. It’s an opaque pointer to an internal Windows structure, and no dereferencings should be attempted.
This method can be used as an escape hatch to interoperate with other libraries.
Source§impl HDWP
impl HDWP
Sourcepub fn BeginDeferWindowPos(
num_windows: u32,
) -> SysResult<EndDeferWindowPosGuard>
pub fn BeginDeferWindowPos( num_windows: u32, ) -> SysResult<EndDeferWindowPosGuard>
BeginDeferWindowPos
function.
In the original C implementation, BeginDeferWindowPos
returns a handle
which must be passed to
EndDeferWindowPos
as a cleanup operation.
Here, the cleanup is performed automatically, because
BeginDeferWindowPos
returns an
EndDeferWindowPosGuard
, which
automatically calls EndDeferWindowPos
when the guard goes out of
scope.
Sourcepub fn DeferWindowPos(
&mut self,
hwnd: &HWND,
hwnd_insert_after: HwndPlace,
top_left: POINT,
sz: SIZE,
flags: SWP,
) -> SysResult<()>
pub fn DeferWindowPos( &mut self, hwnd: &HWND, hwnd_insert_after: HwndPlace, top_left: POINT, sz: SIZE, flags: SWP, ) -> SysResult<()>
DeferWindowPos
function.
Originally this method returns the handle to the reallocated memory object; here the original handle is automatically updated.
Trait Implementations§
Source§impl Handle for HDWP
impl Handle for HDWP
Source§const NULL: Self
const NULL: Self
kernel
only.0
.Source§const INVALID: Self
const INVALID: Self
kernel
only.-1
. Read moreSource§unsafe fn from_ptr(p: *mut c_void) -> Self
unsafe fn from_ptr(p: *mut c_void) -> Self
kernel
only.Source§unsafe fn raw_copy(&self) -> Self
unsafe fn raw_copy(&self) -> Self
kernel
only.Source§unsafe fn as_mut(&mut self) -> &mut *mut c_void
unsafe fn as_mut(&mut self) -> &mut *mut c_void
kernel
only.