Desktop Functions:

   Smart Device Functions:

Show Recent Changes
Subscribe (RSS)
Misc. Pages
Helpful Tools
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
BluetoothFindFirstRadio (irprops)
Start enumerating local bluetooth radios (i.e. the devices plugged into the computer).

C# Signature:

[DllImport("irprops.cpl", SetLastError=true)]
static extern IntPtr BluetoothFindFirstRadio(ref Bluetooth_Find_Radio_Params pbtfrp,out IntPtr phRadio );

User-Defined Types:


VB Signature:

    <DllImport("irprops.cpl", SetLastError:=True, CharSet:=CharSet.Auto)> _
    Private Shared Function BluetoothFindFirstRadio( _
    <[In]()> ByRef findRadioParams As BluetoothFindRadioParams, _
    <Out()> ByRef hRadio As IntPtr) As IntPtr
    End Function

User-Defined Types:

    Private Structure BluetoothFindRadioParams
        Public size As UInteger
        Public Sub Initialize()
                Me.size = Marshal.SizeOf(GetType(BluetoothFindRadioParams))
        End Sub    
    End Structure

Alternative Managed API:


XP SP1 required.

See the BluetoothAPIs.h file in the platform SDK.

Tips & Tricks:

Please add some!

Sample Code:


  class Bluetooth
    public Bluetooth()

        IntPtr firstRadio;
        IntPtr nextRadio;
        nextRadio = BluetoothFindFirstRadio(ref parameters, out firstRadio);

        //work with bluetooth
    /// <summary>
    /// The BLUETOOTH_FIND_RADIO_PARAMS structure facilitates enumerating installed Bluetooth radios.
    /// </summary>
        internal UInt32 dwSize;
        internal void Initialize()
        this.dwSize = (UInt32)Marshal.SizeOf(typeof(BLUETOOTH_FIND_RADIO_PARAM));

    /// <summary>
    /// Closes an open object handle.
    /// </summary>
    /// <param name="handle">[In] A valid handle to an open object.</param>
    /// <returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>
    [DllImport("Kernel32.dll", SetLastError = true)]
    static extern bool CloseHandle(IntPtr handle);

    /// <summary>
    /// Finds the first bluetooth radio present in device manager
    /// </summary>
    /// <param name="pbtfrp">Pointer to a BLUETOOTH_FIND_RADIO_PARAMS structure</param>
    /// <param name="phRadio">Pointer to where the first enumerated radio handle will be returned. When no longer needed, this handle must be closed via CloseHandle.</param>
    /// <returns>In addition to the handle indicated by phRadio, calling this function will also create a HBLUETOOTH_RADIO_FIND handle for use with the BluetoothFindNextRadio function.
    /// When this handle is no longer needed, it must be closed via the BluetoothFindRadioClose.
    /// Returns NULL upon failure. Call the GetLastError function for more information on the error. The following table describe common errors:</returns>
    [DllImport("irprops.cpl", SetLastError = true)]
    static extern IntPtr BluetoothFindFirstRadio(ref BLUETOOTH_FIND_RADIO_PARAM pbtfrp, out IntPtr phRadio);


Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version