Home arrow Visual Basic arrow Page 3 - Accessing the Windows API in Visual Basic

Accessing the Windows API in Visual Basic

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.

Author Info:
By: Jason Brimblecombe
Rating: 4 stars4 stars4 stars4 stars4 stars / 127
December 12, 2001
  1. · Accessing the Windows API in Visual Basic
  2. · What is the Windows API?
  3. · Exploring the API function list
  4. · Your first API call
  5. · Calling the API
  6. · Conclusion

print this article

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:

The API Viewer

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.
blog comments powered by Disqus

- Developing an XML Web Service Using Visual S...
- Creating an HTML File List with VB
- Fun with Email: VB6, CDO, MAPI, and a Remote...
- Extranet/Intranet Dictionary Cracker in VB
- Finding Default App Icons With Visual Basic
- Registry Fever With Visual Basic
- Implementing An ADO Data Control With VB6
- Printing With Visual Basic
- MSMQ Part 1/2: Architecture and Simple Imple...
- Magnifying The Desktop With Visual Basic
- Sending Email With MAPI Components in Visual...
- Two Person Chat With The Winsock Control And...
- A Real-Time ActiveX News Control
- Accessing the Windows API in Visual Basic

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials