Skip to content

Commit

Permalink
Merge pull request #37 from enximi/main
Browse files Browse the repository at this point in the history
Use isize instead of HWND
  • Loading branch information
NiiightmareXD authored Apr 21, 2024
2 parents 3aa692e + 4ea5462 commit c9c0231
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,16 @@ impl Window {
///
/// # Arguments
///
/// * `window` - The raw HWND.
/// * `hwnd` - The hwnd.
#[must_use]
pub const fn from_raw_hwnd(window: HWND) -> Self {
Self { window }
pub const fn from_raw_hwnd(hwnd: isize) -> Self {
Self { window: HWND(hwnd)}
}

/// Returns the raw HWND of the window.
#[must_use]
pub const fn as_raw_hwnd(&self) -> HWND {
self.window
pub const fn as_raw_hwnd(&self) -> isize {
self.window.0
}

// Callback used for enumerating all windows.
Expand All @@ -245,7 +245,7 @@ impl TryFrom<Window> for GraphicsCaptureItem {
type Error = Error;

fn try_from(value: Window) -> Result<Self, Self::Error> {
let window = value.as_raw_hwnd();
let window = HWND(value.as_raw_hwnd());

let interop = windows::core::factory::<Self, IGraphicsCaptureItemInterop>()?;
Ok(unsafe { interop.CreateForWindow(window)? })
Expand Down

0 comments on commit c9c0231

Please sign in to comment.