⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 func2_9o6m.htm

📁 TAPI Exampple
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML DIR="LTR"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso8859-1">
</HEAD>
<TITLE>phoneOpen</TITLE>
<SCRIPT SRC="/library/psdk/linkcss.js"></SCRIPT>
<META NAME="MS-HKWD" CONTENT="phoneOpen">
<META NAME="MS-HAID" CONTENT="_tapi2_phoneopen">
</HEAD>
<BODY TOPMARGIN="0">

<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<!--SYNC_START-->
<script language="JavaScript" src='/library/synch.js'></script>
<!--SYNC_END-->

<H1><A NAME="_tapi2_phoneopen"></A>phoneOpen</H1>

<P>The <B>phoneOpen</B> function opens the specified phone device. A phone device can be opened using either owner privilege or monitor privilege. An application that opens the phone with owner privilege can control the phone's lamps, display, ringer, and hookswitch or hookswitches. An application that opens the phone device with monitor privilege is notified only about events that occur at the phone, such as hookswitch changes or button presses. </P>

<P>Ownership of a phone device is exclusive. In other words, only one application can have a phone device opened with owner privilege at a time. The phone device can, however, be opened multiple times with monitor privilege. </P>

<PRE class=syntax><B>LONG WINAPI phoneOpen(
  HPHONEAPP</B><I> hPhoneApp</I><B>,       </B>
<B>  DWORD</B><I> dwDeviceID</I><B>,          </B>
<B>  LPHPHONE</B><I> lphPhone</I><B>,         </B>
<B>  DWORD</B><I> dwAPIVersion</I><B>,        </B>
<B>  DWORD</B><I> dwExtVersion</I><B>,        </B>
<B>  DWORD_PTR</B><I> dwCallbackInstance</I><B>,  </B>
<B>  DWORD</B><I> dwPrivilege          </I>
<B>);</B></PRE>

<H4>Parameters</H4>

<DL>
<DT><I>hPhoneApp</I> </DT>

<DD>A handle to the application's registration with TAPI. </DD>

<DT><I>dwDeviceID</I> </DT>

<DD>The phone device to be opened. </DD>

<DT><I>lphPhone</I> </DT>

<DD>A pointer to an HPHONE handle that identifies the open phone device. Use this handle to identify the device when invoking other phone control functions. </DD>

<DT><I>dwAPIVersion</I> </DT>

<DD>The API version number under which the application and Telephony API have agreed to operate. This number is obtained from <A HREF="func2_98ry.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_98ry.htm"><B>phoneNegotiateAPIVersion</B></A>. </DD>

<DT><I>dwExtVersion</I> </DT>

<DD>The extension version number under which the application and the service provider agree to operate. This number is zero if the application does not use any extensions. This number is obtained from <A HREF="func2_3d0u.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_3d0u.htm"><B>phoneNegotiateExtVersion</B></A>. </DD>

<DT><I>dwCallbackInstance</I> </DT>

<DD>User instance data passed back to the application with each message. This parameter is not interpreted by the Telephony API. </DD>

<DT><I>dwPrivilege</I> </DT>

<DD>The privilege requested. This parameter uses one and only one of the <A HREF="constnts_9xtf.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/constnts_9xtf.htm">PHONEPRIVILEGE_ Constants</A>.
</DD>
</DL>

<H4>Return Values</H4>

<P>Returns zero if the request succeeds or a negative error number if an error occurs. Possible return values are: </P>

<P>PHONEERR_ALLOCATED, PHONEERR_NODRIVER, PHONEERR_BADDEVICEID, PHONEERR_NOMEM, PHONEERR_INCOMPATIBLEAPIVERSION, PHONEERR_OPERATIONFAILED, PHONEERR_INCOMPATIBLEEXTVERSION, PHONEERR_OPERATIONUNAVAIL, PHONEERR_INVALAPPHANDLE, PHONEERR_RESOURCEUNAVAIL, PHONEERR_INVALPOINTER, PHONEERR_UNINITIALIZED, PHONEERR_INVALPRIVILEGE, PHONEERR_REINIT, PHONEERR_INUSE, PHONEERR_NODEVICE, PHONEERR_INIFILECORRUPT.</P>

