Calling Win32 API functions using .NET 4.x
The Apicall.NET solution was developped using Visual Studio 2017. The purpose of this library is to allow any .NET developper to call any Win32 API without declaring any prototype function.
1 - ApicallNET.dll: this is the core proxy library written in C# using generics. This DLL has a dependency with Apicall.dll, see below (*)
2- Test: this is a test project given with some examples
Compatibility is set to .NET 4.0, but you can compile it for version 3.0 as well it should work
(*) Each projects folders contains a directory named DLL that holds a file named Apicall.dll
Apicall.dll is a low level generic interface that allows you to invoke C standard libraries (STDCALL as well as in CDECL)
Apicall.dll was developped in pure C with a pinch os ASM code, then compiled using GCC version 5.1.0 (tdm-1)
Give a try, compile the .NET solution, and see what you can do with Win32 API from within .NET!
The following C# code invokes 'MessageBoxW' unicode function from 'User32.dll'...
Here's the result!
Please have a look at the test source code here
- VS2017 - Build smarter apps, fast using Visual Studio 2017
- GCC51 - GCC, the GNU Compiler Collection version 5.1.0 (tdm-1)
- Gérôme GUILLEMIN
This project is licensed under the LGPL v3 License - see the LICENSE.md file for details
- Hat tip to anyone whose code was used
- Inspiration
- etc
HTH,
Gérôme GUILLEMIN