The Windows Application Programming Interface, or API, is a complex set of functions for interacting with Windows. In this article, Jason attempts to shed some light on this topic by explaining what an API is, and providing an example of how to access one through Visual Basic.
Accessing the Windows API in Visual Basic - Exploring the API function list (Page 3 of 6 )
There are literally thousands of API functions available throughout the numerous Windows API DLL libraries. Almost everything that Windows can do is listed as an API function. To view the available list of Windows API's, we can use the API viewer, which is installed along with Visual Basic. To start the API viewer, click Start -> Programs -> Microsoft Visual Studio 6 -> Microsoft Visual Studio 6 Tools -> API Text Viewer. You should be presented with a screen like the one shown below:
To get started, you'll need to load up the file that contains the list of API's. Start by clicking File, then Load Text File. Find the file named Win32api.txt and load it up. If a box appears asking you if you want to change this file from text to database, accept it. This will make your viewing much faster.
Try not to be overwhelmed by the jumble of weird and seemingly never-ending functions that greet you when the file is loaded, because you will get used to them after a while. Now, letís make sure we're familiar with the new environment that we're working with. Starting from the top of the window and working down, you can see a drop-down menu. This is for changing the API type. Make sure that this is set to 'Declares', because we will need it for the next section.
Below the menu is a large list box. This lsit box displays all of the available items for the API Type that you have selected. When you have found the item that you want to learn more about, click on the 'Add' button and the command will appear in the box directly below the one I have just been explained.
When you have one or more items in this box, the two buttons labeled 'Remove' and 'Copy' will be enabled. The 'Remove' button deletes selected items that you do not require, and the 'Copy' button copies the whole lot onto the Windows clipboard. Make sure you keep the API viewer open now, because we will be using it in conjunction with the next section.