Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NiiightmareXD committed Apr 21, 2024
2 parents ae70ce3 + c9c0231 commit f845ee8
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 50 deletions.
115 changes: 73 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resolver = "2"

[dependencies]
# Windows API
windows = { version = "0.54.0", features = [
windows = { version = "0.56.0", features = [
"Win32_System_WinRT_Graphics_Capture",
"Win32_Graphics_Direct3D11",
"Win32_Foundation",
Expand Down
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
2 changes: 1 addition & 1 deletion windows-capture-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name = "windows_capture"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21.1", features = [
pyo3 = { version = "0.21.2", features = [
"extension-module",
"auto-initialize",
] }
Expand Down

0 comments on commit f845ee8

Please sign in to comment.