ホーム › Devices.Bluetooth › BluetoothEnableDiscovery
BluetoothEnableDiscovery
関数ローカルラジオの検出可能状態を有効または無効にする。
シグネチャ
// BluetoothApis.dll
#include <windows.h>
BOOL BluetoothEnableDiscovery(
HANDLE hRadio, // optional
BOOL fEnabled
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hRadio | HANDLE | inoptional |
| fEnabled | BOOL | in |
戻り値の型: BOOL
各言語での呼び出し定義
// BluetoothApis.dll
#include <windows.h>
BOOL BluetoothEnableDiscovery(
HANDLE hRadio, // optional
BOOL fEnabled
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("BluetoothApis.dll", ExactSpelling = true)]
static extern bool BluetoothEnableDiscovery(
IntPtr hRadio, // HANDLE optional
bool fEnabled // BOOL
);<DllImport("BluetoothApis.dll", ExactSpelling:=True)>
Public Shared Function BluetoothEnableDiscovery(
hRadio As IntPtr, ' HANDLE optional
fEnabled As Boolean ' BOOL
) As Boolean
End Function' hRadio : HANDLE optional
' fEnabled : BOOL
Declare PtrSafe Function BluetoothEnableDiscovery Lib "bluetoothapis" ( _
ByVal hRadio As LongPtr, _
ByVal fEnabled As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
BluetoothEnableDiscovery = ctypes.windll.bluetoothapis.BluetoothEnableDiscovery
BluetoothEnableDiscovery.restype = wintypes.BOOL
BluetoothEnableDiscovery.argtypes = [
wintypes.HANDLE, # hRadio : HANDLE optional
wintypes.BOOL, # fEnabled : BOOL
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('BluetoothApis.dll')
BluetoothEnableDiscovery = Fiddle::Function.new(
lib['BluetoothEnableDiscovery'],
[
Fiddle::TYPE_VOIDP, # hRadio : HANDLE optional
Fiddle::TYPE_INT, # fEnabled : BOOL
],
Fiddle::TYPE_INT)#[link(name = "bluetoothapis")]
extern "system" {
fn BluetoothEnableDiscovery(
hRadio: *mut core::ffi::c_void, // HANDLE optional
fEnabled: i32 // BOOL
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("BluetoothApis.dll")]
public static extern bool BluetoothEnableDiscovery(IntPtr hRadio, bool fEnabled);
"@
$api = Add-Type -MemberDefinition $sig -Name 'BluetoothApis_BluetoothEnableDiscovery' -Namespace Win32 -PassThru
# $api::BluetoothEnableDiscovery(hRadio, fEnabled)#uselib "BluetoothApis.dll"
#func global BluetoothEnableDiscovery "BluetoothEnableDiscovery" sptr, sptr
; BluetoothEnableDiscovery hRadio, fEnabled ; 戻り値は stat
; hRadio : HANDLE optional -> "sptr"
; fEnabled : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "BluetoothApis.dll"
#cfunc global BluetoothEnableDiscovery "BluetoothEnableDiscovery" sptr, int
; res = BluetoothEnableDiscovery(hRadio, fEnabled)
; hRadio : HANDLE optional -> "sptr"
; fEnabled : BOOL -> "int"; BOOL BluetoothEnableDiscovery(HANDLE hRadio, BOOL fEnabled)
#uselib "BluetoothApis.dll"
#cfunc global BluetoothEnableDiscovery "BluetoothEnableDiscovery" intptr, int
; res = BluetoothEnableDiscovery(hRadio, fEnabled)
; hRadio : HANDLE optional -> "intptr"
; fEnabled : BOOL -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
bluetoothapis = windows.NewLazySystemDLL("BluetoothApis.dll")
procBluetoothEnableDiscovery = bluetoothapis.NewProc("BluetoothEnableDiscovery")
)
// hRadio (HANDLE optional), fEnabled (BOOL)
r1, _, err := procBluetoothEnableDiscovery.Call(
uintptr(hRadio),
uintptr(fEnabled),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction BluetoothEnableDiscovery(
hRadio: THandle; // HANDLE optional
fEnabled: BOOL // BOOL
): BOOL; stdcall;
external 'BluetoothApis.dll' name 'BluetoothEnableDiscovery';result := DllCall("BluetoothApis\BluetoothEnableDiscovery"
, "Ptr", hRadio ; HANDLE optional
, "Int", fEnabled ; BOOL
, "Int") ; return: BOOL●BluetoothEnableDiscovery(hRadio, fEnabled) = DLL("BluetoothApis.dll", "bool BluetoothEnableDiscovery(void*, bool)")
# 呼び出し: BluetoothEnableDiscovery(hRadio, fEnabled)
# hRadio : HANDLE optional -> "void*"
# fEnabled : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。