Windows 7 .NET Interop Sample Libraries

We’ve got .NET sample libraries and example for managed code developers to target Windows 7 new APIs!

Windows 7 offers new functionality that developers can exploit in their applications to provide enhanced experiences and productivity for their end users. Included among these new features is the ability to add custom Tasks to the Taskbar Jump Lists, support the new Libraries and make your application Library aware, allow enhanced user interaction with Multi-Touch, and extend the application to “react” to its surroundings by adopting the Sensor and Location platform. You can read about these and many more new Windows 7 features in the Windows Engineering blog, Channel 9 videos, in earlier posts, and on The Windows Blog.

The Windows 7 Beta SDK is a great source of documentation and examples for using these new sets of APIs. However, most of the examples are written in native code similar to Windows 7 APIs which are all native C, C++, and COM APIs, which makes the life of managed code developers a bit hard. For that reason, Microsoft created the Windows Vista Bridge project that makes it easier for managed code developers to use Windows OS-specific APIs such as those described above. The current version of the Window Vista Bridge, version 1.4 contains many useful “Windows Vista” features such as  Restart and Recovery, Search, Power Awareness and other Shell integrations. However the current version doesn’t include any Windows 7 features. It will support key Windows 7 APIs in the near future, but until then, we have developed an intermediate set of solutions for supporting managed code developers who wish to target Windows 7 Beta today and not wait for the time the Windows API Code Pack for the .NET Library (the new name of Windows Vista Bridge) will be available.

NOTE: It is important to be aware that these solutions are not the “official libraries”; they come with no support or any sort of warranty -- in other words, use them at your own risk!

With that caveat in place, we can go ahead and introduce some new managed code wrappers that will allow managed code developers to use the Windows 7 Taskbar, manipulate Libraries, add Multi-Touch support for WinForms or WPF 3.5 SP1, and enable Sensors and Location in their applications.

Taskbar

The Taskbar Sample .NET Interop Library allows developers to:

  • Create and manipulate JumpLists including tasks and items
  • Display Dynamic Overlay Icons, Thumbnail Toolbars
  • Use the Taskbar progress bar
  • Control Custom Thumbnail Preview, and custom Preview also known as – AeroPeek

The Windows 7 Taskbar Sample .NET Interop Library is available for download and include 4 demos showcasing all the Taskbar features.

You can read detailed explenation about the Managed APIs for the Taskbar in the Windows 7 Taskbar .Sample .NET Library overview 

Windows7Taskbar

Libraries

Libraries are new in Windows 7 and provide a logical representation of the user’s data on  his local computer and on remote computers. With Libraries, the user can define which physical folders are mapped to which library and achieve better search quality and easier “maintenance” of his content. In Windows 7, it is important for developers to

enable their applications to become Library-aware by supporting Libraries. This will integrate the user's application and Windows experiences and maintain the integrity of your applications in various scenarios

The Windows 7 Library Sample .NET Interop Library allows developers to:

  • Manipulate and control the libraries in Windows 7 including create a new library or delete an existing one
  • Add or remove physical locations to a Library
  • Set an icon for each library
  • Enumerate the contents of a given library's physical location (the actual folders) to track down and map all the items in that library

The last point is very important since the Library root (that is the Library itself) is not a real  directory (there is no “c:\Libraries” or anything similar); it is just a logical location. In order to get to the actual items within the Library, you need to enumerate the contents through the listed physical folders.

The Windows 7 Library Sample .NET Interop Library is available for download, and we will provide a series of posts and Channel 9 Screencasts showing how to use the Libraries and Taskbar in Managed Code applications.

Sensor and Location Platform

The Sensor and Location platform provides a new and unified set of APIs for sensory inputs, for example Accelerometer, Light Sensors, or Location GPS are just few examples of sensors. This unified set of APIs makes it easy to consume sensory inputs and simplifies the Windows developer's life.

The Sensor and Location .NET Interop Sample Library provides an abstraction of the native Sensor and Location API and provides strongly typed objects for specific sensors and for its Sensor Data Report. For example, a Light Sensor has a strongly typed LightDataReport object.

You can read a detailed explenation about the Sensor and Location library

sensor control panel

 

With the Sensor and Location .NET Interop Sample Library, developers are able to create strongly typed custom sensor objects as well as use three built-in sensors: Accelerometer3D Sensors, Light Sensors, and Touch Array Sensors. These sensors are part of the Windows 7 Sensor Development kit.

