Windows Runtime

The Windows Runtime (WinRT) contains a class library that you can use in your Windows Store apps. These classes are projected directly into JavaScript, so they appear to be built-in JavaScript objects.

For example, when we wrote our first Windows Store app, we took advantage of the WinRT Windows.Media.Capture.CameraCaptureUI class. When we called the CameraCaptureUI.captureFileAsync() method, we were able to take a picture.

All of the WinRT classes are exposed in JavaScript from the root Windows namespace. For example, you create an instance of the CameraCaptureUI class with the following code:

var captureUI = new Windows.Media.Capture.CameraCaptureUI ();

Note

Notice that WinRT class names can get ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.