473,657 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tapiRequestMake Call - How to customize behavior?

The below code dials a phone number when the subform datasheet cell
containing the number is double clicked. The problem is that the dialer
application (c:\windows\dia ler.exe) pops up windows on the screen, requiring
user intervention to click "Talk" or "Hang Up". I want to customize the
behavior of the application so that no pop ups are received and the
application drops the line automatically and closes itself in 6 seconds -
which is enough time for the user to pick up the phone. The user will hear
the modem dial, but no other screen alerts will be received. If the phone
is not picked up with the 6-second window, the call is simply dropped.

Perhaps I need to write my own custom version of TAPI32.DLL? Or is there a
way to customize the behavior of this code to suit my needs? I've created
my own DLLs in the past, though am still somewhat of a novice.

[Form_frm0Teleph one]
Option Compare Database
Option Explicit
Private Declare Function tapiRequestMake Call Lib "TAPI32.DLL " _
(ByVal DestAddress As String, ByVal AppName As String, _
ByVal CalledParty As String, ByVal Comment As String) As Long

Private Sub Telephone_Numbe rs_DblClick(Can cel As Integer)
Dim lngRetVal As Long
Dim strDial As String
strDial = Forms!frm0!frm0 Telephone.Form! TelNumber
lngRetVal = tapiRequestMake Call(Trim$(strD ial), "", "", "")
End Sub

Thanks in advance.

PS. thanks to Bruce Thompson and Joacim Andersson for help getting this far.
Nov 12 '05 #1
17 11624
> The below code dials a phone number when the subform datasheet cell
containing the number is double clicked. The problem is that the dialer
application (c:\windows\dia ler.exe) pops up windows on the screen, requiring user intervention to click "Talk" or "Hang Up". I want to customize the
behavior of the application so that no pop ups are received and the
application drops the line automatically and closes itself in 6 seconds -
which is enough time for the user to pick up the phone. The user will hear the modem dial, but no other screen alerts will be received. If the phone
is not picked up with the 6-second window, the call is simply dropped.


This is close - but how to minimize and close an application (dialer.exe) in
VBA?

[Form_frm0Teleph one]
Option Compare Database
Option Explicit
Private Declare Function tapiRequestMake Call Lib "TAPI32.DLL " _
(ByVal DestAddress As String, ByVal AppName As String, _
ByVal CalledParty As String, ByVal Comment As String) As Long

Private Sub Telephone_Numbe rs_DblClick(Can cel As Integer)
Dim WaitTime As Variant
Dim Start As Variant
Dim strDial As String
Dim lngRetVal As Long
strDial = Forms!frm0!frm0 Telephone.Form! TelNumber
lngRetVal = tapiRequestMake Call(Trim$(strD ial), "", "", "")
'Shell("c:\wind ows\dialer.exe" , 0) '<<=== How to minimize app?
If lngRetVal <> 0 Then GoTo Exit_Here
WaitTime = 6
Start = Timer
Do While Timer < Start + WaitTime
DoEvents
Loop
Exit_Here:
'Close "c:\windows\dia ler.exe" '<<=== How to close app?
End Sub
Nov 12 '05 #2
From my file - I haven't tried it!

If you get it to work, please email me a copy of your code.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

Dial Telephone Numbers From A Form

Note: Windows Dialer must be loaded on the machine for this code to work....

In the Form Module

Private Sub Phone1_DblClick (Cancel As Integer)
Call CtrDialer_Click
End Sub
In a New Module

Public Sub CtrDialer_Click ()
On Error GoTo Err_CtrDialer_C lick

Dim stDialStr As String
Dim PrevCtl As Control
Const ERR_OBJNOTEXIST = 2467
Const ERR_OBJNOTSET = 91

Set PrevCtl = Screen.ActiveCo ntrol

If TypeOf PrevCtl Is TextBox Then
stDialStr = IIf(varType(Pre vCtl) > V_NULL, PrevCtl, "")
ElseIf TypeOf PrevCtl Is ListBox Then
stDialStr = IIf(varType(Pre vCtl) > V_NULL, PrevCtl, "")
ElseIf TypeOf PrevCtl Is ComboBox Then
stDialStr = IIf(varType(Pre vCtl) > V_NULL, PrevCtl, "")
Else
stDialStr = ""
End If

