doc/devdocs/modules/shortcut_guide.md
Public overview - Microsoft Learn
Shortcut Guide is a PowerToy that displays an overlay of available keyboard shortcuts when a user-set keyboard shortcut is pressed. It helps users discover and remember keyboard shortcuts for Windows and apps.
[!NOTE] The spec for the manifest files is in development and will be linked here once available.
[!NOTE] When run in debug mode, the window behaves differently than in release mode. It will not automatically close when loosing focus, it will be displayed on top of all other windows, and it is not hidden from the taskbar.
The Shortcut Guide module consists of the following 4 projects:
ShortcutGuide.Ui](/src/modules/ShortcutGuide/ShortcutGuide.Ui/ShortcutGuide.Ui.csprojThis is the main UI project for the Shortcut Guide module. Upon startup it does the following tasks:
index.yml manifest file.excluded_app.cppThis file contains one function with the following signature:
__declspec(dllexport) bool IsCurrentWindowExcludedFromShortcutGuide()
This function checks if the current window is excluded from the Shortcut Guide overlay. It returns true if the current window is excluded otherwise it returns false.
tasklist_positions.cppThis file contains helper functions to retrieve the positions of the taskbar buttons. It exports the following function:
__declspec(dllexport) TasklistButton* get_buttons(HMONITOR monitor, int* size)
This function retrieves the positions of the taskbar buttons for a given monitor. It returns an array of TasklistButton structures (max 10), which contain the position and size of each button.
monitor must be the monitor handle of the monitor containing the taskbar instance of which the buttons should be retrieved.
size will contain the resulting array size.
It determines the positions through Windows FindWindowEx function.
For the primary taskbar it searches for:
For any secondary taskbar it searches for:
It then enumerates all the button elements inside "MSTaskListWClass" while skipping such with a same name (which implies the user does not use combining taskbar buttons)
If this method fails, which it will for newer versions of Windows, it falls back to searching for:
It then enumerates all the button elements inside the selected while skipping such with a same name (which implies the user does not use combining taskbar buttons) and such that do not start with "Appid:" (which are not actual taskbar buttons related to apps, but others like the widgets or the search button).
ShortcutGuide.IndexYmlGeneratorThis application generates the index.yml manifest file.
It is a separate project so that its code can be easier ported to WinGet in the future.
ShortcutGuideModuleInterfaceThe module interface that handles opening and closing the user interface.