pub trait user_Hdc: Handle {
// Provided methods
fn DrawFocusRect(&self, rect: &RECT) -> SysResult<()> { ... }
fn DrawText(&self, text: &str, bounds: &RECT, format: DT) -> SysResult<i32> { ... }
fn DrawTextEx(
&self,
text: &str,
bounds: &RECT,
format: DT,
dtp: Option<&DRAWTEXTPARAMS>
) -> SysResult<i32> { ... }
fn EnumDisplayMonitors<F>(
&self,
rc_clip: Option<RECT>,
func: F
) -> SysResult<()>
where F: FnMut(HMONITOR, HDC, &RECT) -> bool { ... }
fn InvertRect(&self, rc: &RECT) -> SysResult<()> { ... }
fn PaintDesktop(&self) -> SysResult<()> { ... }
fn WindowFromDC(&self) -> Option<HWND> { ... }
}
Available on crate features
kernel
and user
only.Expand description
This trait is enabled with the user
feature, and provides methods for
HDC
.
Prefer importing this trait through the prelude:
use winsafe::prelude::*;
Provided Methods§
sourcefn DrawFocusRect(&self, rect: &RECT) -> SysResult<()>
fn DrawFocusRect(&self, rect: &RECT) -> SysResult<()>
DrawFocusRect
function.
sourcefn DrawTextEx(
&self,
text: &str,
bounds: &RECT,
format: DT,
dtp: Option<&DRAWTEXTPARAMS>
) -> SysResult<i32>
fn DrawTextEx( &self, text: &str, bounds: &RECT, format: DT, dtp: Option<&DRAWTEXTPARAMS> ) -> SysResult<i32>
DrawTextExW
function.
sourcefn EnumDisplayMonitors<F>(
&self,
rc_clip: Option<RECT>,
func: F
) -> SysResult<()>
fn EnumDisplayMonitors<F>( &self, rc_clip: Option<RECT>, func: F ) -> SysResult<()>
EnumDisplayMonitors
function.
§Examples
use winsafe::{self as w, prelude::*};
let hdc: w::HDC; // initialized somewhere
hdc.EnumDisplayMonitors(
None,
|hmon: w::HMONITOR, hdc: w::HDC, rc: &w::RECT| -> bool {
println!("HMONITOR: {}, ", hmon);
true
},
)?;
sourcefn InvertRect(&self, rc: &RECT) -> SysResult<()>
fn InvertRect(&self, rc: &RECT) -> SysResult<()>
InvertRect
function.
sourcefn PaintDesktop(&self) -> SysResult<()>
fn PaintDesktop(&self) -> SysResult<()>
PaintDesktop
function.
sourcefn WindowFromDC(&self) -> Option<HWND>
fn WindowFromDC(&self) -> Option<HWND>
WindowFromDC
function.
Object Safety§
This trait is not object safe.