I want to use a Shortcut in a Windows Form App and found the following code.
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
if (keyData == (Keys.Enter)) {
MessageBox.Show("Hello World!");
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
But this only works, if the window is active. How can I use the shortcut even if a different window is active?