Application.Run "utility.wlib_A utoDial", stDialStr
Exit_CtrDialer_ Click:
Exit Sub

Err_CtrDialer_C lick:
If (Err = ERR_OBJNOTEXIST ) Or (Err = ERR_OBJNOTSET) Then
Resume Next
End If
MsgBox Err.Description
Resume Exit_CtrDialer_ Click

End Sub
"deko" <de**@hotmail.c om> wrote in message
news:48******** ***********@new ssvr29.news.pro digy.com...
The below code dials a phone number when the subform datasheet cell
containing the number is double clicked. The problem is that the dialer
application (c:\windows\dia ler.exe) pops up windows on the screen, requiring
user intervention to click "Talk" or "Hang Up". I want to customize the
behavior of the application so that no pop ups are received and the
application drops the line automatically and closes itself in 6 seconds -
which is enough time for the user to pick up the phone. The user will hear
the modem dial, but no other screen alerts will be received. If the phone
is not picked up with the 6-second window, the call is simply dropped.

Perhaps I need to write my own custom version of TAPI32.DLL? Or is there a
way to customize the behavior of this code to suit my needs? I've created
my own DLLs in the past, though am still somewhat of a novice.

[Form_frm0Teleph one]
Option Compare Database
Option Explicit
Private Declare Function tapiRequestMake Call Lib "TAPI32.DLL " _
(ByVal DestAddress As String, ByVal AppName As String, _
ByVal CalledParty As String, ByVal Comment As String) As Long

Private Sub Telephone_Numbe rs_DblClick(Can cel As Integer)
Dim lngRetVal As Long
Dim strDial As String
strDial = Forms!frm0!frm0 Telephone.Form! TelNumber
lngRetVal = tapiRequestMake Call(Trim$(strD ial), "", "", "")
End Sub

Thanks in advance.

PS. thanks to Bruce Thompson and Joacim Andersson for help getting this far.

Nov 12 '05 #3
> If you get it to work, please email me a copy of your code.

This code is effective for closing the pop up windows, but it won't close
the app - Dialer.exe. Apparently the AppCaption is not what appears in the
window header of the application window - i.e. "Phone Dialer". Is there a
way to find the caption programmaticall y? Perhaps there is an easier way to
simply close an application in VB. There must be. When I find that
solution, I'll probably modify the below code to hide (rather than close)
the pop up windows and then close (cleanly) Dialer.exe (and by association
the popups) after the 6-second WaitTime.

Option Compare Database
Option Explicit
'API Find applcation by full caption
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindow A" _
( _
ByVal lpClassName As String, _
ByVal lpWindowName As String _
) _
As Long

'API Bring Window to foreground
Private Declare Function SetForegroundWi ndow _
Lib "user32" _
( _
ByVal hwnd As Long _
) _
As Long

'API Send message to application
Private Declare Function PostMessage _
Lib "user32" _
Alias "PostMessag eA" _
( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any _
) _
As Long

Const WM_CLOSE = &H10

Function Close_By_Captio n(AppCaption As String)
Dim hwnd As Long
hwnd = FindWindow(vbNu llString, AppCaption)
If hwnd Then
'Bring to Front
SetForegroundWi ndow hwnd
'Close the app nicely
PostMessage hwnd, WM_CLOSE, 0&, 0&
End If
End Function

Private Sub cmdTest_Click()
'Close_By_Capti on ("Dialing") - works great
'Close_By_Capti on ("Call Status") - works great
Colse_By_Captio n ("Phone Dialer") - does not work
End Sub
Nov 12 '05 #4
deko wrote:
If you get it to work, please email me a copy of your code.

This code is effective for closing the pop up windows, but it won't close
the app - Dialer.exe. Apparently the AppCaption is not what appears in the
window header of the application window - i.e. "Phone Dialer". Is there a
way to find the caption programmaticall y? Perhaps there is an easier way to
simply close an application in VB. There must be. When I find that
solution, I'll probably modify the below code to hide (rather than close)
the pop up windows and then close (cleanly) Dialer.exe (and by association
the popups) after the 6-second WaitTime.

< SNIP >

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Why not use the code found here instead of the Dialer.exe method.

ACC: How to Dial a Phone Number from MS Access 95/97

