Accessing Windows 7 Features from Silverlight
Microsoft has released a library exposing Windows 7 features – sensors, speech, devices, taskbar, touch – to Silverlight Out-of-Browser applications running with elevated trust.
Silverlight was meant initially to run only in the browser and to have very limited access to system’s resources for security reasons. Later, Microsoft introduced the Out-of-Browser (OOB) capability, allowing Silverlight applications to run outside the sandbox of a browser, but still having some limitations. Silverlight 4 came with COM+ Automation allowing Silverlight OOB applications to access Windows components with a COM-enabled API. This feature was specifically introduced for enterprise customers and requires elevated trust. The problem is that not all Windows components support COM, so they are not accessible from Silverlight.
Native Extensions for Microsoft Silverlight (NESL) is a library of components exposing Windows 7 features to Silverlight applications. Version 1.0, released in December last year, brought support for the following components:
- Windows Sensor API - accelerometers, light sensors, compasses, gyroscopes, etc.
- Microsoft Speech API - Text to Speech (Speech Synthesis), Speech to Text (Speech Recognition)
- Windows Portable Devices API – access portable devices such as 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 and capturing user interface interaction as video
- Window Message Interception – accessing messages sent to the Silverlight OOB host window
A month later, Microsoft has released NESL 2.0 Preview Build, adding support for multi-touch, demos and bug fixes for v.1.0. More features are to be added in future versions of the library.
The library runs only on Windows 7 32-bit or 64-bit, and can be used by an OOB Silverlight application running in elevated trust. NESL is not supported on other editions of Windows nor on Mac OS X. The code is being released under the Microsoft Code Sharing License.