Excited about Windows 7 and would like to use new features from your managed application, but do not have a convenient way to do that? Always wanted to use many of the useful features from Windows Vista or older versions of Windows but could not do so because they were not available via .NET Framework?
There is help available now for some of your needs. Perhaps, you are already aware of Windows® API Code Pack for Microsoft® .NET Framework and have tried the version 0.85 or 0.80. We have just released the version 0.90 of this Code Pack. For people reading about it for the first time, Windows API Code Pack is a source code library to support targeting some new Windows 7 features and some other features existing in older versions of Windows from managed code. These features are not available via .NET Framework Class Library today. Using Windows API Code Pack you can target many of these useful Windows features without having to write interop code yourself. If this sounds familiar to VistaBridge, that is because the Windows API Code Pack evolved from it.
The Window API Code Pack includes a complete source code library, sample applications and API reference documents. You can build the included solution files to get the assemblies for use in your applications (pursuant to the attached license). And since the source code is available to you, it can be modified to extend functionality as needed.
We will discuss individual feature areas of the Windows API Code Pack in detail in subsequent posts; this post is intended to provide a brief overview of various feature areas.
Shell (including Windows 7 Libraries) – Windows Shell APIs provide a rich set of COM interfaces and functions for developers to interact with Shell. But managed developer cannot easily access these APIs unless they write their own interop layer. Shell related features in the Code Pack enable managed developers to access many of the vast resources of Windows Shell APIs in a standard .NET friendly way.
Since pictures are worth a thousand words, screen shots of some of the sample applications (included in the Code Pack) eloquently demonstrate the capabilities of the above features
Windows 7 Taskbar – Taskbar features of the Windows API Code Pack provide convenient access to the new Taskbar functionality
Screen shots of some of the sample applications (included in the Code Pack) demonstrating the above features
DirectX Technologies – The DirectX features of Windows API Code Pack expose a wide range of Windows graphics APIs to managed developers. Many of these are new to Windows 7.
Screen shot of a ‘Paint’ like sample application built using these features showcases some of the capabilities of the Code Pack.
Screen shot of another application showcasing the advanced texture and mesh features of Direct3D, WIC managed APIs and some utilities
Sensor Platform APIs - The Sensor feature of the Code Pack gives developers access to the new Sensor Platform APIs from managed code. Windows 7 has introduced standardized support for physical sensors, such as accelerometers and ambient light sensors. A developer can use the Code Pack to collect data reports from sensors attached to the computer and process changes received in the sensor data reports.
Screen shots of sample applications demonstrating use of accelerometer and ambient light sensor data.
Extended Linguistics Services (ELS) APIs – ELS APIs are new to Windows 7. ELS feature of the Code pack provides managed developers the ability to detect the script or language being used and adjust the user experience accordingly.
Power Management – provides managed code access to power settings and notifications for related changes.
Screen shot of the sample application that demonstrates the use of power management related APIs
Application Restart and Recovery – lets a managed application save data and state information before an application exits because of an unhandled exception.
The screen shot of a sample application below demonstrates this feature. In the event of an application crash, the library allows the application to recover its data and when restarted by the system, it can load the previously saved data
There are many other samples (available both in C# and VB.NET in some areas) included in the Code Pack. Please download and play with the Windows API code pack and samples to explore its full potential. We are currently working on fixing bugs and preparing for the final update around the Windows 7 RTM release. Please let us know if you find any issues or have any suggestions, by using the Discussions or Issues tab and help us make the Windows API Code Pack better.
More detailed post on different feature areas coming soon.
Sumit Kumar
Program Manager, Windows SDK Team