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 369 times
1
Jader Dias
- 84,588
- 150
- 415
- 615
-
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
- 477,625
- 97
- 867
- 998
-
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
- 9,920
- 1
- 43
- 49
-
1+1 Although specifically that's many of the new Windows 7/Vista features. – BoltClock Feb 28 '11 at 19:36