I am looking for something to close my program that is running in the background with a key press (on a keyboard).
I tried playing with the Key Press event, but this only works when the form is selected/active. When you alt tab it doesn't read the keys :/
private void Test_KeyPress(object sender, KeyPressEventArgs e)
{
g_StopFlag = true;
}
Is there any way for it to fire without form being selected? Any help would be appreciated!
PS: I am using C#