Skip to content

Commit

Permalink
Add Activate Method For Window 🎊
Browse files Browse the repository at this point in the history
	modified:   Cargo.lock
	modified:   Cargo.toml
	modified:   src/window.rs
  • Loading branch information
NiiightmareXD committed Sep 22, 2023
1 parent d6670e1 commit 7877b60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
[package]
name = "windows-capture"
version = "1.0.12"
version = "1.0.14"
authors = ["NiiightmareXD"]
edition = "2021"
description = "Windows Capture Simple Screen Capture for Windows 🔥"
Expand Down
9 changes: 9 additions & 0 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ impl Window {
Ok(windows)
}

/// Wait Until The Window Is The Currently Active Foreground Window
pub fn activate(&self) {
loop {
if unsafe { GetForegroundWindow() } == self.window {
break;
}
}
}

/// Get The Raw HWND
pub const fn get_raw_hwnd(&self) -> HWND {
self.window
Expand Down

0 comments on commit 7877b60

Please sign in to comment.