title: system-wide hot keys -- how to detect global keyboard shortcuts programmatically?
body: <p><strong>QUESTION</strong></p>
  
  <p>How does one programmatically interrogate Win7 to get a list of <strong>all</strong> currently active global keyboard shortcuts?</p>
  
  <p><strong>Scenario</strong></p>
  
  <p>In many versions of Windows there is the so called <a href="http://en.wikipedia.org/wiki/Windows_key" rel="nofollow">"Windows Key"</a>, a.k.a. "flag", "start key", <em>et cetera</em>.</p>
  
  <p>Microsoft has a support article <a href="http://support.microsoft.com/kb/126449" rel="nofollow">"Keyboard shortcuts for Windows"</a> that lists many of these under the section "Microsoft Natural Keyboard keys", as well as many others the do not involve using the <a href="http://en.wikipedia.org/wiki/Windows_key" rel="nofollow">"Windows Key"</a> such as the global <kbd>Ctrl</kbd>+<kbd>C</kbd>, <em>et cetera</em>.</p>
  
  <p>Other keyboard shortcuts can be discovered by accident. For example, <a href="http://en.wikipedia.org/wiki/Windows_key" rel="nofollow">Windows Key</a> + <kbd>Left arrow</kbd> or <kbd>Right arrow</kbd> in Win7 moves the focused window around the display, and, with multiple monitors, from one display to the next.</p>
  
  <p>Still other keyboard shortcuts can be found in the "options" settings, for example, Left-<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>K</kbd> is the <em>default</em> for "<em>Show KeePass Window</em>".</p>
  
  <p>Additionally, there may be hardware specific keyboard shortcuts, for example, on my laptop, <kbd>Fn</kbd>+<kbd>F8</kbd> toggles speaker muting.</p>
  
  <p><strong>Stolen Keyboard Shortcuts</strong></p>
  
  <p>When <strong><a href="http://www.techsmith.com/snagit.html" rel="nofollow">Snagit</a></strong> is running, I've configured <kbd>PrtSc</kbd> as my shortcut, <em>but</em> when Visual Studio(VS) is running, it steals <kbd>PrtSc</kbd> from <strong><a href="http://www.techsmith.com/snagit.html" rel="nofollow">Snagit</a></strong>.</p>
  
  <p><strong>Two time consuming methods of manually discovered keyboard shortcuts</strong></p>
  
  <p>(a) Global keyboard shortcuts can be discovered by having only the desktop and a couple of windows open and trying various key combinations.</p>
  
  <p>(b) in VS, many VS keyboard shortcuts can be discovered by trying various combinations in the keyboard shortcuts window where, if a combination is already used, VS will notify one about the current usage for that combination.</p>
  
  <p><strong>Two reasons for wanting to discover all currently active global keyboard shortcuts</strong></p>
  
  <p>(a) to avoid annoying accidents like <a href="http://en.wikipedia.org/wiki/Windows_key" rel="nofollow">Windows Logo Key</a>+<kbd>L</kbd> which locks the computer.</p>
  
  <p>(b) to determine which keys are currently still available for assignment.</p>