1

The goal is to prevent taskbar icons from ever flashing. Apparently Windows has no option to disable flashing, so I'm hoping to write a small program that would intercept all the calls to FlashWindow / FlashWindowEx from any application and simply discard them.

Can this be done? If so, could you give any hints/examples how to hook calls to FlashWindowEx (globally) that would work with both 32bit and 64bit apps and also with both regular API calls and DLL calls through GetProcAddress (Skype uses that).

blade
  • 12,057
  • 7
  • 37
  • 38
  • Look into Microsoft's Detours library. I thought there was an option for it somewhere at least, though. – chris May 16 '14 at 13:05
  • From what I've gathered, detours supports only 32 bit apps in its free version. – blade May 16 '14 at 13:06
  • 1
    What about [this](http://i.imgur.com/ElsihIw.png)? Control panel > Ease of Access Centre > Use text or visual alternatives for sounds – chris May 16 '14 at 13:07
  • [These are my settings](http://i.imgur.com/4LzY8zG.png), but unfortunately the taskbar still flashes. (edit: tried all the other combinations and checkboxes with no effect whatsoever) – blade May 16 '14 at 13:13
  • 1
    Note that FlashWindowEx is not the only reason a window can flash on the taskbar. You would be better off suppressing the HSHELL_FLASH notification. – Raymond Chen May 16 '14 at 13:44
  • @RaymondChen Is HSHELL_FLASH a "lower level" device (used by FlashWindowEx) or are they 2 separate things that I need to take care of? – blade May 16 '14 at 13:53
  • All flash requests regardless of source become HSHELL_FLASH. – Raymond Chen May 16 '14 at 14:47
  • @RaymondChen Great, that makes things a lot easier. So how can I suppress HSHELL_FLASH? – blade May 16 '14 at 15:01
  • http://msdn.microsoft.com/en-us/library/windows/desktop/ms644989(v=vs.85).aspx – Remy Lebeau May 16 '14 at 15:06
  • @blade I know I'm a bit late, but have you figured out a solution? It's 2021 and Microsoft still hasn't fixed their autohiding taskbar.. – CiriousJoker Jul 16 '21 at 05:20
  • 1
    @CiriousJoker yep, it required injecting a DLL into every process. It wasn't as easy as I had hoped, but I got it working and here's the full project: https://github.com/bladeSk/StayFocused – blade Jul 16 '21 at 07:29
  • @blade Amazing! I tried with RegisterShellHookWindow() & SetWindowsHookEx(). I could read SHELL_FLASH message, but not modify or prevent it. This tool works great, the only downside is that it doesn't automatically apply the injection when a new process is created. Also a delayed autostart feature would be nice. – CiriousJoker Jul 16 '21 at 09:16
  • It watches for windows being created, so it should definitely inject the DLL in real time. You should see it in the log. If this doesn't happen, then you're either trying to hook a privileged process or there's a bug in the watcher. – blade Jul 16 '21 at 12:20

1 Answers1

1

Use RegisterShellHookWindow() to intercept and discard HSHELL_FLASH notifications.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 1
    SetWindowsHookEx doesn't appear to intercept HSHELL_FLASH, but RegisterShellHookWindow seems to be what I'm looking for. Any ideas where I could find an example of using it? – blade May 16 '14 at 16:26