Introduction To WinRT (Windows Run Time)

The Windows Runtime (WinRT) library is the default Application Programming Interface (API) used by the operating system (OS).

WinRT is a C++ object-oriented API sitting at the same level as the Win32 API. WinRT is a platform-homogeneous application architecture on the Windows 8 operating system.

WinRT supports development in C++/CX (CX is the component extensions to the C++ language) and manages the languages C#, VB.Net and JavaScript. WinRT applications support both the X86 and ARM architecture and runs inside a sandbox (sandboxed created environment to allow for security and stability). WinRT is another abstraction layer. It is a new runtime sitting directly on top of the Windows Kernel Services just like the good old Win32 API as shown in the following figure that allows developers to write Metro-style applications for Windows 8.

winRT 

WinRT comes with an Application Programming Interface (API) in the form of a class Library. It expose the features of Windows 8 for the developer. WinRT can be described as an API at the same level as Win32. The only difference with Win32 is that WinRT is exposed to all application developers.

WinRT contain the following Property

All the parts of the API are designed to be asynchronous. WinRT provides WPF/Silverlight and a XAML UI model to the developer. its wraps both the Win32 API and the new UI system together. Its has a simple programming model for creating the UI. It is especially for Windows developers that do not need to learn the Win32 API or us LPARAMs or WndProcs.

Relation between .Net and WinRT

.Net has the following two profiles:

  • .NET Metro profile, the CLR deals with Metro applications
  • .NET Client Profile, the CLR runtime is for C# and VB.NET applications

 

metro 
 
The .Net Framework and the Common Language Runtime are integrated into the WinRT as a sub-platform. The CLR provides the services like JIT compilation code and garbage collection. A WinRt application using a .Net language uses the new Windows Runtime XAML Framework and is primarily written in C#, VB.Net and for the use of XAML with native code using C/C++.

WinRT offer a framework that looks like the familiar. Net Framework with some key differences. For the programming framework developers deal with, some classes are very similar to .NET Framework classes, with only one minor difference. The .NET Framework classes are not exposed to WinRT applications and are unavailable.

What Metro means

It represents a new design language for Microsoft's Mobile Phone and Tablets and PCs. Metro was the code name of the design system used in the Windows 8 and Windows Phone user interface. For example a Metro app that uses sensors to determine your location. If you understand web development technology is you can use HTML5 CSS3 and JavaScript or you can use traditional programming techniques. All Metro Applications must be Digitally Signed; anonymous applications are not allowed. Applications can be self-signed for testing.

Role of JavaScript

Another major language for Windows 8 is JavaScript. A JavaScript application looks like any other Metro application.The big advantage of being able to this is that you can bring your web expritise to Windows and take your Windows app to the web. This article shows you how to get started with HTML and JavaScript based applications.

Windows classes

The Windows classes are native C/C++ libraries that are exposed by the WinRT.

Summary

We have learned about WinRT, its features and how it works with the .Net Framework.

Up Next
    Ebook Download
    View all
    Learn
    View all