Microsoft Access 2010 Bible

(Rick Simeone) #1

939


CHAPTER


Using the Windows


Application


Programming


Interface


IN THIS CHAPTER


Introducing the Windows
application programming
interface (API)

Learning when you’ll use the
Windows API

Looking at documentation
sources for dynamic link
libraries (DLLs)

Writing VBA code for the
Windows API

Practicing API programming
with examples

A


ccess and Visual Basic for Applications (VBA) help you develop pow-
erful applications. Using the Windows application programming
interface (API), you can take full advantage of the Windows graphi-
cal user interface (GUI) to create your own windows (forms), dialog boxes
(message boxes), list boxes, combo boxes, command buttons, and so on.
These objects make your application a Windows application. And that’s what
this chapter is all about.


Although this chapter concentrates on the API included with Windows, the
concepts are applicable to other APIs as well, such as the Open Database
Connectivity (ODBC) API, the Messaging Application Programming Interface
(MAPI), and the Telephony Application Programming Interface (TAPI).


What the Windows API Is


The Windows API is a set of built-in code libraries extending the Windows
interface. Access makes these libraries available to you and simplifies their
use. The API libraries include functions that allow you to create windows,
check systems resources, work with communications ports, send messages to
applications, and access the Registry, among other things.


These functions hook directly into the internal workings of Windows.
Although Access and VBA let you reach a great many of these hooks trans-
parently, there are still some you can’t get to without writing your applica-
tion in the C programming language or referencing the Windows API
directly. Access and VBA give you everything you need to tap into this col-
lection of hundreds of functions. You only need to know how they work and
what to look for.

Free download pdf