A version of this page is also available for
This function is used to read a previously received Short Message Service (SMS) message.
HRESULT SmsReadMessage ( const SMS_HANDLE smshHandle, SMS_ADDRESS* const psmsaSMSCAddress, SMS_ADDRESS* const psmsaSourceAddress, SYSTEMTIME* const pstReceiveTime, bcount(dwBufferSize) BYTE* pbBuffer, DWORD dwBufferSize, bcount(dwProviderSpecificDataBuffer) BYTE* pbProviderSpecificBuffer, DWORD dwProviderSpecificDataBuffer, DWORD* pdwBytesRead );
[in]A Short Message Service (SMS) handle obtained from calling SmsOpen.
[in, out]Indicates the Short Message Service Center (SMSC) the message was routed through.
[in]The source of the message.
[in, out]The time of day that the message was received. This time stamp is in UTC (Coordinated Universal Time) format.
[out]The data buffer used to store the received SMS message.
[in]Size, in bytes, of the buffer used for the received message. The buffer size to use can be determined by calling SmsGetMessageSize.
[out]For certain providers, a provider-specific buffer must be provided in addition to the previous data buffer.
[in]Size of pbProviderSpecificBuffer.
[out]Number of bytes that were read. This includes only the message data. It does not include the incoming addresses or time stamp.
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, and the following:
The method completed successfully.
For information about additional return values, see SMS Specific Errors.
For Windows Mobile
If It Is Possible, use the IMailRuleClient to read SMS messages instead of SmsReadMessage**. Using SmsReadMessage to read incoming messages may interfere with other MAPI clients and the Messaging (formerly Inbox) application.
Use SmsReadMessage when you want to replace Outlook Mobile for handling short messages, or you want to intercept a user-defined message type which is not handled by Outlook Mobile.**
|Windows Embedded CE||Windows Embedded CE 6.0 and later|
|Windows Mobile||Pocket PC 2002 and later, Smartphone 2002 and later|