使用 Win 7 或 Win 10 配对蓝牙设备时抑制系统对话框 [英] Supressing System Dialog when pairing Bluetooth devices using Win 7 or Win 10

查看:26
本文介绍了使用 Win 7 或 Win 10 配对蓝牙设备时抑制系统对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用foot32库成功自动将蓝牙设备与Win 7和Win 10配对.不幸的是,出现了一个系统对话框,说点击配对"在 Win 7 下,如果我点击该对话框,它就会配对.在 Win 10 下,如果我不触摸对话框,它不会配对.实际上,有一个 Win 10 选项,可以关闭对话框,但也不会发生配对.在 Win 7 下会调用 handlerequests,而在 Win 10 下则不会.

I am successfully automatically pairing Bluetooth device against Win 7 and Win 10, using feet32 Library. Unfortunately a System Dialog shows up, saying "tap to pair" Under Win 7 it pairs if I Tap the Dialog or not. Under Win 10 it does not pair, if I do not touch the dialog. Actually, there is a Win 10 option, that switches off the dialog, but then no pairing takes place also. Under Win 7 handlerequests is called, under Win 10 it is not.

在 Win 7 下,它无论如何都是配对的.

Under Win 7 it pairs anyway.

Dim  pairer As New BluetoothWin32Authentication(AddressOf handleRequests ) 

Public Sub handleRequests(ByVal thing As Object, ByVal args As BluetoothWin32AuthenticationEventArgs)        
    args.Confirm = True
End Sub

Protected Function TryRemember(ByVal peer As BluetoothDeviceInfo) As Boolean
    If peer Is Nothing Then Return False        
    Return BluetoothSecurity.PairRequest(peer.DeviceAddress, Nothing )
End Function

推荐答案

没有简单的方法可以做到这一点.然而,我们的蓝牙框架可以通过使用未记录的方式来做到这一点.适用于任何 Windows 平台.

There is no easy way to do that. However our Bluetooth Framework can do that by using undocumented way. Works on any Windows platform.

我不能分享代码,但我可以给你想法.您必须禁用身份验证代理.

I can not share the code but I can give you the idea. You have to disable Authentication Agent.

这篇关于使用 Win 7 或 Win 10 配对蓝牙设备时抑制系统对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