Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
I was trying to implement a feature which involves turning off Bluetooth permanently but user should not be able to turn it on manually until i enable through code, But i was unable to achieve this as Bluetooth API only provide option to disconnect on temporary basis.
Please let me know any ways achieving the same through C/C++ code.
OS: Windows 8.1

Or

Turn off connected bluetooth device permanently where in if user tries to connect back bluetooth radio should not allow to do it.
Posted
Updated 23-Jun-15 20:14pm
v2
Comments
Suvendu Shekhar Giri 24-Jun-15 0:48am    
What have you tried so far? Can you share your code here so that someone can help resolving your problem.
[no name] 24-Jun-15 0:49am    
So you think your rogue program should have more authority than the user - cute. Fortunately Windows protects the user from this type of virus.
Darshan VC 24-Jun-15 1:32am    
Hi giri,

I did not find any solution to do the above mentioned but i tried the example in below mentioned link
http://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedotherprotocol4k.html[^]

from which i was able to get radio and connected device information.
Case 1:
I tried to disable the connected bluetooth device via API BluetoothRemoveDevice but this disconnection is temporary
case 2:
Tried to get trigger back whenever there is change in bluetooth connection so that i can run my application if the disconnected device tries to connect but this also went in vain as there are no logs generated in windows events.
case 3:
As above cases did not work, at least i just wanted to try above mentioned part.

Hope you got my point.
Darshan VC 24-Jun-15 1:34am    
Hi pwasser
Thank you for your great effort in solving my problem
Stefan_Lang 24-Jun-15 2:10am    
If a program can disable something, another program will be able to enable it again, provided it runs with the same rights and level of access. Therefore what you want is logically impossible.

There's no way short of physically tampering with the device.

Any attempt to achieve something similar by disabling the device on every log on would be considered a virus and a security hole, and any OS worth it's salt would fix that security hole ASAP - i. e. whatever enabled the program to do such a thing would be blocked in an update.

1 solution

There is no feature which allows you to disable bluetooth, or WiFi, or the LAN connection permanently: they are all re-enabled the next time the operating system is started so that the user has control over them.

If you want to "permanently" disable something, then your app will have to run before the user logs in and temporarily disable it (and probably keep watching to see if it gets re-enabled as well).

But this kind of application smells malicious: so I'll not help you with any code.
 
Share this answer
 
Comments
Darshan VC 24-Jun-15 1:48am    
If any solution to disable connected device permanently or any way to get the trigger whenever there is a connection change(Disconnect/Connection) will help me in resolving my issue.
Stefan_Lang 24-Jun-15 2:11am    
Totally agree, I smell the same thing. Have a 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900