Trait winsafe::prelude::user_Hdc

source ·
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§

source

fn DrawFocusRect(&self, rect: &RECT) -> SysResult<()>

DrawFocusRect function.

source

fn DrawText(&self, text: &str, bounds: &RECT, format: DT) -> SysResult<i32>

DrawText function.

source

fn DrawTextEx( &self, text: &str, bounds: &RECT, format: DT, dtp: Option<&DRAWTEXTPARAMS> ) -> SysResult<i32>

DrawTextExW function.

source

fn EnumDisplayMonitors<F>( &self, rc_clip: Option<RECT>, func: F ) -> SysResult<()>
where F: FnMut(HMONITOR, HDC, &RECT) -> bool,

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
    },
)?;
source

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

InvertRect function.

source

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

PaintDesktop function.

source

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

WindowFromDC function.

Object Safety§

This trait is not object safe.

Implementors§