http://support.microsoft.com/default...b;en-us;148857

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQHwkL4echKq OuFEgEQLDAQCgnX 02cV7FYpM8h70V8 FAhEyOV4ggAoNfp
p9lGoUPu5F5haOA ot3Lh6RaE
=Yb1F
-----END PGP SIGNATURE-----

Nov 12 '05 #5
> Why not use the code found here instead of the Dialer.exe method.

ACC: How to Dial a Phone Number from MS Access 95/97

http://support.microsoft.com/default...b;en-us;148857


I looked at that code - not sure if it will make use of Dialing Properties,
and I think using the TAPI interface is a better solution.

The below code works - my only complaint is that I can't hide the "Call
Status" window. I'm sure my syntax is wrong somewhere... not sure where.
Keep getting Error Number 49: Bad DLL calling convention...

Option Compare Database
Option Explicit
Const WM_CLOSE = &H10
'Const SW_HIDE = 0

'API use Phone Dialer to make call (default dialer)
Private Declare Function tapiRequestMake Call _
Lib "TAPI32.DLL " _
( _
ByVal DestAddress As String, _
ByVal AppName As String, _
ByVal CalledParty As String, _
ByVal Comment As String _
) _
As Long

'API find applcation by full caption
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindow A" _
( _
ByVal lpClassName As String, _
ByVal lpWindowName As String _
) _
As Long

'API bring Window to foreground
Private Declare Function SetForegroundWi ndow _
Lib "user32" _
( _
ByVal hwnd As Long _
) _
As Long

'API set ShowWindow to hide window
Private Declare Function ShowWindow _
Lib "user32" _
( _
ByVal hwnd As Long, _
ByVal nCmdShow As Integer _
)

'API send message to application
Private Declare Function PostMessage _
Lib "user32" _
Alias "PostMessag eA" _
( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any _
) _
As Long

Private Function Hide_Window(App Caption As String)
Dim hwnd As Long
hwnd = FindWindow(vbNu llString, AppCaption)
If hwnd Then
Debug.Print hwnd
Debug.Print AppCaption
ShowWindow hwnd, 0
End If
End Function

'not using this function
Private Function Close_By_Captio n(AppCaption As String)
Dim hwnd As Long
hwnd = FindWindow(vbNu llString, AppCaption)
If hwnd Then
'Bring to Front
SetForegroundWi ndow hwnd
'Close the app nicely
PostMessage hwnd, WM_CLOSE, 0&, 0&
End If
Exit_Here:
Exit Function
HandleErr:
Select Case Err.Number
Case Else
modHandler.LogE rr ("frm0Telephone "), ("Close_By_Capt ion")
End Select
Resume Exit_Here
End Function

Private Function CloseAPP(AppNam eOfExe As String, _
Optional KillAll As Boolean = False, _
Optional NeedYesNo As Boolean = True) _
As Boolean
Dim oProcList As Object
Dim oWMI As Object
Dim oProc As Object
CloseAPP = False
'create WMI object instance:
Set oWMI = GetObject("winm gmts:")
If IsNull(oWMI) = False Then
'create object collection of Win32 processes:
Set oProcList = oWMI.InstancesO f("win32_proces s")
'iterate through the enumerated collection:
For Each oProc In oProcList
'Debug.Print oProc.Name
'option to close a process:
If UCase(oProc.Nam e) = UCase(AppNameOf Exe) Then
NeedYesNo = False 'don't wan't msgbox
If NeedYesNo Then
If MsgBox("Kill " & oProc.Name & vbNewLine & "Are you
sure?", _
vbYesNo + vbCritical) = vbYes Then
oProc.Terminate (0)
CloseAPP = True
End If
Else
oProc.Terminate (0)
CloseAPP = True
End If
'continue search for more?
If Not KillAll And CloseAPP Then
Exit For 'oProc In oProcList
End If
End If
Next
Else
'report error
End If
Exit_Here:
Set oProcList = Nothing
Set oWMI = Nothing
Exit Function
HandleErr:
Select Case Err.Number
Case Else
modHandler.LogE rr ("frm0Telephone "), ("Close_APP" )
End Select
Resume Exit_Here
End Function

