Skip to main content

Module shell

Module shell 

Source
Expand description

Monitor window operations: creating, activating, title redrawing, monitor changing…

Installs a hook procedure that receives notifications useful to Windows shell applications.

See:

§Examples

use ib_hook::windows::shell::{ShellHook, ShellHookMessage};
{
    let hook = ShellHook::new(Box::new(|msg: ShellHookMessage| {
        println!("{msg:?}");
        false
    }))
    .unwrap();

    // Perform window operations to see received events...
    std::thread::sleep(std::time::Duration::from_secs(30));
}
// Shell hook unregistered

§Disclaimer

Ref:

  • https://github.com/YousefAliUK/FerroDock/blob/b405832a64c763f073b37d9a42a0690d0c15416b/src/events.rs
  • https://gist.github.com/Aetopia/347e7329158aa2c69df97bdf0b761d6f

Structs§

ShellHook

Enums§

ShellHookMessage
Shell hook message variants.

Constants§

HSHELL_ACCESSIBILITYSTATE
HSHELL_ACTIVATESHELLWINDOW
HSHELL_APPCOMMAND
HSHELL_ENDTASK
HSHELL_FLASH
HSHELL_GETMINRECT
HSHELL_HIGHBIT
HSHELL_LANGUAGE
HSHELL_MONITORCHANGED
HSHELL_REDRAW
HSHELL_RUDEAPPACTIVATED
HSHELL_SYSMENU
HSHELL_TASKMAN
HSHELL_WINDOWACTIVATED
HSHELL_WINDOWCREATED
HSHELL_WINDOWDESTROYED
HSHELL_WINDOWREPLACED
HSHELL_WINDOWREPLACING

Type Aliases§

ShellHookCallback
The return value should be false unless the message is ShellHookMessage::AppCommand and the callback handles the [WM_COMMAND] message. In this case, the return should be true.