Visual Basic
  Home arrow Visual Basic arrow Page 2 - Accessing the Windows API in Visual Basic
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC

Accessing the Windows API in Visual Basic
By: Jason Brimblecombe
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 101
    2001-12-12

    Table of Contents:
  • Accessing the Windows API in Visual Basic
  • What is the Windows API?
  • Exploring the API function list
  • Your first API call
  • Calling the API
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Accessing the Windows API in Visual Basic - What is the Windows API?


    (Page 2 of 6 )

    You have probably heard of the Windows API numerous times, but you may not know exactly what it is. Basically, it is a whole set of implementation specific DLL hosted functions, which are accessible through Visual Basic, C++, Java and Delphi. The main API functions reside in three system DLL files, which are located on every computer that is using the Windows operating system.
    1. User32.dll - Handles the user interface
    2. Kernel32.dll - Working with files and your computers memory
    3. Gdi32.dll - Graphical commands
    There are many more DLLs which are accessible through the Windows Operating System, however, they are seperated into numerous other system DLL files, which we will not discuss here.

    Microsoft bundled all of the API functions into system DLL's so that they were easily accessible for developers from a number of programming languages. One advantage of using the Windows API is that each function is highly optimised, and usually written in C/C++, meaning that they are a lot faster than using the standard set of functions available in Visual Basic.

    It is possible to use functions from other DLL files, as long as you know the declarations to access the functions. The developer of the DLL must provide a detailed set of documentation, telling other developers how to create an API decleration for the functions contained within that DLL.

    API calls can be used to perform almost any Windows task, from shutting down a computer to installing a printer. Because of the multi-threaded mature of the Windows operating system, several programs can access the Windows API simultaneously.

    Later in this tutorial, I will describe how to use one of the most common Windows API calls in Visual Basic.

    Windows API functions are very fast and powerful, but actually calling them up and executing them can be time consuming. I would recommend that you only use Windows API functions if the task you are trying to implement is not available as a regular Visual Basic function or statement. Of course, the task that you want to implement may not be available as a Windows API function.

    More Visual Basic Articles
    More By Jason Brimblecombe


       · Excellent, very helpful content - it is a pity it has such a cluttered display.
       · It is very helpful....It would be great if you can provide us the more examples on...
       · Excellent helps me a lot thank you very much and more power.
       · It is excellent the best that I have seen and that's it, I don't see the...
     

    VISUAL BASIC ARTICLES

    - 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







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek