SmsGetMessageStatus

Send Feedback

Use this function to retrieve a status report for a message sent with the PS_MESSAGE_OPTION_STATUSREPORT flag. See remarks for more detail.

HRESULT SmsGetMessageStatus (
const SMS_HANDLE smshHandle,
SMS_MESSAGE_ID smsmidMessageID,
SMS_STATUS_INFORMATION * const psmssiStatusInformation,
const DWORD dwTimeout);

Parameters

  • smshHandle
    An Short Message Service (SMS) handle obtained from calling SmsOpen.
  • smsmidMessageID
    This is a message ID returned by SmsSendMessage.
  • psmssiStatusInformation
    Contains the actual message status information if the API returned successfully.
  • dwTimeout
    The time-out (in milliseconds) to wait for the status message to be received (if it has not already been received).

Return Values

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

  • S_OK
    The method completed successfully.

For information about additional return values, see SMS Specific Errors and SMS General Errors.

Remarks

If the originally sent message resulted in a multipart SMS, then a single status report will be available after a report has been received for every multipart message. See the description of the SMS_STATUS_INFORMATION structure for more details concerning a multipart message status report.

There are two methods for obtaining a status report. One way is to register for status report messages, just like any other provider-specific message type. However, this only allows one entity to receive status messages. The second way is to use the SmsGetMessageStatus function. This allows any entity to read the status message, if it has the corresponding message identifier of the original message. Unlike other incoming messages, status messages persist until the status message buffer is full. Then the oldest status messages are overwritten. This means multiple applications can receive status message information.

Using dwTimeout to wait for the status message to be received allows an application to call SmsGetMessageStatus immediately after calling SmsSendMessage.

Requirements

Smartphone: Smartphone 2002 and later
Pocket PC: Pocket PC 2002 and later
OS Versions: Windows CE 3.0 and later
Header: sms.h
Library: sms.lib

See Also

Short Message Service Functions | SmsOpen | SmsSendMessage | SMS_STATUS_INFORMATION

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.