External.OnLoginChange Event

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

Note

This topic describes functionality designed for use by online stores. Use of this functionality outside the context of an online store is not supported.

The OnLoginChange event occurs when the user's log-in status changes or when an attempt to log in fails.

window.external.OnLoginChange = FunctionName

Possible Values

This is a write-only property that specifies the name of the function in script that Windows Media Player calls when the event occurs.

Parameters

The function that handles this event takes no parameters.

Remarks

This event occurs every time the online store's plug-in calls IWMPContentPartnerCallback::Notify, passing wmpcnLoginStateChange in the type parameter. Sometimes the plug-in makes this call to notify Windows Media Player that there was a change in the user's log-in state. Other times, the plug-in makes this call to notify the Player that an attempt to log in failed. The pContext parameter of the Notify method specifies whether the notification is for a change of log-in state or for a failed log-in attempt.

Because every call to Notify(wmpcnLoginStateChange, ...) causes Windows Media Player to raise the OnLoginChange event, the OnLoginChange event handler is called sometimes as the result of a change in log-in state and sometimes as the result of a failed log-in attempt. To determine the user's current log-in state, the OnLoginChange event handler must call External.userLoggedIn.

Requirements

Requirement Value
Version
Windows Media Player 11
DLL
Wmp.dll

See also

External Object for Type 1 Online Stores

External.attemptLogin

External.userLoggedIn