I am working on a project where it is necessary to simulate key-presses to cause specific behaviours in a different application.
All is running well and fine, using
I found this here works for me !
protected override void WndProc(ref Message m)
{
if (m.Msg == 256 && m.WParam.ToInt32() == 13)
{ // WM_KEYDOWN == 256, Enter == 13
if ((m.LParam.ToInt32() >> 24) == 0)
{
MessageBox.Show("main enter pressed!");
}
else
{
MessageBox.Show("numpad enter pressed!");
}
}
else
{
base.WndProc(ref m);
}
}