A collection of .NET components that wrap PInvoke calls to access native API by managed code.
What is "Managed Windows API" good for?
The Problem
If you want use Windows functionality in a .NET application which is not covered by the .NET framework (there is no "managed API" available for it), you usually have to use PInvoke, an interface that allows to invoke raw API functions from C# and VB.NET.
However, this is quite cumbersome. pinvoke.net does a great job in helping you to get the correct PInvoke declaration, but still you have to do lots of error-checking and ensure that you did not forget to handle all the corner cases. When accessing PInvoke declarations directly, this may lead to low-level code spread all over your apllication.
To avoid that, you usually write your own C# classes or .NET components to wrap all PInvoke stuff and provide the caller with a nice, high-level interface for the low-level API (that uses enums for enumerated values, reports errors by throwing exceptions, etc.)
However, if every developer does this for every API he uses, lots of time and energy is wasted for reinventing the wheel.
The solution
"Managed Windows API" is a collection of C# components that wrap Windows API functionality. It contains those features the author needed for his C# development, but if you have components yourself you want to share, please submit them so that this project can grow.
Are there example programs available?
Yes and no. You might have a look at the Managed Windows API Tools. Started as a collection of ManagedWinapi samples, the Managed Winapi tools evolved into a toolbox of lots of small but useful tools that solve their specific task well. They can still be used as reference for how to use ManagedWinapi, but their functionality may make it hard to find the relevant code parts quickly.
Read more: Managed Windows API
What is "Managed Windows API" good for?
The Problem
If you want use Windows functionality in a .NET application which is not covered by the .NET framework (there is no "managed API" available for it), you usually have to use PInvoke, an interface that allows to invoke raw API functions from C# and VB.NET.
However, this is quite cumbersome. pinvoke.net does a great job in helping you to get the correct PInvoke declaration, but still you have to do lots of error-checking and ensure that you did not forget to handle all the corner cases. When accessing PInvoke declarations directly, this may lead to low-level code spread all over your apllication.
To avoid that, you usually write your own C# classes or .NET components to wrap all PInvoke stuff and provide the caller with a nice, high-level interface for the low-level API (that uses enums for enumerated values, reports errors by throwing exceptions, etc.)
However, if every developer does this for every API he uses, lots of time and energy is wasted for reinventing the wheel.
The solution
"Managed Windows API" is a collection of C# components that wrap Windows API functionality. It contains those features the author needed for his C# development, but if you have components yourself you want to share, please submit them so that this project can grow.
Are there example programs available?
Yes and no. You might have a look at the Managed Windows API Tools. Started as a collection of ManagedWinapi samples, the Managed Winapi tools evolved into a toolbox of lots of small but useful tools that solve their specific task well. They can still be used as reference for how to use ManagedWinapi, but their functionality may make it hard to find the relevant code parts quickly.
Read more: Managed Windows API