home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD14743292001.psc / tapiCallBack.bas < prev    next >
Encoding:
BASIC Source File  |  2001-02-10  |  2.0 KB  |  56 lines

  1. Attribute VB_Name = "tapiCallBack"
  2. Option Explicit
  3. Global CallInfo As LINECALLINFO
  4.  
  5. Public Sub LINECALLBACK(ByVal hDevice As Long, ByVal dwMessage As Long, ByVal dwInstance As Long, ByVal dwParam1 As Long, ByVal dwParam2 As Long, ByVal dwParam3 As Long)
  6.  
  7.     'Handels messages from Tapi32
  8.     
  9.     Dim strTemp As String
  10.     Dim hCall As Long
  11.     
  12.     If dwMessage = LINE_CALLSTATE Then
  13.        hCall = PtrToLong(hDevice)
  14.        Select Case dwParam1
  15.           Case LINECALLSTATE_IDLE 'Call Terminated
  16.             If hCall <> 0 Then
  17.              lineDeallocateCall (hCall)
  18.              frmTapiMon.lstStatus.AddItem ("Idle")
  19.              frmTapiMon.lstStatus.TopIndex = _
  20.              frmTapiMon.lstStatus.ListCount - 1
  21.             End If
  22.           Case LINECALLSTATE_DIALING ' Call Dialing
  23.              frmTapiMon.lstStatus.AddItem ("Dialing Call")
  24.              frmTapiMon.lstStatus.TopIndex = _
  25.              frmTapiMon.lstStatus.ListCount - 1
  26.           Case LINECALLSTATE_CONNECTED 'Service Connected
  27.             If hCall <> 0 Then
  28.              frmTapiMon.lstStatus.AddItem ("Connected")
  29.              frmTapiMon.lstStatus.TopIndex = _
  30.              frmTapiMon.lstStatus.ListCount - 1
  31.              CallInfo.dwTotalSize = 4096
  32.             End If
  33.           Case LINECALLSTATE_PROCEEDING 'Call Proceeding (dialing)
  34.             frmTapiMon.lstStatus.AddItem ("Proceeding")
  35.             frmTapiMon.lstStatus.TopIndex = _
  36.             frmTapiMon.lstStatus.ListCount - 1
  37.           Case LINECALLSTATE_DISCONNECTED 'Disconnected
  38.             frmTapiMon.lstStatus.AddItem ("Disconnected")
  39.             frmTapiMon.lstStatus.TopIndex = _
  40.             frmTapiMon.lstStatus.ListCount - 1
  41.           Case LINECALLSTATE_BUSY 'Line Busy
  42.             frmTapiMon.lstStatus.AddItem ("Line Busy")
  43.             frmTapiMon.lstStatus.TopIndex = _
  44.             frmTapiMon.lstStatus.ListCount - 1
  45.            
  46.        End Select
  47.    End If
  48. End Sub
  49.  
  50. Public Function PtrToLong(ByVal lngFnPtr As Long) As Long
  51. 'Convert Pointer into Long
  52.     PtrToLong = lngFnPtr
  53. End Function
  54.  
  55.  
  56.