Am I correct in understanding the barcode scanner acts like a second keyboard, in effect 'typing' the value of the barcode? How do you/do you need to distinguish between input on the keyboard and input from the scanner?
Next question is are you in WPF or WinForms? If its the latter, sounds like you want to intercept the keystrokes early on, at a form level. Are there other controls which accept keyboard input?
You can use something like this to capture all keystrokes at form level:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (msg.Msg == 0x100)
{
}
return base.ProcessCmdKey(ref msg, keyData);
}