Search Wiki:

The Windows® API Code Pack for Microsoft® .NET Framework provides a source code library that can be used to access some new Windows 7 features (and some existing features of older versions of Windows operating system) from managed code. These Windows features are not available to developers today in the .NET Framework.

The individual features supported in this version (v1.0) of the library are:
  • Windows 7 Taskbar Jump Lists, Icon Overlay, Progress Bar, Tabbed Thumbnails, and Thumbnail Toolbars.
  • Windows 7 Libraries, Known Folders, non-file system containers.
  • Windows Shell Search API support, a hierarchy of Shell Namespace entities, and Drag and Drop functionality for Shell Objects.
  • Explorer Browser Control.
  • Shell property system.
  • Windows Vista and Windows 7 Common File Dialogs, including custom controls.
  • Windows Vista and Windows 7 Task Dialogs.
  • Direct3D 11.0, Direct3D 10.1/10.0, DXGI 1.0/1.1, Direct2D 1.0, DirectWrite, Windows Imaging Component (WIC) APIs. (DirectWrite and WIC have partial support)
  • Sensor Platform APIs
  • Extended Linguistic Services APIs
  • Power Management APIs
  • Application Restart and Recovery APIs
  • Network List Manager APIs
  • Command Link control and System defined Shell icons.

What’s New in this update (v1.0):
The new features added in this update of code pack are:
  • Shell Search API support.
  • Drag and Drop functionality for Shell objects.
  • Support for Direct3D and Direct2D interoperability.
  • Support for Typography and Font enumeration DirectWrite APIs.

Other enhancements done in this update are:
  • Bug fixes in all areas.
  • Performance optimizations.
  • Some improved and new samples (esp. for the new features in this release).
  • Improved API reference documentation.

Requirements:
  • Minimum .NET Framework version required to use this library is 3.5 SP1.
  • This library targets the Windows 7 RTM version (now available to MSDN subscribers), though many of the features will work on the older versions of Windows operating system.
  • DirectX features require Windows SDK for Windows 7 RTM. Additionally, some Direct3D samples require the March 2009 release of DirectX SDK.

Building and using the Library:
  • To build the library (except the DirectX related features) in Visual Studio 2008, please extract the contents of the ‘WindowsAPICodePack.zip’ file in a new folder and build the included ‘WindowsAPICodePack.sln’ file.
  • To build the DirectX features, build the 'DirectX.sln' file inside the DirectX directory. Additional information on using the DirectX features of the Code Pack can be found in the 'DirectXCodePack_Requirements.htm' document available as a separate download.

Samples:
The Code Pack also contains sample applications built using this library. Each sample has a C# version and a VB.NET version and has its own solution file.

Documentation:
The Code Pack also includes API reference documentation. API documentation files can be found in two separate files WindowsAPICodePackHelp and DirectXCodePackHelp in the download section.

Note:
Some users may experience a security related issue when opening the help files or the Visual Studio solution. Contents of help files may not be visible or a security warning similar to “Unknown Publisher” or “This file came from another computer and might be blocked” may pop up. If that happens, the user won't be able to load the solution projects because Windows will block it.

To remove that error, please unblock the help files and zip file before extracting it (right click the file | select properties | click Unblock button).

Videos:
Two minute videos demonstrating some of the features in this release are now available:


Last edited Sep 11 at 6:05 PM  by sumitmsft, version 42
Comments
SBussinger wrote  May 1 at 11:35 PM  
Thanks for putting this up! I'd love to see you write some support for the new Windows 7 API for the Windows Biometric Framework.

onoj wrote  May 8 at 6:15 PM  
hi SBussinger. Check out Dan Griffins biometric sample for info on how to call the Biometrics Framework: http://www.jwsecure.com/dan/2009/02/17/new-test-devices-for-biometrics-project/

Octavio wrote  May 10 at 7:31 AM  
Does this release include (or will include) support for multi-touch features?

sumitmsft wrote  May 14 at 10:18 PM  
Multi-touch features are not likely to be included in this release of Windows API CodePack.

sandit27 wrote  May 19 at 11:43 AM  
Thanks for this release..

wayne_p wrote  May 24 at 12:33 AM  
Will these become a part of .NET Framework 4.0? If not, at what point will they be added?

RichardDeeming wrote  May 26 at 1:52 PM  
It would be nice if the documentation included information about the minimum supported version of Windows for each feature, and some idea of how the API will fail on an unsupported platform.

mfc_97 wrote  May 27 at 7:47 AM  
Thanks for this effort! Are we going to see the new DirectX features, d2d and direct text ?

xyzzer wrote  Jun 12 at 3:44 PM  
D2D 1.0 and DirectWrite support are there in the new release!

devDept wrote  Jun 23 at 10:07 AM  
Does this mean we can use Direct3D with managed code? As we did with DirectX 9 and Managed Direct3D? Thanks.

xyzzer wrote  Jun 24 at 2:39 PM  
Yes!

RyGuy12 wrote  Jul 1 at 9:56 PM  
Will we ever get support for the Ribbon?

cjmarsh wrote  Jul 8 at 10:35 AM  
Hi there - will there be support for the Mobile Broadband API at some point?

REVAN wrote  Jul 10 at 8:19 PM  
Thanks for nice Lib. I'm interesting about support of D3DX general and D3DX Math. And, like a RyGuy12, what about Ribbon?

