Author Topic: [BUG] Ctrl+Esc and different desktops  (Read 810 times)


  • Administrator
  • Hero Member
  • *****
  • Posts: 1525
[BUG] Ctrl+Esc and different desktops
« on: May 17, 2018, 09:34:26 am »
As you probably know you can open Start menu with not just pressing Win button on your keyboard, but also with Ctrl+Esc shortcut. They both send WM_SYSCOMMAND with SC_TASKLIST parameter. But Ctrl+Esc is a shortcut, so when undocumented SetShellWindow API function is called to tell Windows that it's the shell, RegisterHotKey registers that shortcut for shell window. And if you have several desktops (I don't mean ReHIPS isolated desktops here, any desktops, e.g. Desktops program from former Sysinternals creates several desktops), you won't observe the same behavior on other than main desktops.

The problem is SetShellWindow should be called for every desktop as it works desktop-wise. But RegisterHotKey works system-wise. So only the first shell will be able to register the shortcut successfully, all subsequent calls from other shells will fail, so the first shell'll be the only one to receive shortcut notifications.