|
phoneOpen
The phoneOpen 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. 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.
LONG phoneOpen(
HPHONEAPP hPhoneApp,
|
| DWORD dwDeviceID,
|
| LPHPHONE lphPhone,
|
| DWORD dwAPIVersion,
|
| DWORD dwExtVersion,
|
| DWORD dwCallbackInstance,
|
| DWORD dwPrivilege
|
| );
|
|
Parameters
hPhoneApp
A handle to the application's registration with TAPI.
dwDeviceID
The phone device to be opened.
lphPhone
A pointer to an HPHONE handle, which identifies the open phone device. Use
this handle to identify the device when invoking other phone control functions.
dwAPIVersion
The API version number under which the application and Telephony API have
agreed to operate. This number is obtained from phoneNegotiateAPIVersion.
dwExtVersion
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 phoneNegotiateExtVersion.
dwCallbackInstance
User instance data passed back to the application with each message. This
parameter is not interpreted by the Telephony API.
dwPrivilege
The privilege requested. The dwPrivilege parameter can have only one bit set. This parameter uses the following
PHONEPRIVILEGE_ constants:
PHONEPRIVILEGE_MONITOR
An application that opens a phone device with this privilege is informed about
events and state changes occurring on the phone. The application cannot invoke
any operations on the phone device that would change its state.
PHONEPRIVILEGE_OWNER
An application that opens a phone device in this mode is allowed to change the
state of the lamps, ringer, display, and hookswitch devices of the phone.
Having owner privilege to a phone device automatically includes monitor privilege
as well.
Return Values
Returns zero if the request is successful or a negative error number if an
error has occurred. Possible return values are:
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.
Remarks
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 PHONE_BUTTON and PHONE_STATE. The latter provides an indication of the phone's status item that has
changed.
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 done to allow other
applications to control the phone.
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
function phoneNegotiateAPIVersion and phoneNegotiateExtVersion. Version numbering allows the mix and match of different application versions
with different API versions and service-provider versions.
See Also
PHONE_BUTTON, PHONE_STATE, phoneNegotiateAPIVersion, phoneNegotiateExtVersion
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|