解决刷卡登录问题

This commit is contained in:
2026-09-03 16:42:44 +08:00
parent f2c645f5b3
commit 84f1a16598
2 changed files with 28 additions and 11 deletions
+4 -2
View File
@@ -82,14 +82,16 @@ namespace JinYuan.Helper
}
private int KeyboardHookProc(int nCode, Int32 wParam, IntPtr lParam)
{
EventMsg msg = (EventMsg)Marshal.PtrToStructure(lParam, typeof(EventMsg));
codes.Add(msg);
if (ScanerEvent != null && msg.message == 13 && msg.paramH > 0 && !string.IsNullOrEmpty(codes.Result))
{
ScanerEvent(codes);
// 返回一个非零值,阻断键盘消息继续向下传递
return 1;
}
return CallNextHookEx(hKeyboardHook, nCode, wParam, lParam);
}
public class ScanerCodes