SmsSetMessageNotification (Compact 2013)
3/26/2014
Use this function to get started when a Short Message Service (SMS) message comes in and your application is not running. Any existing registration for the specified message type will be overwritten. To clear a registration entry, call SmsClearMessageNotification.
Syntax
HRESULT SmsSetMessageNotification (
const SMSREGISTRATIONDATA* psmsrd
);
Parameters
- psmsrd
Points to a structure indicating how to notify the application.
Return Value
- E_FAIL
Indicates an unspecified failure.
- E_INVALIDARG
Indicates one or more invalid arguments.
- E_OUTOFMEMORY
Indicates an out-of-memory error.
- E_UNEXPECTED
Unexpected failure.
- S_OK
The method completed successfully.
For information about additional return values, see SMS Specific Errors.
Remarks
Note that this notification happens only when no application has an open SMS read handle. Also, note that there is no verification that the application calling this function is the same application that was passed in to the registration data function.
When another application has already registered for the message type that this call tries to register, the call to SmsSetMessageNotification will fail with the return value SMS_E_REGISTRATIONEXISTS. Call SmsClearMessageNotification to clear the previous registration if you want to overwrite it.
Requirements
Header |
sms.h |
Library |
sms.lib |
See Also
Reference
Short Message Service Functions
SMSREGISTRATIONDATA
SmsSetMessageNotification
SmsClearMessageNotification
SMS Specific Errors