Skip navigation

Windows 8 Feature Focus: Contracts

Unless you’re a serious old timer, you probably don’t remember when copy and paste functionality, now a common and expected feature, was added to Windows. Well, this time you have no excuse: Microsoft is adding a new capability to Windows 8 called contracts. And as with copy and paste, you’re going to have a hard time remembering using Windows before this happened.

Contracts is a feature of the Metro environment in Windows 8, and individual contracts can be added to Metro-style apps, providing them with additional capabilities. Windows 8 provides five such contracts: Search, Share, Settings, Play To, and App to App Picking. But before getting into the specifics of these individual contracts, let’s examine the contracts feature from a mile high first.

You may recall that Microsoft has designed Metro to be secure and reliable, and that the reason Metro exists in the first place is that a truly robust platform, as Microsoft puts it, could not be retrofitted onto the existing system. There are many aspects to this new platform, but a big one is that Windows 8 and its Metro environment is a way for Microsoft to bring the best aspects of smart phone usage—full screen, services-connected apps while the OS manages background activity so that only apps you are actively using can drain the battery—to the PC. And Metro and its apps aren’t just power management friendly, they’re also sandboxed from each other and the OS, unable to negatively impact each other or Windows itself.

Of course, such a system is by definition constrained as well. After all, sandboxed apps cannot communicate with each other, by design. So Microsoft has built system-level capabilities into Windows 8 that help overcome these limitations without subverting the security model. Additionally, these capabilities are rendered consistently from app to app, so that the user only needs to learn one method for searching, one method for sharing, and so on. These capabilities are known collectively as contracts.

I’ve described contracts before as copy and paste on steroids, and while that’s over-simplification, it’s apt enough. I noted before that most people use the copy and paste facilities in Windows without ever consider how monumental and important this now basic functionality was when it was first added to Windows and other OSes. But do consider this for a moment. Thanks to the magic of copy and paste, two applications that know absolutely nothing about each other can exchange data in very meaningful ways, and often with full fidelity. A graphics scrap that is copied with Paint can be pasted into Photoshop with no loss in quality. And a block of text in Word can be pasted into other applications, often with all of the formatting completely intact. And so on.

Copy and paste has served us well in the freewheeling, multitasking world of Windows thus far. So what does contracts bring to the table in the more locked-down and predictable Metro environment?

Quite a bit, as it turns out.


In Windows 8, search is now a system-wide feature that Metro-style apps can utilize as well. So instead of just searching for apps and applications, settings, and files—all of which was possible in Windows 7 and earlier Windows versions—users can now search within (Metro-style) apps as well. If you access the system-wide Search feature from the Windows desktop or the Start screen, you will see the new Search experience, scoped to apps (and applications; Microsoft tries to draw no distinction between the two). But you can also re-scope the search to settings (which includes Metro-style PC settings as well as classic control panels), to files, or to any installed (Metro-style) app that supports this feature.


There are two related items of interest here. First, you can search compatible Metro-style apps from anywhere in the system. All you have to do is invoke the search experience (WINKEY + Q, or via the Charms bar), perform a search, and then select the app you which to search.

Second, you perform search within apps exactly as you do without. But when you access the search experience from within an app, using the previously mentioned methods, it will already be scoped to the app. So if you access the search experience from Mail, you’ll be searching your email, as expected. But you’re doing so in a way that is entirely consistent with search everywhere else in the system.


Interestingly, you can still re-scope the search, too. So if you do search your email but then wish to apply that same search to, say, Music, News, or the web (via Internet Explorer), doing so is as easy as choosing the right app from the list.


The Windows 8 search experience of course provides consistent features, though the way that search results are handled can (and does) vary from app-to-app. This includes search suggestions with auto-complete, which appear below the search box, that are persistent and app specific.



The Share contract is, of course, the Metro functionality that maps most closely to copy and paste. It provides a way for one app, called the source app, to provide a data package that can be shared with a second app, called the target app. This data package can include plain or formatted text, a URI (uniform resource identifier) which is typically a web address, HTML, images, files, or custom data formats that are app-specific. When such a share request is made, as described below, the Share experience will provide a list of apps that are registered with the system as being able to fulfill the share target action. The user then selects the app with which they’d like to share.

Here’s how it works in the real world. Here, we’ll examine the now canonical share example, since it’s so obvious. You’re browsing the web and you’d like to share a favorite web site with others. To do so, you’ll use Internet Explorer, since it’s the only Metro web browser at the moment. And to invoke the Share experience, you’ll use the same keyboard shortcut (WINKEY + H) or touch/mouse (Charms, Share) method regardless of the app. (Note that Share only works in Metro-style apps. You cannot start sharing from the desktop or Start screen.)

