0
我期待着找到一种方法来阻止我的消息继续进行或换句话说,使其处理。如何停止FilterMessage进一步处理?
说,光标位置是在文本框,我正在扫描条形码“#保存#”。我认识到使用WindowProc这是条形码文本,我处理保存文本(通过保存我的表单),但现在我不想在文本框中写入此文本(“#保存#”)。
所以在短句中我正在寻找属性或方法来说窗口这个文本(输入)被处理,不要做任何进一步的操作。
HwndSource source = (HwndSource)PresentationSource.FromDependencyObject(this);
source.AddHook(WindowProc);
private IntPtr WindowProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if(device == barcode)
{
......
.....
//Did some action
//tried to stop msg to follow further in loop, but not working
handled ==true;
}
return IntPtr.Zero;
}