How to disconnect a Bluetooth (not LE) device from windows computer in UWP/.NetCore/etc.?

Marjan Khan 25 Reputation points
2023-04-02T11:02:17.5733333+00:00

I have a Bluetooth device connected to my computer. The following is the state of the device in Bluetooth & Other Devices list. I want to disconnect it from the computer using any API of desktop/UWP app (e.g., IOCTL etc.).

Capture

So I want to make it to the following state programmatically:

Capture

How can I do that?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,480 questions
Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Roy Li - MSFT 32,491 Reputation points Microsoft Vendor
    2023-04-13T01:43:05.3733333+00:00

    Hello, Welcome to Microsoft Q&A!

    This is a summary for the question so that other people who are facing the same issue could check. A workaround is to use the IOCTL_BTH_DISCONNECT_DEVICE IOCTL. It's a win32 API comes from bthioctl.h. This API could disconnect the Bluetooth device from the computer.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful