honestman
asked on
How to obtain the info of modem installed in my OS?
I want to know what modem had been installed in my os, and their state.
Some people said that they had been saved in register.
But my USB modem can be check in real time by os.
How to obtain the state of my USB modem?
Some people said that they had been saved in register.
But my USB modem can be check in real time by os.
How to obtain the state of my USB modem?
http://www-level3.experts-exchange.com/questions/20681559/MSComm-Port-Already-Open.html
to see if modem is connected
Return True if the modem is connected.
' (Actually this also returns False if there is
' an error reading the registry.)
Function ModemIsConnected() As Boolean
Dim result As Long
Dim hKey As Long
Dim lpSubKey As String
Dim phkResult As Long
Dim lpValueName As String
Dim lpReserved As Long
Dim lpType As Long
Dim lpData As Long
Dim lpcbData As Long
ModemIsConnected = False
lpSubKey = _
"System\CurrentControlSet\ Services\R emoteAcces s"
If RegOpenKey(HKEY_LOCAL_MACH INE, lpSubKey, phkResult) _
<> ERROR_SUCCESS Then Exit Function
hKey = phkResult
lpValueName = "Remote Connection"
lpReserved = APINULL
lpType = APINULL
lpData = APINULL
lpcbData = APINULL
If RegQueryValueEx(hKey, lpValueName, lpReserved, _
lpType, ByVal lpData, lpcbData) _
<> ERROR_SUCCESS _
Then
RegCloseKey hKey
Exit Function
End If
lpcbData = Len(lpData)
If RegQueryValueEx(hKey, lpValueName, lpReserved, _
lpType, lpData, lpcbData) _
<> ERROR_SUCCESS _
Then
RegCloseKey hKey
Exit Function
End If
ModemIsConnected = (lpData <> 0)
RegCloseKey hKey
End Function
Return True if the modem is connected.
' (Actually this also returns False if there is
' an error reading the registry.)
Function ModemIsConnected() As Boolean
Dim result As Long
Dim hKey As Long
Dim lpSubKey As String
Dim phkResult As Long
Dim lpValueName As String
Dim lpReserved As Long
Dim lpType As Long
Dim lpData As Long
Dim lpcbData As Long
ModemIsConnected = False
lpSubKey = _
"System\CurrentControlSet\
If RegOpenKey(HKEY_LOCAL_MACH
<> ERROR_SUCCESS Then Exit Function
hKey = phkResult
lpValueName = "Remote Connection"
lpReserved = APINULL
lpType = APINULL
lpData = APINULL
lpcbData = APINULL
If RegQueryValueEx(hKey, lpValueName, lpReserved, _
lpType, ByVal lpData, lpcbData) _
<> ERROR_SUCCESS _
Then
RegCloseKey hKey
Exit Function
End If
lpcbData = Len(lpData)
If RegQueryValueEx(hKey, lpValueName, lpReserved, _
lpType, lpData, lpcbData) _
<> ERROR_SUCCESS _
Then
RegCloseKey hKey
Exit Function
End If
ModemIsConnected = (lpData <> 0)
RegCloseKey hKey
End Function
ASKER
To Mikal613:
You have misunderstood my meaning.
I do not want to know whether my system is connected to internet, I only wonder whether the USB modem is connected to my machine. I want to know what modem drivers are installed in my Win2000.
You have misunderstood my meaning.
I do not want to know whether my system is connected to internet, I only wonder whether the USB modem is connected to my machine. I want to know what modem drivers are installed in my Win2000.
ASKER
In "control panel" -> "phone and modem options" -> "Modems", It lists "The following modems are installed".
I want to know how to obtain this info in my program???
I want to know how to obtain this info in my program???
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.