INNER CODE UNIT · Rust

apply_ws_ex_noactivate

Blur009/Blur-AutoClicker · src-tauri/src/lib.rs:77

fn apply_ws_ex_noactivate(window: &tauri::WebviewWindow, enable: bool) {
    use raw_window_handle::{HasWindowHandle, RawWindowHandle};
    use windows_sys::Win32::UI::WindowsAndMessaging::{
        GetWindowLongW, SetWindowLongW, GWL_EXSTYLE,
    };

    if let Ok(handle) = window.window_handle() {
        if let RawWindowHandle::Win32(w) = handle.as_raw() {
            let hwnd = w.hwnd.get() as *mut std::ffi::c_void;
            unsafe {
                let ex = GetWindowLongW(hwnd, GWL_EXSTYLE);
                let new_ex = if enable {
                    (ex as u32 | 0x08000000) as i32
                } else {
                    (ex as u32 & !0x08000000) as i32
                };
                SetWindowLongW(hwnd, GWL_EXSTYLE, new_ex);
            }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…