Private Sub Telephone_Numbe rs_DblClick(Can cel As Integer)
On Error GoTo HandleErr
Dim varDialWait As Variant
Dim varStart As Variant
Dim strDial As String
Dim lngRetVal As Long
Static blnDialing As Boolean 'prevent reentry into sub while dialing
DoEvents
blnDialing = False
If blnDialing Then Exit Sub
blnDialing = True
strDial = Forms!frm0!frm0 Telephone.Form! TelNumber
lngRetVal = tapiRequestMake Call(Trim$(strD ial), "", "", "")
If lngRetVal <> 0 Then Exit Sub
varDialWait = DLookup("DialWa it", "tblPrefs")
varStart = Timer
Do While Timer < varStart + varDialWait
DoEvents
'Hide_Window ("Call Status") '<<=== this fails with Error Number 49:
Bad DLL calling convention
Loop
Exit_Here:
On Error Resume Next
blnDialing = False
CloseAPP ("dialer.exe ")
Exit Sub
HandleErr:
Select Case Err.Number
Case 94 'Invalid Use of Null - if double click on blank, open dialer
Call Shell("c:\windo ws\dialer.exe", vbNormalFocus)
blnDialing = False
Exit Sub
Case Else
modHandler.LogE rr ("frm0Telephone "),
("Telephone_Num bers_DblClick")
End Select
Resume Exit_Here
End Sub
Nov 12 '05 #6
You can use SPY++ if you have VC++( or I think even VB) on your system
to determine the Class name of the offending Dialog. Modify your code to
find the window by Class name instead of Caption.

If you do not have SPY++ send me a functioning MDB and I'll post the
Class name for the Dialog.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"deko" <de**@hotmail.c om> wrote in message
news:Wj******** ***********@new ssvr25.news.pro digy.com...
Why not use the code found here instead of the Dialer.exe method.

ACC: How to Dial a Phone Number from MS Access 95/97

http://support.microsoft.com/default...b;en-us;148857
I looked at that code - not sure if it will make use of Dialing

Properties, and I think using the TAPI interface is a better solution.

The below code works - my only complaint is that I can't hide the "Call Status" window. I'm sure my syntax is wrong somewhere... not sure where. Keep getting Error Number 49: Bad DLL calling convention...

Option Compare Database
Option Explicit
Const WM_CLOSE = &H10
'Const SW_HIDE = 0

'API use Phone Dialer to make call (default dialer)
Private Declare Function tapiRequestMake Call _
Lib "TAPI32.DLL " _
( _
ByVal DestAddress As String, _
ByVal AppName As String, _
ByVal CalledParty As String, _
ByVal Comment As String _
) _
As Long

'API find applcation by full caption
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindow A" _
( _
ByVal lpClassName As String, _
ByVal lpWindowName As String _
) _
As Long

'API bring Window to foreground
Private Declare Function SetForegroundWi ndow _
Lib "user32" _
( _
ByVal hwnd As Long _
) _
As Long

'API set ShowWindow to hide window
Private Declare Function ShowWindow _
Lib "user32" _
( _
ByVal hwnd As Long, _
ByVal nCmdShow As Integer _
)

'API send message to application
Private Declare Function PostMessage _
Lib "user32" _
Alias "PostMessag eA" _
( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any _
) _
As Long

Private Function Hide_Window(App Caption As String)
Dim hwnd As Long
hwnd = FindWindow(vbNu llString, AppCaption)
If hwnd Then
Debug.Print hwnd
Debug.Print AppCaption
ShowWindow hwnd, 0
End If
End Function

'not using this function
Private Function Close_By_Captio n(AppCaption As String)
Dim hwnd As Long
hwnd = FindWindow(vbNu llString, AppCaption)
If hwnd Then
'Bring to Front
SetForegroundWi ndow hwnd
'Close the app nicely
PostMessage hwnd, WM_CLOSE, 0&, 0&
End If
Exit_Here:
Exit Function
HandleErr:
Select Case Err.Number
Case Else
modHandler.LogE rr ("frm0Telephone "), ("Close_By_Capt ion")
End Select
Resume Exit_Here
End Function

