Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Call Windows API [duplicate]

Possible Duplicate:
Windows API and .net languages

I want to call native Windows API from .NET Framework. I want to have an easy way where I can call native API from high-level layer like other .NET APIs. Please refer to any resource which you know. Any help will be appreciated.

like image 966
Uzair Anwaar Avatar asked Jan 27 '12 11:01

Uzair Anwaar


2 Answers

You can call unmanaged DLL's and other functions from the WinAPI using P/Invoke in C#. This link documents how to use a lot of these functions.

http://pinvoke.net/

like image 177
Bali C Avatar answered Oct 23 '22 15:10

Bali C


You can use PInvoke in order to call Windows API functions.

There is also PInvoke Interop Assistant which generates a PInvoke signature of a function if you provide its Win32 signature.

like image 30
Norbert Willhelm Avatar answered Oct 23 '22 16:10

Norbert Willhelm