<H4>Remarks</H4>

<P>When opening a phone device with monitor privileges, the application is sent messages when events occur that change the status of the phone. Messages sent to the application include <A HREF="msgs_77zi.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/msgs_77zi.htm">PHONE_BUTTON</A> and <A HREF="msgs_3f8l.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/msgs_3f8l.htm">PHONE_STATE</A>. The latter provides an indication of the phone's status item that has changed. </P>

<P>When opening a phone with owner privilege, the phone device can be manipulated in ways that affect the state of the phone device. An application should only open a phone using owner privilege if it actively wants to manipulate the phone device, and it should close the phone device when finished to allow other applications to control the phone. </P>

<P>When an application opens a phone device, it must specify the negotiated API version and, if it wants to use the phone's extensions, the phone's device-specific extension version. This version number should have been obtained with the <A HREF="func2_98ry.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_98ry.htm"><B>phoneNegotiateAPIVersion</B></A> and <A HREF="func2_3d0u.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_3d0u.htm"><B>phoneNegotiateExtVersion</B></A><B> </B>functions. Version numbering allows the mix and match of different application versions with different API versions and service-provider versions. </P>

<H4><A HREF="javascript:if(confirm('http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm  \n\n这个文件不能通过 Teleport Pro 取回, 因为 地址在一个域或为它的开始地址设定的边界的外部路径上.  \n\n你想从服务器打开它吗?'))window.location='http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm'" tppabs="http://msdn.microsoft.com/library/psdk/sdkintro/guide_927n.htm">Requirements</A> </H4>

<P><B>&nbsp;&nbsp;Windows NT/2000: </B>Requires Windows NT 4.0 SP3 or later.<BR>
<B>&nbsp;&nbsp;Windows 95/98: </B>Requires Windows 95 or later.<BR>
<B>&nbsp;&nbsp;Version: </B>Requires TAPI 1.3 or later.<BR>
<B>&nbsp;&nbsp;Header: </B>Declared in Tapi.h.<BR>
<B>&nbsp;&nbsp;Library: </B>Use Tapi32.lib.</P>

<H4>See Also</H4>

<P><A HREF="quickref_1okl.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/quickref_1okl.htm">TAPI 2.2 Reference Overview</A>, <A HREF="quickref_4rub.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/quickref_4rub.htm">Supplementary Phone Service Functions</A>, <A HREF="msgs_77zi.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/msgs_77zi.htm">PHONE_BUTTON</A>, <A HREF="msgs_3f8l.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/msgs_3f8l.htm">PHONE_STATE</A>, <A HREF="func2_98ry.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_98ry.htm"><B>phoneNegotiateAPIVersion</B></A>, <A HREF="func2_3d0u.htm" tppabs="http://msdn.microsoft.com/library/psdk/tapi22/func2_3d0u.htm"><B>phoneNegotiateExtVersion</B></A> </P>
<DIV CLASS="footer">Built on Monday, August 14, 2000</DIV>
<!--FOOTER_START-->
<DIV CLASS="footer" STYLE="color:#000000;font-size:90%;">
<A HREF="mailto:sdkfdbk@microsoft.com">Send feedback</A> to the Platform SDK.</P>
<P><A HREF="javascript:if(confirm('http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm  \n\n这个文件不能通过 Teleport Pro 取回, 因为 地址在一个域或为它的开始地址设定的边界的外部路径上.  \n\n你想从服务器打开它吗?'))window.location='http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm'" tppabs="http://msdn.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm" TARGET="_top">&#169; 1999 Microsoft Corporation. All rights reserved. Terms of use.</A></P>
</DIV>
<!--FOOTER_END-->

</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -