Work around for missing WiFi members in SystemState class

  • Thread starter Thread starter Holy Samosa
  • Start date Start date
H

Holy Samosa

You'll notice that if you inspect the new WindowsMobile.SystemState
class in the a debugger watch window that the debugger reports three
WiFi-related properties:

WiFiStatePowerOn
WiFiStateConnecting
WiFiStateConnected

Unfortuanatly, (due to oversight?) these members aren't public, so your
..NET application can't use them. Your not out of luck, however, as the
SystemState class is just a wrapper for accessing the registry, so you
can get the values of these members directly from the registry!

These three boolean properties are stored as a bit field at the
following location:
HKEY_LOCAL_MACHINE\System\State\Hardware\Wifi

The properties are bit masked as follows:
2 - WiFiStatePowerOn
8 - WiFiStateConnecting
16 - WiFiStateConnected

Enjoy,
Holy Samosa
 
Back
Top