Open louis030195 opened 2 months ago
same error (maybe)
wonder if its related to windows registry in any way
fyi i use xcap in a tauri app and by running the app in admin it solves the issue (kinda annoying, wonder if there is alternative way to do this)
nvm: user is getting these errors even with admin
Can you provide a sample code?
atm this is the code: https://github.com/mediar-ai/screenpipe/blob/main/screenpipe-vision/src/capture_screenshot_by_window.rs
@m13v can you help? can we create a code that reproduce this error?
This should only output logs to the console and should not cause a crash. If your program does not depend on app_name, theoretically, it should not be affected.
@nashaofu not sure to understand, do you know any way not to require admin right to use xcap
on windows? happy to contribute anything
PS: $100 bounty for this fix
@nashaofu i think this occurs when there is window like task manager open and the app is not able to capture it due to elevated permission requirement
this is what claude suggest:
// ... existing imports ...
use windows::Win32::UI::WindowsAndMessaging::{GetWindowLongW, GWL_EXSTYLE, WS_EX_TOPMOST};
// ... existing code ...
#[cfg(target_os = "windows")]
fn is_window_elevated(window: &Window) -> bool {
unsafe {
let hwnd = window.hwnd() as isize;
let ex_style = GetWindowLongW(hwnd, GWL_EXSTYLE);
(ex_style & WS_EX_TOPMOST.0 as i32) != 0
}
}
#[cfg(not(target_os = "windows"))]
fn is_window_elevated(_window: &Window) -> bool {
false
}
// ... rest of the file ...
if this is true, i'd suggest having a propery is_elevated
or similar so people can filter out if they want
do you have any idea how to fix this?
running as admin does not fix the error, also tried to tweak windows defender settings
i'm trying to see if windows require permission on newer versions, could it be?