The Share experience appears as a Metro-style pane, much like the Search experience. But the apps you see listed here will depend on two things: Which apps you’ve OK’d for sharing in PC settings, and which of those apps are compatible with the type of data you’re sharing.


The apps you use to share with the most will also appear at the top of this list, though you can override that behavior in PC Settings as well. Furthermore, the people you share with are propagated to the top of the list as well. So if you share a web page via email with Paul Thurrott, as noted below, that item—Email Paul Thurrott—will appear at the top of the list so you can do so again more quickly next time.

In IE, you may assume that invoking Share from any web page view will trigger a URI (URL) share and that what you’re sharing here is essentially just the web address of the page you’re viewing. But this app is actually a bit more sophisticated than that. As you can see, sharing via Mail—one of the few apps that can currently perform this duty—in fact provides a fairly nice looking preview of the article as well.


While IE, and other Metro-style apps, do support copy and paste too, you could optionally select a block of text in a web page and then invoke share. When you do, the selected information is shared, not the web page as before. Again, it’s fairly intelligent, though capabilities will vary from app to app, on both the source and target ends of the contract.


In traditional Windows applications, developers are free to expose settings and customization features via any interface they prefer, leading to a slew of inconsistent interfaces, of course, but also methods for accessing those interfaces. (For example, iTunes settings, called Preferences, are accessed via Edit, Preferences. But Word 2010 settings, called Options, are accessed via File, Options.)

In Metro, the Settings experience has been standardized across all experiences, and you can access this interface from the Start screen, any Metro-style app, and even from the Windows desktop. For Metro-style apps, this new Settings experience means that users only have one place to look (WINKEY + I, or Charms, Settings) to access settings.


What’s interesting about the Settings experience is that it provides both context-sensitive settings—those settings related to the app or experience you’re currently viewing—as well as system-wide settings, which appear in the bottom of the pane. Those system-wide settings are available consistently every time you access the Settings experience, and they provide a way to make quick adjustments of commonly needed system settings like volume and screen brightness, as well as a link to the Metro-based replacement for Control Panel called PC Settings.

Of course, apps are free to provide whatever settings interfaces they need. And some are quite different. While most Metro-style apps keep their settings interface constrained within the provided Settings pane, Internet Explorer for some reason goes its own way.


Play To

Where Apple has the excellent AirPlay technologies for using other devices as remote speakers and for video playback (such as playing a video from an iPad onto a HDTV screen via an attached Apple TV), Microsoft has instead adopted the industry-standard DLNA technologies instead. Microsoft calls this capability “Play To,” and while few people used it in Windows 7 because it was hard to find and then even harder to find compatible devices if you did find it, the company hopes that integrating it into Windows 8 will put this system on par with the Apple ecosystem.

This is likewise going to be a problem in Windows 8, I think. In my own testing, I wasn’t able to ever get the Play To experience to appear because I apparently don’t have any DLNA-compatible devices (which is odd, since I do). But I’m told that Play To is accessed via the Devices experience (WINKEY + K, or Charms and then Devices): Just choose Play To and then the appropriate device.

Note that Microsoft is also providing a Play on Xbox function in certain apps—like Xbox LIVE Games, Music, and Video that lets you play content to an Xbox 360 console—much as Apple users do with Apple TV—through yet another app, the Xbox Companion. If you are trying to play content to your HDTV and have fully invested in the Microsoft ecosystem, this is a fairly seamless way to do so. And it works now, which is nice.

App to App Picking

This interesting contract allows an app to select files from within another app. It integrates with another system-level Metro feature, the file picker, which provides a full-screen experience for selecting one or more files. These files can come from within the file system of your PC—in fact, the file picker is the only way to even access the file system from within Metro since Microsoft doesn’t provide an Explorer-like app—but they can also come from other apps.

The obvious (and bundled) example is SkyDrive: When this app is installed, you can use the file picker to select files from your PC’s hard drive (and the connected network and Homegroup PCs) and from SkyDrive’s cloud storage. I’m curious to see which other online storage services come on board.

The file picker isn’t just used for finding files. An app can also use this interface to save files, of course.

Final thoughts

While Metro is obviously an incomplete environment and one that will struggle for years to catch up with Windows desktop technologies many of us take for granted, contracts is a good example of how the company is trying to anticipate many often-needed features and provide them in a consistent and reliable fashion. Combined with other system-level functions like printing, it’s pretty clear that some of Metro, at least, is in fact well designed. And we should celebrate the little victories.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.