Files
desktop-icon-hider/src/state.rs
T

21 lines
1.1 KiB
Rust

use std::sync::atomic::AtomicBool;
use windows::Win32::UI::WindowsAndMessaging::WM_APP;
/// When true, double-click monitoring is temporarily disabled (tray menu toggle).
pub static PAUSED: AtomicBool = AtomicBool::new(false);
/// Posted from the mouse-hook callback to the main thread's message loop when a
/// candidate double-click is detected. WPARAM = screen x, LPARAM = screen y.
/// Kept out of the hook callback itself so the hook stays cheap.
pub const WM_APP_CANDIDATE_DBLCLICK: u32 = WM_APP + 1;
/// Posted from the (Send + Sync-bound) menu event handler when the pause state
/// changes, so the main loop — which owns the actual (non-Send) MenuItem — can update
/// its label without needing to move the item into that handler.
pub const WM_APP_PAUSE_TOGGLED: u32 = WM_APP + 2;
/// Posted from the menu event handler after an autostart registry write, carrying the
/// actual resulting enabled state in wParam. muda already flips the native checkmark
/// itself on click, so the main loop only needs to correct it if the write failed.
pub const WM_APP_AUTOSTART_TOGGLED: u32 = WM_APP + 3;