Partager via


phoneGetHookSwitch

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function returns the current hookswitch mode of the specified open phone device.

Syntax

LONG WINAPI phoneGetHookSwitch(
  HPHONE hPhone,
  LPDWORD lpdwHookSwitchDevs 
);

Parameters

  • hPhone
    Handle to the open phone device.
  • lpdwHookSwitchDevs
    Pointer to a DWORD to be filled with the mode of the phone's hookswitch devices. If a bit position is FALSE, the corresponding hookswitch device is onhook; if TRUE, the microphone and/or speaker part of the corresponding hookswitch device is offhook. To find out whether the microphone and/or speaker are enabled, the application can use the phoneGetStatus function. This parameter uses one or more of the PHONEHOOKSWITCHDEV constants.

Return Value

Returns zero if the request succeeds or a negative error number if an error occurs. The following table shows the return values for this function.

Value Description

PHONEERR_INVALPHONEHANDLE

The handle to the open phone device is invalid.

PHONEERR_NOMEM

Not enough memory is available.

PHONEERR_INVALPOINTER

The pointer is invalid.

PHONEERR_RESOURCEUNAVAIL

The resources are unavailable.

PHONEERR_INVALPHONESTATE

The phone state is invalid.

PHONEERR_OPERATIONFAILED

The operation failed.

PHONEERR_OPERATIONUNAVAIL

The operation is unavailable.

PHONEERR_UNINITIALIZED

A parameter is uninitialized.

Remarks

After the hookswitch state of a device changes, and if hookswitch monitoring is enabled, the application is sent a PHONE_STATE message.

Note

This function is for TAPI version 2.0 and later.

Requirements

Header tapi.h
Library coredll.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

phoneGetStatus
phoneGetStatusMessages