Hi Guys,

I know I know, another newbie asking about APIs, sorry!

I've just been noticing that a lot of the things I want to do in my apps recently havent been possible through the .NET framework directly and needed me to use APIs... which im not quite sure how to do so I've usually just tried copying examples and screwing them up trying to change them to suit my needs

So basically I was just wondering - 1. what is the correct way in VB.NET to 'call' (or whatever the correct word is) an API? I've noticed examples use DLLImport or something but then there is usually a lot more 'strange' (to me) code required when actually trying to use the API functions.

2. Why do we use APIs? I mean if we can code something using an API why couldnt it just be a method in VB.NET or whatever language? Is it PURELY because it would take so long and make the framework so large if it included every possible function in Windows?

3. I know the APIs are stored in DLL files so are they just kinda like a definition of what arguements the API function accepts etc? and if so why do you have to type so much code to use them? If all the data is in these DLL files why is not just a case of importing the DLL and then using the function or method like any other in the framework?

4. How do you learn how to use an API or learn that it exists? is it purely just a case of searching the internet?

Sorry if these are daft questions and I did try to research this before posting but couldnt find precise answers to these questions (that made sense to me anyway)