Partager via


Initializing the Page

[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.]

When the webpage loads, the Init function runs. This code first retrieves any data stored in a previous session. For details, see Maintaining Session Information. It then creates the DownloadManager object and stores it in the global variable named g_oManager.

g_oManager = external.DownloadManager;

Next, the function connects the OnColorChange event to the function named OnAppColor and then calls the function directly to initialize the background color. See Matching the Windows Media Player Colors.

Finally, the function starts a timer with a one-second interval and initializes the list boxes that display the pending download collections and download items. This is important because there may have been sessions in progress the last time the online store closed and this information needs to be displayed again.

Using the Download Manager