You may be able to do this with a reg key setting instead of an app an a big library.
check this registry key for its value, and change it to 0, that will enable your radio.
;InitialState is a dword represent CEDEVICE_POWER_STATE, valid values
;are: 0 - D0, 1 - D1, 2 - D2, 3 - D3, 4 - D4.
"InitialState"=dword:0 ; D4, changed default to OFF, product team to override if needed
Hi Chris and thanks for your message.
I tried this but it's not dynamic; I need to dynamically turn off and ON the WiFi card.
Tested registry but a reboot is required.
Thanks for your comments.
You can just deploy the dlls you need, you don't need to deploy the whole symbol cab file. If you have debugged the app, the dlls you need are probably in the same folder on the device as the executable is.
If you really just need to turn the radio on and off, you don't need our dlls for that. You can use some code like below.
private static extern uint CEDevicePowerNotify(string Device, uint DeviceState, uint Flags);
public int DevicePowerNotify( string deviceName, DevicePowerStates deviceState )
uint nError = 0;
nError = CEDevicePowerNotify( deviceName, (uint)deviceState, (uint)PowerReqFlags.POWER_NAME );
public enum DevicePowerStates
PwrDeviceUnspecified = -1,
FullOn = 0,// Full On: full power, full functionality
D0 = FullOn,
LowOn,// Low Power On: fully functional at low power/performance
D1 = LowOn,
StandBy,// Standby: partially powered with automatic wake
D2 = StandBy,
Sleep,// Sleep: partially powered with device initiated wake
D3 = Sleep,
Off,// Off: unpowered
D4 = Off,
public enum PowerReqFlags : uint
POWER_NAME = 0x00000001,
POWER_FORCE = 0x00001000,
private void btnON_Click(object sender, System.EventArgs e)
private void btnOFF_Click(object sender, System.EventArgs e)