Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function retrieves modem control-register values.

Syntax

BOOL GetCommModemStatus(
  HANDLE 
hFile,
  LPDWORD 
lpModemStat
);

Parameters

hFile

[in] Handle to the communication device, returned by the CreateFilefunction.

lpModemStat

[out] Long pointer to a 32-bit variable that specifies the current state of the modem control-register values. The following table shows possible values.

Value Description

MS_CTS_ON

The clear-to-send (CTS) signal is on.

MS_DSR_ON

The data-set-ready (DSR) signal is on.

MS_RING_ON

The ring indicator signal is on.

MS_RLSD_ON

The receive-line-signal-detect (RLSD) signal is on.

Return Value

Nonzero indicates success. Zero indicates failure. To obtain extended error data, call the GetLastErrorfunction.

Remarks

The GetCommModemStatusfunction is useful when using the WaitCommEventfunction to monitor the CTS, DSR, DSR, or ring indicator signals.

To detect when these signals change state, use WaitCommEventand then use GetCommModemStatusto determine the state after a change occurs.

The function fails if the hardware does not support the control-register values.

Requirements

Header winbase.h
Library Serdev.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also