I see DllImport
everywhere. I see everybody declaring Win API methods in their projects. Why doesn't people put every Win API method declaration in a .NET library and use it instead?
Is there any such library? Is it open source?
Asked
Active
Viewed 374 times
1

Jader Dias
- 88,211
- 155
- 421
- 625
-
1Some of the Windows 7 APIs have made it into .NET 4, readily available to WPF developers. – BoltClock Feb 28 '11 at 19:35
-
I'm building a library like this as we speak...It's a long job! – Matthew Layton Oct 10 '12 at 10:59
2 Answers
5
Because this would be a huge library, and no one needs to call all of the Win API methods.
The closest thing that I know of is pinvoke.net.
Many specific APIs have .NET wrappers, if you look around (ESENT, IIS management, SQL management and more).

Oded
- 489,969
- 99
- 883
- 1,009
-
See also the PInvoke Signature Generator tool: http://stackoverflow.com/questions/5122410/accessing-windows-api-constants-and-structs-for-p-invoke/5122534#5122534 – Mark Sowul Feb 28 '11 at 19:39
-
NET is a huge library. I doubt it would increase much in size if it included those wrappers. – Jader Dias Feb 28 '11 at 20:58
4
The WindowsAPICodePack comes close for many things.

Mark Sowul
- 10,244
- 1
- 45
- 51
-
1+1 Although specifically that's many of the new Windows 7/Vista features. – BoltClock Feb 28 '11 at 19:36