This library also provides a unified location API for asking the common question of, "Where am I?" The nice thing about the Location platform is that developers can use the same APIs regardless of the underlying technology that is actually providing the answers, such as GPS, Wi-Fi triangulation, or IP Resolver.

The Library also includes a few demos like a light-aware MSDN Reader that changes the way the content displays according to the amount of light picked up by the Light Sensor.

The Sensor and Sensor and Location .NET Interop Sample Library is available for download, and make sure to read the prerequisites.

Multi-Touch

One of the most popular features in Windows 7 is Multi-Touch support. As was presented during PDC 2008, Windows 7 Developing Multi-Touch Applications, the current API is native and in the near future Windows Presentation Foundation (WPF) 4 will include full support of Multi-Touch in Windows 7. However, for the time being, the Multi-Touch Sample .NET Interop Library provides developers with full Multi-Touch functionality for both WinForms and WPF 3.5 SP1. The library includes few demos for reference, including detailed samples showcasing Multi-Touch gestures support, Manipulation and Inertia for both WinForms and WPF.

You can download the Multi-Touch Sample .NET Interop Library from.

A small and friendly reminder: These are just sample code; they are not supported and are based on the Windows 7 Beta SDK, which means they WILL CHANGE by RTM time. Make sure you stay alert for updates on the Windows Bridge status for the official Managed code libraries supporting Windows 7.


Comments

  1. Posted on: March 30, 2009 at 10:14PM  

    "With Libraries, the user can define which physical folders are mapped to which library and achieve better search quality and easier “maintenance” of his content."

    Which makes you wonder why Media Player doesn't leverage this instead of using its custom indexing and search (which run as additional overhead), neither of which seem to efficient, robust or sensitive to international character-sets.

  2. Posted on: March 31, 2009 at 12:34AM  

    I'm guessing that I am not the only average user that finds Libraries completely confusing, I get that Libraries are not in an actual physical location, however how exactly does a user make use of Libraries?

    There seems to be no easy guide to Libraries in Windows 7 Beta, at least in Build 7000 which I am running.

  3. Posted on: March 31, 2009 at 6:55PM  

    Cool, and thanks...one thing: the link for "Windows 7 Library Sample .NET Interop Library " actually points to the Taskbar sample.

    Yes it is true - since the Taskbar examples contains the Libraries library inlcuding the 2 librarie sdemos

  4. Posted on: March 31, 2009 at 7:05PM  

    Libraries allow you to collect links to alike sources. So it's useful if you have (for example) music files on multiple hard drives then you can add links to each of these folders under the Music Library. You can do this for pictures, documents etc. I have a lot of scanned music files and MIDI resources that I link conceptually but have scattered over multiple drives, so I created a "Sheetmusic" library to link all those up.

    You could more-or-less do the same thing by having master folders, with shortcuts to those other sources but you can run into problems with software that doesn't know how to handle folder shortcuts. This makes me wonder if I could choose to backup a Library to DVD - would I actually get a proper set of all  the files and folders I wanted, or a mess of shortcut files?

    While this is well and good, there are several problems when it comes to using Libraries as implemented. Firstly, those folders on NAS drives won't get indexed, so searching your library is very hit and miss. I keep all my audio files on a NAS drive so that my Sonos system can access them without having my computer on 24x7.

    Secondly, Media Player has a different set of Libraries which only partly maps to the Windows 7 Libraries. It adds a special Video library called "Recorded TV" which is not visible from the Windows shell. On the other hand it doesn't allow you to created specialised audio libraries for podcasts or spoken word material - all of that has to stay mixed up under Music.

    Thirdly, if you use Media Player for audio playback, then you get the overhead of Media Player running its separate indexer (see my first comment posted) over your Music, Video and Pictures libraries. I've got a 130GB photo library that I *never* want to see in Media Player but which is going to be background "managed" on top of the Windows indexer and no way to turn it off short of removing everything from your system Pictures Library.

  5. Posted on: April 03, 2009 at 12:34AM  

    בהצלחה!

  6. Posted on: September 01, 2009 at 1:18AM  

    I think part of windows 7 visuals have done a very good service pack would be great if I believe that removing

  7. Posted on: January 12, 2010 at 2:14PM  

    very pleasure to visit this site. nice post. thanks for sharing.

