-
HI
i c lots of examples which r using API and my question is this:
how can i know when do i need to use API and what
API command i need?
a simple example is, i want to pause the program
so i look for the "sleep" API command
but what about the more complex commands ?
-
Sites such as www.allapi.net are useful for things like this, and the Platform SDK at http://msdn.microsoft.com is fantastic.
The SDK is good for finding what functions you need, then the VB-specific sites show you how to use them.
-
-
You also might be able to tell what an API does by looking at its name. But once you get to use API a lot, you will become familiar with it, and it will come to you naturally.
-
MSDN Works, too
If you aren't sure whether or not to use an API, try looking whatever it is your trying to do with the MSDN that comes with VB. It will usually tell you about API functions that can help you. Also, as was said earlier, the names tend to reflect their purpose, so simply looking in the API viewer can help you find an appropriate API. You can than look up that function in the MSDN and it will explain - sort of - how to use it.
-
The Platform SDK is documented in C++, so if you're not good at translating code, you can take a look some VB sites. (www.vbapi.com and www.allapi.net as well as this site).
-
Or come here and yell for help :D
-
Translation
Yeah, the translation can be a real pain. Fortunately, I'm taking C++ in school, although we're mostly teaching ourselves. I also learned about translation in this API book I've got called The Visual Basic 6.0 Developers Guide to the Win32 API, or some such thing. All the API declarations are given in C++ and VB code, plus he explains a little about translation at the beginning of the book.