I am able to hook(Global Keyboard hook) ALT key in a winform(c#) application. The code is given below.
if ((ModifierKeys == Keys.Alt) && Keys.P == (Keys) vkCode)
{
SendKeys.Send("Test");
//MessageBox.Show("test");
return (IntPtr) 1;
}
If I comment out SendKeys line and uncomment MessageBox line then I can see the messagebox if Alt+P is pressed. But SendKeys.Send doesn't work. Why? But if instead of Alt key if I hook Control or Shift key then there is no problem with SendKeys Command.