Get the key pressed with minimized or unfocused application C #

3

I would like that by pressing PrintScreen on the keyboard, the C # application that is minimized in the tray system would be maximized and display the print .

    
asked by anonymous 30.06.2015 / 02:22

1 answer

4

I do not think there is an easy way to do this, but this (using windows message to implement Global System Hook in C #) might help. I've added the code below

 _GlobalHooks.Keyboard.KeyboardEvent += (w, l) => 
{
      this.LblKey.Text = "KEY: " + w.ToInt32().ToString("X8") + " " + l.ToInt32().ToString("X8");
};
_GlobalHooks.Keyboard.Start();

for the GlobalHookTest Form1 constructor and was able to monitor all keyboard events.

In this Git has a complete project using Global System Hook in C # link

    
30.06.2015 / 13:47