sumitmsft wrote  Jul 10 at 9:49 PM  
RyGuy12 - The V1.0 release of the Code Pack will not have support for Ribbon. We are considering this feature for future versions.

cjmarsh - Thanks for the feature request. We will add Mobile Broadband API support to the list of potential candidates for future releases.

REVAN - We do not have full support for D3DX but we have basic Math and utilities library that we have used to build our samples. In addition, the included DirectX utilities (in Samples) show how to wrap D3DX interfaces and methods.

Christianhood wrote  Jul 14 at 5:08 PM  
Same question as wayne_p:
"Will these become a part of .NET Framework 4.0? If not, at what point will they be added?"

xyzzer wrote  Jul 15 at 4:48 PM  
I wouldn't say it could be included there - the Beta version does not include it, so why the released version would? Anyway - why would you like it included there? Isn't it better to just have the source code that you can bend to your needs easily?

MikeH wrote  Jul 25 at 8:03 AM  
@cjmarsh - There is already a whitepaper on using Mobile Broadband API with managed code at http://www.microsoft.com/whdc/connect/wireless/MB_ManagedCode.mspx

Shemmie wrote  Aug 9 at 5:40 PM  
May I just add - that this could be the greatest single thing Micrsoft could have done to drive Vista / Windows 7 adoption. Core API's moved to managed code - it's like my birthday come early. Thank you.

DimitarCC wrote  Aug 11 at 5:44 AM  
Thanks for that API! I will start using it right now to code applications compatible with Windows 7.

Timbot wrote  Aug 11 at 1:40 PM  
i'm just curious (and i've seen a few others) if there's something like this for windows xp that anyone knows about? we're kind of stuck on it here at work...

ThomasLebrun wrote  Aug 19 at 10:11 AM  
For those who want to use biometric features from Windows 7, you could take a look here: http://weblogs.asp.net/thomaslebrun/archive/2009/08/19/windows-seven-how-to-use-biometric-authentication-in-your-net-applications.aspx

REVAN wrote  Aug 19 at 3:15 PM  
Is there are any plans for Media Foundation wraper in next releases?

rctaubert wrote  Aug 25 at 11:33 PM  
I have taken the sample for the Shell PropertyEdit Sample, rewrote it for a form app and it works great on Vista. Is there a way to get it to work on an XP computer????

I have installed Framework 3.5 sp1 on the XP machine and the program will run without exceptions.

The program contains four function:
1. Get property value
2. Set property value
3. Enumerate properties and values.
4. Give information about a specific property name.

On the XP computer the program will run without errors but only function #4 will return a value.

I hope their is just something I am missing.

sevenalive wrote  Aug 26 at 7:57 AM  
Please drop the WinForms Dependencies. if you want everyone to use WPF then stop using WinForms. For the next release you should split more code into the "Core" library and then have WPF library and a WinForms library.

BillGatesII wrote  Aug 26 at 3:52 PM  
THANK YOU! this is so much easier then having to look around the web for something.
I'm just woundering, is there any thing for the new VHD API in this?

CElliott wrote  Aug 29 at 11:56 PM  
The newer Intel CPUs have a built-in floating point operations counter. Will Windows 7 provide an interface to this counter? In other words, will it be possible to call something like QueryPerformanceCounter() to access the FLOPs that a program has executed?

Keeron wrote  Aug 30 at 1:06 AM  
@CElliott: Looks like the APIs are already there and easily callable from .NET (using pinvoke):

MSDN: http://msdn.microsoft.com/en-us/library/dd458671(VS.85).aspx
PInvoke: (only couple; I am sure you'll find others on pinvoke.net)
http://www.pinvoke.net/default.aspx/kernel32/QueryPerformanceCounter.html

and

http://www.pinvoke.net/default.aspx/kernel32/QueryPerformanceFrequency.html

DeniseMToronto wrote  Oct 5 at 12:48 AM  
I can only assume most of the installation instructions have been left out. They didn't even say to use C#. C# couldn't find the files in the locations the ZIP folder put them. The supposedly VB samples are looking for C files! Microsoft, how about some instructions on how to actually install and use these!

Keeron wrote  Oct 9 at 2:20 AM  
There is nothing to "install" ... It's a zip file with sources and samples. Download the file, unzip, run the samples SLN files.

xyzzer wrote  Oct 9 at 5:42 AM  
Well, of course you need a few things, like .NET 3.5, Visual Studio seems pretty useful, so is a C# or VB compiler and C++ for DirectX, Windows SDK and DirectX SDK. I suppose C++ was missed from the list, but really everything else is mentioned above.

arikp wrote  Oct 12 at 8:09 AM  
Check Windows Ribbon for WinForms at [url: http://windowsribbon.codeplex.com/]
This is my work for provding .NET WinForms users access to the ribbon feature.
It is build on top of Windows API Code Pack and tries to follow the same convensions.
Sample projects included.

HappyBunny wrote  Oct 15 at 8:17 AM  
Is there any plan to include the WINSCARD functions in a later release?

jcdickinson wrote  Wed at 8:56 AM  
DirectCompute would be a nifty one. It would be great to be able to speed up math-heavy .Net apps without having to resort to unmanaged code.

robertgraziano wrote  Thu at 3:08 PM  
Shouldn't this be rolled into a .NET Framework release/update? It'll make it easier to roll out the runtimes to servers/workstations. Nice features, by the way. As someone else pointed out, DirectCompute would be nice...

Updating...
Page view tracker