If you’re building an application for the Windows platform, you’re probably aware of the new capabilities of Windows 7. Features like the new Windows Taskbar with Jump Lists, the Windows Sensor and Location platform, and, of course, support for rich user interactions through touch – these are just a few of the awesome capabilities of Windows 7 that developers can support in applications today.
For developers building Windows 7 applications with managed code, we have the Windows API Code Pack, a source code library designed to help managed code developers target key features of Windows without forcing them to resort to Platform Invocation Services (P/Invoke) or COM Interop. Moreover, it abstracts all of the heavy-lifting away, leaving you with a clean API for you to target.
Enter Silverlight OOB applications.
When showing the Windows API Code Pack to many developers across Canada, I would get the same question over and over again: How can I target these capabilities of Windows 7 that you’ve shown me, but in Silverlight 4 OOB applications? Until recently, I would answer this question by describing how Silverlight 4 introduced interoperability with local COM components and thus, a means to an end. In other words, a way of getting to these capabilities but not without a great deal of heavy-lifting; indirectly through custom COM automation components and lots and lots of COM interop.
Enter Native Extensions for Microsoft Silverlight (NESL). From the project’s description (with emphasis by me):
Silverlight 4 introduced the ability for Silverlight applications running out-of-browser with elevated trust on Windows to access COM automation components. This in turn made it possible for Silverlight developers to leverage the automation capable Windows platform API’s and object models from application software such as Microsoft Office products in their OOB applications via COM automation.
However, a large majority of the Windows platform API’s today cannot be accessed from Silverlight this way. Some do support COM, but do not support automation; while the others are only accessible through a native language like C or C++.
The Native Extensions to Microsoft Silverlight(NESL) libraries attempt to alleviate this problem by providing COM automation components that act as wrappers over select Windows API’s to make them accessible from Silverlight 4. NESL is an evolving set of libraries, where each phase of the project may add wrappers to additional Windows API’s.
In short, Native Extensions for Microsoft Silverlight provides a mechanism of targeting Windows 7 capabilities like the new Taskbar with Jump List integration, the Windows 7 Sensor API, Windows 7 Speech-to-Text and Text-to-Speech, and much more. Specifically, here are the APIs covered in NESL v1:
- Windows Sensor API
- Integrate sensors in you Silverlight app – Accelerometers, Light sensors, compasses, gyroscopes etc.
- Microsoft Speech API
- Text to Speech (Speech Synthesis)
- Speech to Text (Speech Recognition)
- Windows Portable Devices API
- Enumerate and access content from connected portable devices (cameras, phones, music players, scanners etc.)
- Windows 7 Taskbar Integration
- Jump lists, overlay icons, overlay progress display, Thumbnail toolbars etc.
- Webcam Local Encoding and Window Capture
- Encode webcam capture into mp4 (H.264/AAC-LC) media
- Capture user interface interaction as video
- Window Message Interception
- Intercept and act on Window messages sent to the Silverlight OOB host window
Yesterday, NESL version 2.0 Preview Build was made available! Here’s what’s new:
- New Features
- Touch Features
- Gesture support
- Manipulation processing support
- Inertia processing support
- Touch hardware information
- Touch Features
- New Feature Demos for Local Encoding, Portable Devices, Touch and Sensors
- Bug fixes
Awesome stuff! If you’re building Silverlight 4 OOB applications and you’re looking to target capabilities of Windows 7 then make sure to check out theNative Extensions for Microsoft Silverlight.
Finally, make sure to check out the following resources:
- First, go check out an excellent post from Mike Taulty entitled, Native Extensions for Silverlight (NESL)?. It’s a monster blog post but well worth the read.
- Next, watch the MSDN Webcast: Native Extensions for Microsoft Silverlight (NESL) (Part 1 of 2).
- Finally, sign up for the MSDN Webcast: Native Extensions for Microsoft Silverlight (NESL) (Part 2 of 2) scheduled for Tuesday, January 25.