#![allow(non_camel_case_types, non_snake_case)]
use crate::co;
use crate::decl::*;
use crate::gdi::ffi;
use crate::guard::*;
use crate::kernel::privs::*;
impl HINSTANCE {
#[must_use]
pub fn LoadImageBitmap(
&self,
name: IdObmStr,
sz: SIZE,
load: co::LR,
) -> SysResult<DeleteObjectGuard<HBITMAP>> {
unsafe {
PtrRet(ffi::LoadImageW(self.ptr(), name.as_ptr(), 0, sz.cx, sz.cy, load.raw()))
.to_sysresult_handle()
.map(|h| DeleteObjectGuard::new(h))
}
}
#[must_use]
pub fn LoadImageCursor(
&self,
name: IdOcrStr,
sz: SIZE,
load: co::LR,
) -> SysResult<DestroyCursorGuard> {
unsafe {
PtrRet(ffi::LoadImageW(self.ptr(), name.as_ptr(), 2, sz.cx, sz.cy, load.raw()))
.to_sysresult_handle()
.map(|h| DestroyCursorGuard::new(h))
}
}
#[must_use]
pub fn LoadImageIcon(
&self,
name: IdOicStr,
sz: SIZE,
load: co::LR,
) -> SysResult<DestroyIconGuard> {
unsafe {
PtrRet(ffi::LoadImageW(self.ptr(), name.as_ptr(), 1, sz.cx, sz.cy, load.raw()))
.to_sysresult_handle()
.map(|h| DestroyIconGuard::new(h))
}
}
}