Hi,
this is my way to detect the Wlan-state. It works only on devices!
Tested for WM5.0 and WM6.5
.
.
.
reg.New1
reg.RootKey(reg.rtLocalMachine)
.
.
x=getWlanState
If x = 0 Then
Msgbox(" no WlanCard!",cMsgboxOK,cMsgboxAsterisk)
End If
If x = 1 Then
Msgbox(" Wlan is disabled!",cMsgboxOK,cMsgboxAsterisk)
End If
If x = 19 Then
Msgbox(" Wlan is OK!",cMsgboxOK,cMsgboxAsterisk)
End If
.
.
.
Sub getWlanState
'HKEY_LOCAL_MACHINE\System\State\Hardware\Wifi (0 not present, 1 disabled, 19 enabled)
wlan=0
If cPPC Then
regnames() = reg.GetValueNames("System\State\Hardware\")
For i = 0 To ArrayLen(regnames())-1 'Show all values found
If regnames(i)="Wifi" Then
wlan = reg.GetValue("System\State\Hardware\", "Wifi")
End If
Next
End If
return wlan
End Sub
this is my way to detect the Wlan-state. It works only on devices!
Tested for WM5.0 and WM6.5
.
.
.
reg.New1
reg.RootKey(reg.rtLocalMachine)
.
.
x=getWlanState
If x = 0 Then
Msgbox(" no WlanCard!",cMsgboxOK,cMsgboxAsterisk)
End If
If x = 1 Then
Msgbox(" Wlan is disabled!",cMsgboxOK,cMsgboxAsterisk)
End If
If x = 19 Then
Msgbox(" Wlan is OK!",cMsgboxOK,cMsgboxAsterisk)
End If
.
.
.
Sub getWlanState
'HKEY_LOCAL_MACHINE\System\State\Hardware\Wifi (0 not present, 1 disabled, 19 enabled)
wlan=0
If cPPC Then
regnames() = reg.GetValueNames("System\State\Hardware\")
For i = 0 To ArrayLen(regnames())-1 'Show all values found
If regnames(i)="Wifi" Then
wlan = reg.GetValue("System\State\Hardware\", "Wifi")
End If
Next
End If
return wlan
End Sub