diff --git a/Cargo.lock b/Cargo.lock index 74977cc..31fda7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,7 @@ dependencies = [ [[package]] name = "windows-capture" -version = "1.0.12" +version = "1.0.14" dependencies = [ "log", "parking_lot", diff --git a/Cargo.toml b/Cargo.toml index 1967730..4bfc5d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 🔥" diff --git a/src/window.rs b/src/window.rs index fb11f59..e147491 100644 --- a/src/window.rs +++ b/src/window.rs @@ -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