Platform SDK: TAPI

TSPI_phoneSetHookSwitch

The TSPI_phoneSetHookSwitch function sets the hook state of the specified open phone's hookswitch devices to the specified mode. Only the hookswitch state of the hookswitch devices listed is affected.

LONG TSPIAPI TSPI_phoneSetHookSwitch(
  DRV_REQUESTID dwRequestID,  
  HDRVPHONE hdPhone,      
  DWORD dwHookSwitchDevs,  
  DWORD dwHookSwitchMode  
);

Parameters

dwRequestID
The identifier of the asynchronous request.
hdPhone
The handle to the phone containing the hookswitch devices whose modes are to be set.
dwHookSwitchDevs
The device(s) whose hookswitch mode is to be set. This parameter uses one of the PHONEHOOKSWITCHDEV_ constants.
dwHookSwitchMode
The hookswitch mode to set. This parameter can have only one of the PHONEHOOKSWITCHMODE_ constants.

Return Values

Returns dwRequestID or an error number if an error occurs. The lResult actual parameter of the corresponding ASYNC_COMPLETION is zero if the function succeeds or it is an error number if an error occurs. Possible return values are as follows:

PHONEERR_INVALPHONEHANDLE, PHONEERR_NOMEM, PHONEERR_INVALHOOKSWITCHDEV, PHONEERR_RESOURCEUNAVAIL, PHONEERR_INVALHOOKSWITCHMODE, PHONEERR_OPERATIONFAILED, PHONEERR_INVALPHONESTATE, PHONEERR_OPERATIONUNAVAIL.

Remarks

The hookswitch mode is changed to the indicated setting for all devices specified. If different settings are desired, this function can be invoked multiple times with a different set of parameters. A PHONE_STATE message is sent to the application after the hookswitch state has changed.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later.
  Version: Requires TAPI 1.3 or later.
  Header: Declared in Tspi.h.

See Also

PHONE_STATE, PHONESTATUS, PHONEHOOKSWITCHDEV_ Constants, PHONEHOOKSWITCHMODE_ Constants, TSPI_phoneGetHookSwitch