Home   .......

Using Windows API in VB Tutorial

What's API

Products  
eXamples  
Files  
e-Mail Us  
 

 

API (Advanced Programers Interface) is a set of predefined Windows functions used to control the appearance and behavior of every Windows element (from the outlook of the desktop window to the allocation of memory for a new process). Every user action causes the execution of several or more API function telling Windows what's happened.

It is something like the native code of Windows. Other languages just act as a shell to provide an automated and easier way to access APIs. VB has done a lot in this direction. It has completely hidden the APIs and provided a quite different approach for programming under Windows.
Here is the place to say that, every line of code you write in VB is being translated by VB into API function and sent to Windows. Thus calling something like Form1.Print ... causes VB to call TextOut API function with the needed parameters (either given by you in the code, or taken by some defaults).

Also, when the user click a button on your form, Windows sends a message to your windows procedure (that is eventually hidden for you), VB gets the call, analyses it and raises a given event (Button_Click) for you.

The API functions reside in DLLs (like User32.dll, GDI32.dll, Shell32.dll, ...) in the Windows system directory.

 
Copyright (c) 1998, Billy&George Software and Peter Dimitrov
Revised March 2000