question

AhsanSadeeb-6722 avatar image
0 Votes"
AhsanSadeeb-6722 asked NicoZhu-MSFT edited

How to get clicked button from windows bluetooth pairing popup?

I am using the UWP Bluetooth API to pair with another Bluetooth device. When i try to pair windows gives a popup asking if i wanted to Pair or Cancel. Is there any way to detect which button (Pair or Cancel) from the popup was clicked from my application?

windows-uwp
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you have any updates for this thread ? And the following answer works ? If the response is helpful, please click "Accept Answer" and upvote it.

0 Votes 0 ·

1 Answer

NicoZhu-MSFT avatar image
0 Votes"
NicoZhu-MSFT answered

Hello, Welcome to Micorosoft Q&A,

How to get clicked button from windows bluetooth pairing popup?

If you were using basic pair that call PairAsync method directly, it's hard to detect the Pair or Cancel button click, because it's system leave window, and it has not event to notice the button clicked, you just detect the
check result of PairAsync method like this line .


However, if you use customPairing like official code sample scenario 9, you could detect the Pair button click from PairingRequested event, and if you cancel the process, you could detect above the cancel behavior from result like this line.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.