Private Function CloseAPP(AppNam eOfExe As String, _
Optional KillAll As Boolean = False, _
Optional NeedYesNo As Boolean = True) _
As Boolean
Dim oProcList As Object
Dim oWMI As Object
Dim oProc As Object
CloseAPP = False
'create WMI object instance:
Set oWMI = GetObject("winm gmts:")
If IsNull(oWMI) = False Then
'create object collection of Win32 processes:
Set oProcList = oWMI.InstancesO f("win32_proces s")
'iterate through the enumerated collection:
For Each oProc In oProcList
'Debug.Print oProc.Name
'option to close a process:
If UCase(oProc.Nam e) = UCase(AppNameOf Exe) Then
NeedYesNo = False 'don't wan't msgbox
If NeedYesNo Then
If MsgBox("Kill " & oProc.Name & vbNewLine & "Are you sure?", _
vbYesNo + vbCritical) = vbYes Then
oProc.Terminate (0)
CloseAPP = True
End If
Else
oProc.Terminate (0)
CloseAPP = True
End If
'continue search for more?
If Not KillAll And CloseAPP Then
Exit For 'oProc In oProcList
End If
End If
Next
Else
'report error
End If
Exit_Here:
Set oProcList = Nothing
Set oWMI = Nothing
Exit Function
HandleErr:
Select Case Err.Number
Case Else
modHandler.LogE rr ("frm0Telephone "), ("Close_APP" )
End Select
Resume Exit_Here
End Function

Private Sub Telephone_Numbe rs_DblClick(Can cel As Integer)
On Error GoTo HandleErr
Dim varDialWait As Variant
Dim varStart As Variant
Dim strDial As String
Dim lngRetVal As Long
Static blnDialing As Boolean 'prevent reentry into sub while dialing DoEvents
blnDialing = False
If blnDialing Then Exit Sub
blnDialing = True
strDial = Forms!frm0!frm0 Telephone.Form! TelNumber
lngRetVal = tapiRequestMake Call(Trim$(strD ial), "", "", "")
If lngRetVal <> 0 Then Exit Sub
varDialWait = DLookup("DialWa it", "tblPrefs")
varStart = Timer
Do While Timer < varStart + varDialWait
DoEvents
'Hide_Window ("Call Status") '<<=== this fails with Error Number 49: Bad DLL calling convention
Loop
Exit_Here:
On Error Resume Next
blnDialing = False
CloseAPP ("dialer.exe ")
Exit Sub
HandleErr:
Select Case Err.Number
Case 94 'Invalid Use of Null - if double click on blank, open dialer Call Shell("c:\windo ws\dialer.exe", vbNormalFocus)
blnDialing = False
Exit Sub
Case Else
modHandler.LogE rr ("frm0Telephone "),
("Telephone_Num bers_DblClick")
End Select
Resume Exit_Here
End Sub


Nov 12 '05 #7
> If you do not have SPY++ send me a functioning MDB and I'll post the
Class name for the Dialog.


Hi Stephen,

It's on it's way...

Thanks!
Nov 12 '05 #8
On Apr 13 2004, 05:05 pm, "Stephen Lebans" <ForEmailGotoMy .WebSite.-
WW************* ***@linvalid.co m> wrote in news:lCYec.1797 8$Np3.635507@ur sa-
nb00s0.nbnet.nb .ca:
You can use SPY++ if you have VC++( or I think even VB) on your system
to determine the Class name of the offending Dialog. Modify your code to
find the window by Class name instead of Caption.


Or, if you don't have Spy++, you can use Wintree from
http://www.users.cloud9.net/~dfurman/code.htm

--
remove a 9 to reply by email
Nov 12 '05 #9
A couple of errors in your API declarations seem to be the problem. The
second ShowWindow param should be a Long not Integer.
Notice I changed the last SendMessage param to ByValue instead of ByRef.
You were passing a 0 which is interpreted as the memory location at
address ZERO.
Also remember that hWnds can be negative in WinNT or higher so the
standard check is against 0.

I have tested the code below and it works.
Option Compare Database
Option Explicit
Const WM_CLOSE = &H10
'Const SW_HIDE = 0

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As
Long)
'API use Phone Dialer to make call
Private Declare Function tapiRequestMake Call _
Lib "TAPI32.DLL " _
( _
ByVal DestAddress As String, _
ByVal AppName As String, _
ByVal CalledParty As String, _
ByVal Comment As String _
) _
As Long

'API find applcation by full caption
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindow A" _
( _
ByVal lpClassName As String, _
ByVal lpWindowName As String _
) _
As Long

