Note that there are some explanatory texts on larger screens.

plurals
  1. POWifiSignalStrength Basic To Delphi Converstion
    primarykey
    data
    text
    <p>Can someone convert this to Delphi 2010? After not being able to find delphi code to return WiFi Signal Strength I found this basic code. Can someone convert this to Delphi?</p> <pre><code>'************************************** ' Name: WiFi Signal Strength ' Description:Returns the Wifi signal st ' rength in bars (1 to 5, 5 being good) ' By: Techni Rei Myoko ' 'This code is copyrighted and has' limited warranties.Please see http://w ' ww.Planet-Source-Code.com/vb/scripts/Sho ' wCode.asp?txtCodeId=71872&amp;lngWId=1'for details.'************************************** Option Explicit Public WiFiHardwareName As String, WiFiDecibals As Long Dim objWMIService As Object, isSet As Boolean Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long Public Enum ConnectedState INTERNET_CONNECTION_MODEM = &amp;H1 INTERNET_CONNECTION_LAN = &amp;H2 INTERNET_CONNECTION_PROXY = &amp;H4 INTERNET_CONNECTION_MODEM_BUSY = &amp;H8 INTERNET_RAS_INSTALLED = &amp;H10 INTERNET_CONNECTION_OFFLINE = &amp;H20 INTERNET_CONNECTION_CONFIGURED = &amp;H40 End Enum Public Function WifiSignalStrength(Optional Computer As String = ".") As Long On Error Resume Next Dim colItems As Object, objItem As Object WifiSignalStrength = IIf(isConnected, 5, 0) If Not isSet Then Set objWMIService = GetObject("winmgmts:\\" &amp; Computer &amp; "\root\wmi") isSet = True End If Set colItems = objWMIService.ExecQuery("Select * From MSNdis_80211_ReceivedSignalStrength") For Each objItem In colItems WiFiDecibals = objItem.NDIS80211ReceivedSignalStrength WiFiHardwareName = objItem.InstanceName Select Case WiFiDecibals Case 0: WiFiHardwareName = "Ethernet" Case Is &gt; -57: WifiSignalStrength = 5 ' -56 To 0 Case Is &gt; -68: WifiSignalStrength = 4 '-67 To -57 Case Is &gt; -72: WifiSignalStrength = 3 '-71 To -68 Case Is &gt; -80: WifiSignalStrength = 2 '-79 To -72 Case Is &gt; -90: WifiSignalStrength = 1 '-89 To -80 Case Else: WifiSignalStrength = 0 End Select Next End Function 'Connection Public Function isConnected() As Boolean Dim dwFlags As Long, retval As Long retval = InternetGetConnectedState(dwFlags, 0&amp;) isConnected = retval = 1 End Function </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload