PDAのコントロールパネルの接続タブにある、Bluetooth設定メニューの「Bluetoothをオンにする」
のチェックボックスを自動でオンにするプログラムを作りたいのですが、どのようなAPIを使えば
できるのでしょうか?MSDNを見てみたのですがわかりませんでした。
ネイティブAPIであれば、BthSetModeでできるはずなのですが、C#からとなると、専用のクラスまでは用意されていないかもしれません。
その場合は、P/Invokeでインタフェース定義を行う必要はあるかと思いますが、できないことは無いと思います。
例えば、
[DllImport("BthUtil.dll")]
private static extern int BthSetMode(RadioMode dwMode );
[DllImport("BthUtil.dll")]
private static extern int BthGetMode(ref RadioMode dwMode );
/// Bluetooth states.
public enum RadioMode
{
/// Bluetooth off.
Off,
/// Bluetooth is on but not discoverable.
On,
/// Bluetooth is on and discoverable.
Discoverable,
}
すみません、手元に環境がないので動作確認はしていません。
APIいっていうのは、WEBサービスが提供するツールみたいなもんですね。