'API bring Window to foreground
Private Declare Function SetForegroundWi ndow _
Lib "user32" _
( _
ByVal hwnd As Long _
) _
As Long

'API set ShowWindow to hide window
Private Declare Function ShowWindow _
Lib "user32" _
( _
ByVal hwnd As Long, _
ByVal nCmdShow As Long _
)

'API send message to application
Private Declare Function PostMessage _
Lib "user32" _
Alias "PostMessag eA" _
( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long _
) _
As Long
Private Function Hide_Window(App Caption As String)
Dim hwnd As Long
hwnd = FindWindow(vbNu llString, AppCaption)
If hwnd Then
Debug.Print hwnd
Debug.Print AppCaption
ShowWindow hwnd, 0
End If
End Function
Private Function Close_By_Captio n(AppCaption As String)
Dim hwnd As Long
hwnd = FindWindow(vbNu llString, AppCaption)
If hwnd <> 0 Then
'Bring to Front
SetForegroundWi ndow hwnd
'Close the app nicely
PostMessage hwnd, WM_CLOSE, 0&, 0&
End If
Exit_Here:
Exit Function
HandleErr:
Select Case Err.Number
Case Else
'modHandler.Log Err ("frm0Telephone "), ("Close_By_Capt ion")
End Select
Resume Exit_Here
End Function
Private Function CloseAPP(AppNam eOfExe As String, _
Optional KillAll As Boolean = False, _
Optional NeedYesNo As Boolean = True) _
As Boolean
Dim oProcList As Object
Dim oWMI As Object
Dim oProc As Object
CloseAPP = False
'create WMI object instance:
Set oWMI = GetObject("winm gmts:")
If IsNull(oWMI) = False Then
'create object collection of Win32 processes:
Set oProcList = oWMI.InstancesO f("win32_proces s")
'iterate through the enumerated collection:
For Each oProc In oProcList
'Debug.Print oProc.Name
'option to close a process:
If UCase(oProc.Nam e) = UCase(AppNameOf Exe) Then
NeedYesNo = False 'don't wan't msgbox
If NeedYesNo Then
If MsgBox("Kill " & oProc.Name & vbNewLine & "Are
you sure?", _
vbYesNo + vbCritical) = vbYes Then
oProc.Terminate (0)
CloseAPP = True
End If
Else
oProc.Terminate (0)
CloseAPP = True
End If
'continue search for more?
If Not KillAll And CloseAPP Then
Exit For 'oProc In oProcList
End If
End If
Next
Else
'report error
End If
Exit_Here:
Set oProcList = Nothing
Set oWMI = Nothing
Exit Function
HandleErr:
Select Case Err.Number
Case Else
'modHandler.Log Err ("frm0Telephone "), ("Close_APP" )
End Select
Resume Exit_Here
End Function
Private Sub Telephone_Numbe rs_DblClick(Can cel As Integer)
On Error GoTo HandleErr
Dim varDialWait As Variant
Dim varStart As Variant
Dim strDial As String
Dim lngRetVal As Long
Static blnDialing As Boolean 'prevent reentry into sub while dialing
DoEvents
blnDialing = False
If blnDialing Then Exit Sub
strDial = Me.TelNumber
lngRetVal = tapiRequestMake Call(Trim$(strD ial), "", "", "")
If lngRetVal = 0 Then
blnDialing = True
'varDialWait = DLookup("DialWa it", "tblPrefs")
'varDialWait = 8
Dim strMsg As String
Dim varReturn As Long, lngX As Long
strMsg = "You have 10 seconds to Pick up the Phone to Talk!" &
"..."
varReturn = SysCmd(acSysCmd InitMeter, strMsg, 10)
' Display message in status bar.
For lngX = 1 To 10
varReturn = SysCmd(acSysCmd UpdateMeter, lngX)
' Update meter.
Sleep 1000 ' sleep 1 second

Next lngX
varReturn = SysCmd(acSysCmd ClearStatus)


'For x = 1 To 6
'Me.statusbar = "...... 6 seconds to Pick up the Phone"

