4

I need to programmatically identify which applications are registering global hotkeys in Windows 10, specifically to debug conflicts with ShareX's screenshot shortcuts (PrintScreen and Alt+PrintScreen).

enter image description here

Current Situation

  • ShareX shows an error on Windows startup about hotkey registration failing
  • The conflicting shortcuts are:
    • [Print Screen] for capturing entire screen
    • [Alt + Print Screen] for capturing active window

What I'm Looking For

  • A command-line solution (PowerShell/CMD) to list all registered global hotkeys and (preferably) their associated applications
  • Method to identify which application is currently occupying specific keyboard shortcuts
  • Preferably a way to programmatically release/unregister these hotkeys

What I've Tried

  • Manual trial and error of closing applications (not ideal)
  • Basic PowerShell commands like Get-Process (doesn't show hotkey registrations)

Is there a way to query the Windows API or use system tools to get this information? I'm specifically interested in a programmatic solution, not manual debugging steps or third party proprietary software.

Foad
  • 892
  • 4
  • 19
  • 54

1 Answers1

2

In the comments, you mentioned that you are interested in tools that list all active hotkeys, even if such tools do not list which apps are using them (which would certainly be ideal).

One such tool is HotKeysList by Nir Sofer. HotKeysList is freeware (voluntary donations accepted here). It is a portable application (no installation required, and it does not modify your system).

You can use HotKeysList as a CLI or GUI tool. Because you indicated CLI is your preference, I'll provide details for that use: Simply run hotkeyslist.exe with any of the following CLI parameters:

/stext <Filename>    Save the list of registered hot keys into a simple text file.
/stab <Filename>     Save the list of registered hot keys into a tab-delimited text file.
/scomma <Filename>   Save the list of registered hot keys into a comma-delimited text file (csv).
/stabular <Filename> Save the list of registered hot keys into a tabular text file.
/shtml <Filename>    Save the list of registered hot keys into HTML file (Horizontal).
/sverhtml <Filename> Save the list of registered hot keys into HTML file (Vertical).
/sxml <Filename>     Save the list of registered hot keys into XML file. 

Source of above table: https://www.nirsoft.net/utils/hot_keys_list.html

This will export a list of active hotkeys to a file in the specified format. You can then process that output file using any programming language or text processing tools of your choosing. One such tool is GetNir and another is CSVFileView.