Where i can get complete api(s) of windows for c#, vb.net, with samples, or tutorials ?
3 Answers
Assuming by "APIs" you mean the declarations of the functions and data structures, I'd say it's very hard to do that, if not impossible; many APIs aren't even available in a single place for C/C++ (e.g. the Windows DDK headers and Windows SDK headers have some overlap, but they document different functions), let alone for other languages. You might want to learn C and convert the functions you need by hand instead.
(Sorry if this wasn't the answer you were looking for.)

- 205,094
- 128
- 528
- 886
You'll probably want to use a combination of two different resources:
The original documentation (Windows API Functions by Category) to understand what functions are exposed by the Windows API, what they are used for, and how they work.
The applicable P/Invoke declarations for C#/VB.NET from someplace like PInvoke.net.
(Strictly speaking, you can generate your own declarations using the only information available in the documentation, but it's probably easier—at least when you're first starting out—to use a site that has done most of the work for you already. You won't find every function out there on PInvoke.net, but most of the common ones are there.)
If you're just looking for an example of P/Invoke at use in .NET code, you can take a look at the many sample projects available on a website like Code Project. I just answered a question yesterday where the solution involves calling functions exposed only by the Windows API; you can see that here.
Remember that it should be relatively rare that you need to P/Invoke anything from the Windows API at all when targeting the .NET Framework. Probably 90% of what you need is already implemented for you in managed code. That's one of the joys of writing code in .NET. The idea of a "complete" API is both misguided and useless.

- 1
- 1

- 239,200
- 50
- 490
- 574
-
Huh... I disagree about "Probably 90% of what you need is already implemented for you in managed code." *Lots* of useful OS features are simply not possible in managed code -- whether you're trying to flash your window in the taskbar, write a new control (or to wrap an existing Win32 control), open files with UNC paths, etc. it's simply not possible in .NET, and frequently, when the codes *does* exist, it's private inside Microsoft assemblies, so it doesn't help. – user541686 Jan 07 '11 at 09:08
-
@Lambert: I didn't say *everything possible* is already implemented in managed code; I said "90% of what you need". It's possible to write a fully functional application using only the functionality exposed by the .NET Framework. It may not have Aero Glass support, but that hardly keeps it from doing its job. That being said, I use P/Invoke all the time, and my answer didn't mean to discourage it in any way. Simply to point out that there's tons of *mundane* functionality exposed by the WinAPI you don't need to bother P/Invoking yourself. The idea is a *complete* wrapper is unnecessary. – Cody Gray - on strike Jan 07 '11 at 09:12
-
Haha all right, I disagree with the 90% estimate (I'd say more like 30%) but whatever, +1 for a good answer. :) – user541686 Jan 07 '11 at 09:13
Believe this is all you need:
http://www.microsoft.com/express/Windows/
http://msdn.microsoft.com/en-us/
let me know if it's not what your looking for.
The Visual Studio 2010 Resource Kit provides a deep offering of online and offline content. You have direct access to the most up-to-date training kits for Visual Studio 2010 and the .NET Framework 4, SharePoint 2010, Microsoft Office 2010 and many more. Inside you’ll also find resources including the Visual Studio 2010 Reviewer’s Guide and other valuable content. Explore the Visual Studio 2010 environment through the Hands on Labs and get started to unleash your creativity. http://go.microsoft.com/?LinkID=9725928
if you need 3rd party APIs what do you want them to do as another poster mentioned there's lots of libraries with lots of APIs for lots of things that work for CLR languages.
Shaun

- 19,630
- 4
- 38
- 51
-
you provided the links to VS and MSDN but i want API Samples or of tutorials – Code0987 Jan 07 '11 at 06:28