'varStart = Timer
'Do While Timer < varStart + varDialWait
' DoEvents
'Hide_Window ("Call Status") '<<=== this fails with Error
Number 49: Bad DLL calling convention
' Loop
End If
Exit_Here:
blnDialing = False
Close_By_Captio n ("Dialing") ' - works great
Close_By_Captio n ("Call Status") '- works great
Close_By_Captio n ("Phone Dialer") ' - does

'CloseAPP ("dialer.exe ")
Exit Sub
HandleErr:
Select Case Err.Number
Case 94 'Invalid Use of Null - if double-click on blank, open
dialer
Call Shell("c:\windo ws\dialer.exe", vbNormalFocus)
Exit Sub
Case Else
'modHandler.Log Err ("frm0Telephone "),
("Telephone_Num bers_DblClick")
End Select
Resume Exit_Here
End Sub
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"deko" <de**@hotmail.c om> wrote in message
news:eQ******** ***********@new ssvr29.news.pro digy.com...
If you do not have SPY++ send me a functioning MDB and I'll post the
Class name for the Dialog.


Hi Stephen,

It's on it's way...

Thanks!


Nov 12 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
759
by: deko | last post by:
The below code dials a phone number when the subform datasheet cell containing the number is double clicked. The problem is that the dialer application (c:\windows\dialer.exe) pops up windows on the screen, requiring user intervention to click "Talk" or "Hang Up". I want to customize the behavior of the application so that no pop ups are received and the application drops the line automatically and closes itself in 6 seconds - which is...
0
1426
by: MrNobody | last post by:
hey guys... I'm trying to make my DataGrid have selection behavior similar to WindowsExplorer, where I can hold CTRL to add rows to a multi-row selection. Thanks to someone else on this newsgroup, I found out how to detect if CTRL is pressed while in my MouseUp event, which is when it's supposed add that row to the selection. (Otherwise, if the CTRL key is not pressed I clear any current selection to start over- just like Explorer) ...
9
1617
by: Lonnie Princehouse | last post by:
There doesn't seem to be any way to customize the behavior of "is" as can be done for other operators... why not?
6
1792
by: raj | last post by:
Hi every one I am working on a vb.net, windows application and i am not able to figure out how to change the deployment project settings so that i can change the installation and un-installation behavior. Mainly i want uninstall the complete folder, which is copied while installation. Can any one guide me how to do that or help me fine an article that explains it? raj
8
1409
by: Dustan | last post by:
Can I make enumerate(myObject) act differently? class A(object): def __getitem__(self, item): if item 0: return self.sequence elif item < 0: return self.sequence elif item == 0: raise IndexError, "Index 0 is not valid."
1
1862
by: Ryou kaihou | last post by:
As we known, in Visual Stdio 2003 or 2005, the property of Autosize of Label is set to True by defaut, how can I customize this and set property of Autosize to False? Any ideas? Thanks
5
1391
by: DLN | last post by:
Getting rid of the Customize option. I want to get rid of the {Right-Click}-{Customize} option on the tool bars. I’ve been able to get rid of all the other options but not Customize itself. The reason is the way the DB was originally built anyone can get to the database window and make modifications to the forms or delete tables or whatever. So now I need to lock it down, under the constraints that I’m working with no Database security...
0
1331
by: Shailesh Patel | last post by:
I am having a small VB application to call customers through my laptop. I use tapiRequestMakeCall for this to make calls using a modem. I have to problems where I need help from someone expert on TAPI. 1) My phone line is connected to PBX and hence I have to dial 0 to get the outside line. So how do I pass a number with 0 to get an outside line. Just 0 followed by phone number does not work. If I use 0,7145155315 in dialer.exe it works. But...
0
990
Iman100
by: Iman100 | last post by:
Hi I have quiz (MCQ) data stored in my Database. I need to customize the question view to show the question then use RadioButtonList to display my choices. Is there is any tutorial or guide I can use to customize my View? Or can I customize the data view from the DATA controls? Thanks
0
2209
by: Sky | last post by:
I have an Access 2003 front-end database with custom toolbars. The toolbars work fine. One annoying feature is that at the far right edge of each custom toolbar there a small dropdown arrow. When you hover over it with the mouse, a ControlTip Text of "Toolbar Options" is displayed. If you then click on the dropdrown arrow, it displays a popup menu of "Add or Remove Buttons", with a fly-out menu with the toolbar name at the top and...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7354
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.