diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml index a29b2e2..e7e327a 100644 --- a/crates/client/Cargo.toml +++ b/crates/client/Cargo.toml @@ -40,4 +40,5 @@ windows = { version = "0.54", features = [ "Win32_UI_WindowsAndMessaging", "Win32_UI_Shell", "Win32_System_Console", + "Win32_System_ProcessStatus", ] } diff --git a/crates/client/src/windows_mgmt.rs b/crates/client/src/windows_mgmt.rs index 810ebad..6f766f7 100644 --- a/crates/client/src/windows_mgmt.rs +++ b/crates/client/src/windows_mgmt.rs @@ -8,7 +8,7 @@ mod win_impl { use super::*; use windows::Win32::Foundation::{BOOL, HWND, LPARAM}; use windows::Win32::UI::WindowsAndMessaging::{ - BringWindowToTop, EnumWindows, GetWindowLong, GetWindowTextW, IsIconic, + BringWindowToTop, EnumWindows, GetWindowLongA, GetWindowTextW, IsIconic, IsWindowVisible, SetForegroundWindow, ShowWindow, GWL_EXSTYLE, SW_MAXIMIZE, SW_MINIMIZE, SW_RESTORE, WS_EX_TOOLWINDOW, }; @@ -109,7 +109,7 @@ mod win_impl { } // Exclude tool windows (WS_EX_TOOLWINDOW) - let ex_style = unsafe { GetWindowLong(hwnd, GWL_EXSTYLE) } as u32; + let ex_style = unsafe { GetWindowLongA(hwnd, GWL_EXSTYLE) } as u32; if ex_style & WS_EX_TOOLWINDOW.0 != 0 { return true; }