In my C# application, I am using a MessageFilter for a global key hook as suggested by T Perquin.
This is my current code:
class KeyboardMessageFilter : IMessageFilter
{
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == ((int)Helper.WindowsMessages.WM_KEYDOWN))
{
switch ((int)m.WParam)
{
case (int)Keys.Escape:
// Do Something
return true;
case (int)Keys.Right:
// Do Something
return true;
case (int)Keys.Left:
// Do Something
return true;
}
}
return false;
}
}
When I try to compile and run (to make sure the syntax's are correct), I get this error: The name 'Helper' does not exist in the current context
.
What exactly is 'Helper' and how do I fix this error?