Partager via


GetCommModemStatus (Windows CE 5.0)

Send Feedback

This function retrieves modem control-register values.

BOOLGetCommModemStatus(HANDLEhFile, LPDWORDlpModemStat);

Parameters

  • hFile
    [in] Handle to the communication device.

    The CreateFile function returns this handle.

  • lpModemStat
    [out] Long pointer to a 32-bit variable that specifies the current state of the modem control-register values.

    The following are values for this parameter.

    Value Description
    MS_CTS_ON The CTS (Clear To Send) signal is on.
    MS_DSR_ON The DSR (Data Set Ready) signal is on.
    MS_RING_ON The ring indicator signal is on.
    MS_RLSD_ON The RLSD (Receive Line Signal Detect) signal is on.

Return Values

Nonzero indicates success.

Zero indicates failure.

To obtain extended error data, call the GetLastError function.

Remarks

The GetCommModemStatus function is useful when using the WaitCommEvent function to monitor the CTS, DSR, DSR, or ring indicator signals.

To detect when these signals change state, use WaitCommEvent and then use GetCommModemStatus to determine the state after a change occurs.

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

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winbase.h.
Link Library: Serdev.lib.

See Also

CreateFile | WaitCommEvent

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.