Trackbacks

  1. Posted by: The Windows 7 Blog for Developers on March 30, 2009 at 7:58PM

    Remember – we Moved to a new location . There is a new post on Windows 7 for Developers - Windows 7 .NET

  2. Posted by: Windows 7 .NET Interop Sample Libraries - Windows 7 for Developers … | Current Technology Updates daily on March 30, 2009 at 9:22PM

    Pingback from  Windows 7 .NET Interop Sample Libraries - Windows 7 for Developers … | Current Technology Updates daily

  3. Posted by: NETWORKING-THE.INFO | on March 30, 2009 at 9:27PM

    Pingback from  NETWORKING-THE.INFO |

  4. Posted by: Windows 7 .NET Interop Sample Libraries - Windows 7 News on March 30, 2009 at 10:07PM

    Pingback from  Windows 7 .NET Interop Sample Libraries - Windows 7 News

  5. Posted by: Tech today » Windows 7 .NET Interop Sample Libraries on March 30, 2009 at 10:08PM

    Pingback from  Tech today » Windows 7 .NET Interop Sample Libraries

  6. Posted by: progg.ru on March 30, 2009 at 10:08PM

    Thank you for submitting this cool story - Trackback from progg.ru

  7. Posted by: Windows 7 .NET Interop Sample Libraries - Windows 7 for Developers … | www.windows7vista.com on March 30, 2009 at 10:18PM

    Pingback from  Windows 7 .NET Interop Sample Libraries - Windows 7 for Developers … | www.windows7vista.com

  8. Posted by: Tech News, Resources from Blogosphere - 31 March 09(8) | Best Webhosting on March 30, 2009 at 10:58PM

    Pingback from  Tech News, Resources from Blogosphere - 31 March 09(8) | Best Webhosting

  9. Posted by: Windows 7 .NET Interop Sample Libraries Available on March 31, 2009 at 3:46AM

    Pingback from  Windows 7 .NET Interop Sample Libraries Available

  10. Posted by: Windows 7 .NET Interop Sample Libraries|Join Our Story!|AngNetwork Blog on March 31, 2009 at 4:09AM

    Pingback from  Windows 7 .NET Interop Sample Libraries|Join Our Story!|AngNetwork Blog

  11. Posted by: Windows API Code Pack for the .NET Library « Ira Lukhezo’s blog on March 31, 2009 at 5:20AM

    Pingback from  Windows API Code Pack for the .NET Library « Ira Lukhezo’s blog

  12. Posted by: Dew Drop - March 31, 2009 | Alvin Ashcraft's Morning Dew on March 31, 2009 at 8:47AM

    Pingback from  Dew Drop - March 31, 2009 | Alvin Ashcraft's Morning Dew

  13. Posted by: Windows 7 .NET Interop Sample Libraries - entwicklerGemein.de on March 31, 2009 at 10:12AM

    Pingback from  Windows 7 .NET Interop Sample Libraries - entwicklerGemein.de

  14. Posted by: Windows 7 .NET Interop Sample Libraries « Just Like a Magic on March 31, 2009 at 1:35PM

    Pingback from  Windows 7 .NET Interop Sample Libraries « Just Like a Magic

  15. Posted by: Najlepsze Programy, Recenzje, Informacje. » Blog Archive » Vista Bridge becomes Windows API Code Pack for the .NET Library … on March 31, 2009 at 3:30PM

    Pingback from  Najlepsze Programy, Recenzje, Informacje.  » Blog Archive   » Vista Bridge becomes Windows API Code Pack for the .NET Library …

  16. Posted by: Developing Windows 7 apps in managed code - .NET Developments on March 31, 2009 at 4:11PM

    Pingback from  Developing Windows 7 apps in managed code - .NET Developments

  17. Posted by: New Post on Windows 7 for Developers | Windows 7 Information, News, Downloads, Support Forums on March 31, 2009 at 7:55PM

    Pingback from  New Post on Windows 7 for Developers | Windows 7 Information, News, Downloads, Support Forums

  18. Posted by: Windows 7 Aero | PC Tips on April 01, 2009 at 6:02AM

    Pingback from  Windows 7 Aero | PC Tips

  19. Posted by: Windows 7 for Developers on April 03, 2009 at 2:32AM

    One of the first noticeable changes in Windows 7 Desktop is the new Taskbar. The Windows 7 Taskbar post

  20. Posted by: Windows 7 Taskbar .NET Sample Library - Review on April 03, 2009 at 2:52AM

    Pingback from  Windows 7 Taskbar .NET Sample Library - Review

  21. Posted by: Windows 7 Taskbar .NET Sample Library ??? an Overview | Windows Seven 7 on April 03, 2009 at 3:25AM

    Pingback from  Windows 7 Taskbar .NET Sample Library ??? an Overview | Windows Seven 7

  22. Posted by: Windows 7 Taskbar .NET Sample Library Review | ProgrammerFish - Everything that's programmed! on April 03, 2009 at 2:50PM

    Pingback from  Windows 7 Taskbar .NET Sample Library Review | ProgrammerFish - Everything that's programmed!

  23. Posted by: Windows 7 Taskbar .NET Sample Library Review | Tea Break on April 03, 2009 at 11:14PM

    Pingback from  Windows 7 Taskbar .NET Sample Library Review | Tea Break

  24. Posted by: shooter's me2DAY on April 05, 2009 at 8:29AM

    Windows 7 .NET Interop Sample Libraries

  25. Posted by: TechNet Flash Feed on April 06, 2009 at 12:28PM

    If you’ll be developing or migrating applications for Windows 7, the Windows 7 taskbar includes new functionality

  26. Posted by: RSS Weekly Digest - #1 on April 06, 2009 at 12:58PM

    Pingback from  RSS Weekly Digest - #1

  27. Posted by: Windows 7 for Developers on April 06, 2009 at 7:38PM

    Libraries are the primary entry points to user data in Windows 7. They are the natural evolution from

  28. Posted by: Windows 7 Libraries .NET Sample Library ??? an Overview | Windows Seven 7 on April 06, 2009 at 8:19PM

    Pingback from  Windows 7 Libraries .NET Sample Library ??? an Overview | Windows Seven 7

  29. Posted by: You Get The . Info » Windows 7 Libraries .NET Sample Library ??? an Overview - 22th Edition on April 07, 2009 at 8:17AM

    Pingback from  You Get The . Info » Windows 7 Libraries .NET Sample Library ??? an Overview - 22th Edition

  30. Posted by: Windows 7 Libraries .NET Sample Library ??? an Overview | Windows 7 Information, News, Downloads, Support Forums on April 07, 2009 at 4:03PM

    Pingback from  Windows 7 Libraries .NET Sample Library ??? an Overview | Windows 7 Information, News, Downloads, Support Forums

  31. Posted by: Windows 7 Taskbar .NET Sample Library ??? an Overview | Blog on April 09, 2009 at 9:28PM

    Pingback from  Windows 7 Taskbar .NET Sample Library ??? an Overview | Blog

  32. Posted by: Windows 7 Libraries .NET Sample Library ??? an Overview | Blog on April 09, 2009 at 9:29PM

    Pingback from  Windows 7 Libraries .NET Sample Library ??? an Overview | Blog

  33. Posted by: Windows 7 .NET Interop Sample Libraries | Coded Style on April 14, 2009 at 11:14PM

    Pingback from  Windows 7 .NET Interop Sample Libraries | Coded Style

  34. Posted by: Windows 7 .NET Interop Sample Libraries | Coded Style on April 14, 2009 at 11:14PM

    Pingback from  Windows 7 .NET Interop Sample Libraries | Coded Style

  35. Posted by: Windows 7 .NET Interop Sample Libraries | Coded Style on April 14, 2009 at 11:14PM

    Pingback from  Windows 7 .NET Interop Sample Libraries | Coded Style

  36. Posted by: Windows 7 .NET Interop Sample Libraries | Coded Style on April 15, 2009 at 1:18AM

    Pingback from  Windows 7 .NET Interop Sample Libraries | Coded Style

  37. Posted by: ??????????????????2009-04-16?????? - SharpLab. on April 15, 2009 at 10:59AM

    Pingback from  ??????????????????2009-04-16?????? - SharpLab.

  38. Posted by: Windows 7 Taskbar .NET Sample Library – an Overview « vincenthome’s Tech Clips on April 24, 2009 at 2:30PM

    Pingback from  Windows 7 Taskbar .NET Sample Library – an Overview « vincenthome’s Tech Clips

  39. Posted by: Windows API Code Pack for Microsoft .NET Framework (alpha: v0.8) | Coded Style on May 05, 2009 at 12:32AM

    Pingback from  Windows API Code Pack for Microsoft .NET Framework (alpha: v0.8) | Coded Style

  40. Posted by: Windows API Code Pack for Microsoft .NET Framework (alpha: v0.8) | Coded Style on May 05, 2009 at 12:32AM

    Pingback from  Windows API Code Pack for Microsoft .NET Framework (alpha: v0.8) | Coded Style