|
-
April 24th, 2001, 03:09 PM
#1
detect if dial up is idle
-
April 24th, 2001, 07:26 PM
#2
Re: detect if dial up is idle
not sure whether this is the best, but it work for me.
Declare Function RasEnumConnections Lib "rasapi32.dll" Alias "RasEnumConnectionsA" (lprasconn as Any, lpcb as Long, lpcConnections as Long) as Long
public Type RASCONN
dwSize as Long
hRasConn as Long
szEntryName as string * RAS_MaxEntryName
szDeviceType as string * RAS_MaxDeviceType
szDeviceName as string * RAS_MaxDeviceName
End Type
public Function IsDialUpIdle() as Long
Dim conn(255) as RASCONN
Dim bufferSize as Long
Dim noOfConn as Long
bufferSize = 105472 '256 * 412
conn(0).dwSize = 412
vbDLLErrorCode = RasEnumConnections(conn(0), bufferSize, noOfConn)
If vbDLLErrorCode = ERROR_SUCCESS And noOfConn = 0 then
IsDialUpIdle = VB_TRUE 'yap, it's idle
ElseIf vbDLLErrorCode = 0 then
IsDialUpIdle = VB_FALSE 'got connection
else
IsDialUpIdle = VB_DLL_ERROR 'RasEnumConnections error
End If
End Function
HTH
cksiow
http://vblib.virtualave.net - share our codes
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|