SmsSetMessageNotification

Send Feedback

Use this function to get started when an 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.

HRESULT SmsSetMessageNotification (
const SMSREGISTRATIONDATA * psmsrd);

Parameters

  • psmsrd
    Points to a structure indicating how to notify the application.

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.

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 other application has already registered for the message type 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.

This is a privileged function.

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 | SMSREGISTRATIONDATA | SmsClearMessageNotification

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.