procedure TForm1.Button3Click(Sender: TObject);
var
//radio
FirstRadio:PBlueToothFindRadioParams;
RadioHandle:THANDLE ;
NextRadio:THANDLE;
FoundNextRadioHandle:BOOL;
RadioDeviceInfo:BLUETOOTH_RADIO_INFO;
dw:DWORD;
//device
DeviceHandle:HBLUETOOTH_DEVICE_FIND;
DeviceInfo:BLUETOOTH_DEVICE_INFO;
SearchParams:BLUETOOTH_DEVICE_SEARCH_PARAMS;
FoundDevice:BOOL;
FoundDeviceInfo:BLUETOOTH_DEVICE_INFO;
begin
BluetoothFindFirstRadio(FirstRadio,RadioHandle);
if(RadioHandle = NULL)
then
begin
showmessage('
Problems Creating Radio Handle');
end;
FoundNextRadioHandle:= BluetoothFindNextRadio(RadioHandle,NextRadio);
if(FoundNextRadioHandle = TRUE)
then
begin
showmessage('
Found Another Bluetooth Radio');
end
else
begin
showmessage('
Only One Bluetooth Radio Handle Present');
end;
BluetoothGetRadioInfo(RadioHandle,RadioDeviceInfo);
dw:= GetLastError();
showmessage(inttostr(dw));
SearchParams.dwSize:= sizeof(BLUETOOTH_DEVICE_SEARCH_PARAMS);
SearchParams.fReturnAuthenticated:= TRUE;
SearchParams.fReturnRemembered:= TRUE;
SearchParams.fReturnUnknown:= TRUE;
SearchParams.fReturnConnected:= TRUE;
SearchParams.fIssueInquiry:= TRUE;
SearchParams.cTimeoutMultiplier:= 10;
SearchParams.hRadio:= RadioHandle;
BluetoothFindFirstDevice(SearchParams,DeviceInfo);
showmessage(btadresstostr(DeviceInfo.Address));
showmessage(DeviceInfo.szName);
dw:= GetLastError();
showmessage(inttostr(dw));
FoundDevice:= BluetoothFindNextDevice(DeviceHandle,FoundDeviceInfo);
dw:= GetLastError();
showmessage(inttostr(dw));
end;