Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Windows 8 Replaces the Win32 API

Windows 8 Replaces the Win32 API

This item in japanese

Windows 8 introduces a new core API called WinRT. This is used to develop Metro style applications using C/C++, .NET, or JavaScript. These applications automatically gain features such as hardware acceleration and advanced power management out of the box. Existing Silverlight and WPF applications can be ported to the new “Native XAML” libraries with minimal effort.

What follows is a summary of the keynote presentation. More details will be provided as they become available.

General Notes

Windows 8: Base line memory usage dropped from 540 MB to 281 MB.

The lock-screen can now display user content.

Touch-based passwords, essentially you tap on three points of an image to unlock the machine.

Like Windows Phone, the start page uses the metro style with live tiles.

There is a heavy emphasis on full screen applications.

Application specific and system settings share the same space on the user interface. It appears that applications will need to indicate which systems settings are relevant.

New version of Internet Explorer will be completely free of chrome. All of that functionality is hidden in application bars that slide into view.

Spell check is included system wide.

Developer preview includes Visual Studio 11 Express, Expression Blend 5. There is no timeline for the next milestone, which is the public Beta. Intern updates will be pushed to the preview machines on an as needed basis. The preview will be available starting tonight as at for x86/x64.

Application Integration

Windows 8 will have extension points known as “charms”. An example of a charm is the “share charm” which shows all the ways text can be shared such as email, Facebook, Twitter, etc. Applications can register themselves inside a charm by implementing the correct interfaces. Meanwhile other applications can indicate they are capable of sending information to the charm. The concept is very much like JavaScript mashups or classic OLE, but with a lot more thought about what those interactions should be.

System wide search is now supported. Again, applications can register themselves as a search provider.

Applications can expose files directly from the cloud for use by other applications. One does not need to copy files such as images to the local hard drive before other applications can access them.

Developing for Windows 7: Classic platforms:

· HTML/JavaScript on Internet Explorer

· C/C++ on Win32

· C#/VB on .NET and Silverlight

Developing for Windows 8: Metro Style

Windows Kernel is still at the bottom of the stack

WinRT is the new OS-level API layer. This is the new native API for Windows, it isn’t a new layer on top of Win32.

You can access WInRT from C/C++, C#/VB, or JavaScript. XAML is the UI layer for C, C++, C#, and Visual Basic. HTML/CSS will continue to be used as the UI layer for JavaScript.

Visual Studio will have project templates for the various styles of Windows 8 applications. The first demonstration is a JavaScript-based application. The application isn’t compiled but it is packaged into a bundle that includes all the html and JavaScript files needed by it. Windows 8 runs it directly, there is no need to launch the web browser.

As alluded to above, JavaScript can access the native functionality from the WinRT API. In the keynote demo it only took a couple lines of code to expose the new Windows open file dialog. Since Facebook was already installed on the machine the open file dialog showed images from the presenter’s Facebook page. The JavaScript application had no networking code at all, this link between it and Facebook was handled entirely by the platform.

Expression Blend now supports HTML and CSS with much

The HTML 5 grid proposal is essential to building Windows 8 applications. Without it supporting the wide variety of screen resolutions that Windows 8 runs on would be very difficult.

Metro style applications are automatically suspended when not visible. This was done to prolong battery life.

App Stores

As expected there is now going to be a Windows store for distributing applications. The technological aspects of application licensing is handled by the by store itself, one merely has to indicate basic information such as price and whether or not there is a demo period.

A certification process is required for offering applications in the Windows store. The tools used to certify applications will be given to developers so they can see and correct violations before they formally submit the application.

The application for accessing the Windows 8 store is actually written using JavaScript over the WinRT API.

The app store is not limited to Metro style applications, traditional Win32 applications can also be offered via the store.

Upgrading from Silverlight to Windows 8

In the demo all the of the existing XAML worked as-is. The presenter just needed to change the namespaces (e.g. System.Windows becomes Windows.UI) and tweak the networking code. With only a couple more lines of code he was able to register the application as a search provider.

Moving from Windows 8 to Windows phone just required an extra line or two.

Hardware Support

A new mode called “Connected Standby” is inspired by mobile devices. The power consumption is very low with occasional spikes as the Windows temporarily turns on the network connection to allow applications to receive updates. Since the system is never actually turned off it comes alive instantly.

Max hard drive size is 256 terabytes. Windows 7 was limited to a 2 terabyte boot drive.

The entire platform is built to use hardware accelerated graphics. Metro style applications will use them by default, no additional coding is needed to enable it.

The Sensor Fusion API will combine the information from the gyro, accelerometer, and magnetometer. Getting basic information such as the physical orientation of the device takes three lines of code.

The networking stack now supports concepts such as the side-channels in 3G.

For the give-away they are offering a Tablet running Windows 8 and Visual Studio.

Refresh and Reset

Using the Refresh command will remove everything except personal information/settings. Metro-style applications will be retained, any Win32 style application will be removed. This is one from a baseline image and should be run in response to system problems such as viruses.

The Reset command will completely wipe the PC. All personal information is removed and it is returned to the factory settings as if it were just purchased new.

There is a command line tool to update the baseline image. This would be used to add applications such as Visual Studio or Office to the standard image. Enterprise users would most likely want their companies custom software also included in this baseline image.

Cloud Services

Application settings, themes, passwords, etc. can by synchronized across machines using a Windows Live account.

The Windows address book pulls in contacts from all sources including social networking sites and exposes them via your Windows Live account. Likewise shared calendars are aggregated.

Windows SkyDrive is available to all users with a Windows Live account. Developers can access it as if it were a normal disk drive.

Windows Live allows one machine to access another even if it is behind a firewall. Companies that are concerned about information security should take care, as this allows common users with no technical skills easily move otherwise restricted files from their workstation to home machine without even being in the building.

Microsoft is expecting developers to use Windows Live to connect their applications together.

Who built the Apps?

17 teams of 2 to 3 developers each worked for ten weeks on the demo applications. They were all summer interns working on an evolving platform.

Rate this Article