tapiRequestMakeCall - 如何自定义行为? [英] tapiRequestMakeCall - How to customize behavior?

查看:73
本文介绍了tapiRequestMakeCall - 如何自定义行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当双击包含该号码的子表格数据单元格

时,以下代码拨打电话号码。问题是拨号器

应用程序(c:\ windows \ dialer.exe)会在屏幕上弹出窗口,需要用户干预点击对话 ;或挂断。我想自定义应用程序的

行为,这样就不会收到任何弹出窗口,并且

应用程序会自动丢弃该行并在6秒内自行​​关闭 -

这是用户拿起电话的足够时间。用户将听到调制解调器拨号

,但不会收到其他屏幕提示。如果手机没有在6秒钟的时间内拿到电话,那么电话就会被取消。


也许我需要写自己的自定义版本TAPI32.DLL?或者是否有一种

方式来自定义此代码的行为以满足我的需求?我过去曾创建过我自己的DLL,但我仍然有点新手。


[Form_frm0Telephone]

选项比较数据库

选项显式

私有声明函数tapiRequestMakeCall Lib" TAPI32.DLL" _

(ByVal DestAddress As String,ByVal AppName As String,_

ByVal CalledParty As String,ByVal Comment as String)


Private Sub Telephone_Numbers_DblClick(取消为整数)

Dim lngRetVal As

Dim strDial As String

strDial = Forms!frm0!frm0Telephone .Form!TelNumber

lngRetVal = tapiRequestMakeCall(Trim $(strDial),"","","")

End Sub


提前致谢。


PS。感谢Bruce Thompson和Joacim Andersson帮助实现这一目标。

解决方案

(strDial),"",""," ")

End Sub


提前致谢。


PS。感谢Bruce Thompson和Joacim Andersson的帮助。


>当双击包含该数字的子表格数据单元格

时,以下代码拨打电话号码。问题是拨号器
应用程序(c:\ windows \ dialer.exe)弹出屏幕上的窗口,
需要用户干预点击对话。或挂断。我想自定义应用程序的行为,以便不会收到任何弹出窗口,并且
应用程序会自动丢弃该行并在6秒内自行​​关闭 -
这对用户来说是足够的时间拿起电话。用户将听到调制解调器拨号
,但不会收到其他屏幕警报。如果电话没有在6秒钟的时间内被拿起,那么电话就会掉线。




这很接近 - 但是如何最小化和关闭一个应用程序(dialer.exe)在

VBA中?


[Form_frm0Telephone]

选项比较数据库

Option Explicit

私有声明函数tapiRequestMakeCall Lib" TAPI32.DLL" _

(ByVal DestAddress As String,ByVal AppName As String,_

ByVal CalledParty As String,ByVal Comment as String)


Private Sub Telephone_Numbers_DblClick(取消为整数)

Dim WaitTime As Variant

Dim Start As Variant

Dim strDial As String

Dim lngRetVal As Long

strDial = Forms!frm0!frm0Telephone.Form!TelNumber

lngRetVal = tapiRequestMakeCall(Trim


< blockquote>(strDial),"","","")

''Shell(" c:\ windows \\\ dialer.exe",0)' '<< ===如何最小化app?

如果lngRetVal<> 0然后GoTo Exit_Here

WaitTime = 6

Start = Timer

Do While Timer<开始+等待时间

DoEvents

循环

退出_Here:

''关闭'c:\windows \\ \\dialer.exe" ''<< ===如何关闭app?

End Sub


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 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_frm0Telephone]
Option Compare Database
Option Explicit
Private Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" _
(ByVal DestAddress As String, ByVal AppName As String, _
ByVal CalledParty As String, ByVal Comment As String) As Long

Private Sub Telephone_Numbers_DblClick(Cancel As Integer)
Dim lngRetVal As Long
Dim strDial As String
strDial = Forms!frm0!frm0Telephone.Form!TelNumber
lngRetVal = tapiRequestMakeCall(Trim$(strDial), "", "", "")
End Sub

Thanks in advance.

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

解决方案

(strDial), "", "", "")
End Sub

Thanks in advance.

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


> 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 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_frm0Telephone]
Option Compare Database
Option Explicit
Private Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" _
(ByVal DestAddress As String, ByVal AppName As String, _
ByVal CalledParty As String, ByVal Comment As String) As Long

Private Sub Telephone_Numbers_DblClick(Cancel As Integer)
Dim WaitTime As Variant
Dim Start As Variant
Dim strDial As String
Dim lngRetVal As Long
strDial = Forms!frm0!frm0Telephone.Form!TelNumber
lngRetVal = tapiRequestMakeCall(Trim


(strDial), "", "", "")
''Shell("c:\windows\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\dialer.exe" ''<<=== How to close app?
End Sub


这篇关于tapiRequestMakeCall - 如何自定义行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