Windows API Guide: Introduction

Welcome to the Windows API Guide. This guide deals with the API for all 32-bit versions of Windows: Windows 95/98, Windows NT, and even the Windows 32s extensions. Depending on your previous knowledge of the API site, you may simply wish to skip down to the section of this document talking about the organization of this site. If you are clueless or simply curious, feel free to read the API introduction.


Introduction to the Windows API

What is an "API"?

API is an acronym for Application Programming Interface. Simply put, an API is the set of functions which an operation system or a hardware device provides to allow software to use it. Without it, the software would have to provide its own drivers for all possible hardware configurations (remember DOS?), which is extremely wasteful and annoying. An API provides a relatively easy way for programmers to use the full functionality of the hardware or the operating system without concerning themselves as much with the internal operations. You should note that the term API is often used colloquially to refer to API functions.

What is the Windows API?

The Windows API is the API provided by the Windows operating system. It is a collection of literally hundreds of functions that allow all Windows-based software to do the things we normally associate with Windows. For example, some of the API functions provided in Windows provide ways to use files, create and use windows, access the system registry, play sounds and videos, use printers and other output devices, etc. Programmers don't need to manually create their own windows from scratch; rather they use the Windows API to tell Windows to create a window for them.

32-bit versions of Windows, whether 95/98 or NT, fundamentally use the same set of API functions, although there is some notable variations between platforms. The 32-bit API contains numerous enhancements and suppliments to the outdated 16-bit API used in Windows 3.x. The older functions are maintained for compatibility reasons. However, 32-bit applications should (read: must) exclusively use 32-bit functions. This isn't a problem, since the 16-bit throwbacks have usually been replaced by similar functions which have greatly enhanced functionality.

How is the Windows API organized?

Almost all of the functions that make up the Windows API are inside of DLL (Dynamic Link Library) files. These DLLs are inside Windows's System directory. The functions are grouped together based on general function, but most functions are in the kernel32.dll, user32.dll, and gdi32.dll files.

How do I use API functions in my program?

That depends on the programming language you use. Some languages, such as Visual C++, automatically link your program to any API DLLs that you use, so all you have to do is use the functions in your code. Others, such as Visual Basic, require you to add a reference somewhere explicitly linking your program to an API function. In Visual Basic, which this guide follows, the Declare statement creates this link. Consult your language's documentation to find out how to implement the API in your code.

What are the main Windows platforms for the 32-bit API?

The three chief platforms for using the 32-bit Windows API are Windows 95/98, Windows NT, and Windows 32s extensions. Windows 95 is the common Windows platform run by most noncorporate users. Windows 98 is more like "Windows 95 2.0" than a separate platform. Since the differences between their two implementations are negligible, this guide refers to them collectively as Windows 95/98. Windows NT is a more powerful, fully 32-bit (Win 95/98 has 16-bit throwbacks) platform used by many corporations and businesses. Windows 32s is not an operating system but a set of pseudo-32-bit extensions for Windows 3.x. Win 32s emulates many, but by no means all, of the full 32-bit set of API functions.

What are the differences among the different Windows platforms?

As far as most of the API functions are concerned, the three main Windows platforms behave identically. Usually the differences appear in the more advanced or lower-level API functions that deal more fundamentally with the basics of the operating system itself. One common difference is the less frequent use of security information in Windows 95/98 as compared to Windows NT; security information settings will often be ignored in 95/98 whereas it is used in NT. In this guide, any notable differences in implementation will be stated. Windows 32s, when supported, is almost always implemented identically as Win 95/98.

Back to the top.
Back to the index.


Introduction to the Windows API Guide

What is the Windows API Guide?

The Windows API Guide, this site, is a collection of some of the functions that make up the 32-bit Windows API. This site doesn't pretend to explain all or even most of them, but new entries are added periodically. In other words, although this site will never be complete, it is always growing. The Guide deals with implementations on all three 32-bit Windows platforms: Windows 95/98, Windows NT, and Windows 32s.

What language is this site written in?

Since the API can be used by all Windows-based programs, users of any language can obtain useful information from this Guide. However, all of the code presented here is in Microsoft's Visual Basic 5.0. This language was chosen for a number of reasons. First, when this guide started, it was the only Windows-based language I knew. Second, unlike other languages such as C++, people unfamiliar with the Visual Basic language can usually get the idea of the code; Visual Basic is one of the least cryptic languages commonly used. Third, almost all sites and guides that deal with the API are geared towards C++ programmers.

How is this site organized?

The main index page is the main menu for the site, listing all functions explained here alphabetically. Each function is given its own page, which presents the Declare needed for Visual Basic users, an explanation of what the function does, an annotated list of the parameters, and an example of its usage. Many functions use special user-defined data structures as parameters. These structures, linked to every function-page that uses them, also have their own page. Similarly, many functions make use of numerical flags to pass information. The flags are explained on each page where they are used, with both the mnemonic name and actual value. All pages have links to any other API functions referenced in the examples and to API functions that have similar or related uses. The main index in addition groups the functions according to categories based on their usages.

Why don't I see any formatting on these pages?

This guide makes use of cascading style sheets, a relatively new method of formatting on the Internet. Instead of containing formatting data (such as text colors, margins, etc.) in the HTML code, the formatting parameters are stored in a single CSS file referenced by all other pages. If your browser supports style sheets, these pages should appear in white text on a dark green background, flag values will be shaded gray, links will become colored when the mouse passes over, and other things. Both Netscape and Microsoft Internet Explorer version 4.x or later support style sheets, although Internet Explorer appears to implement them better. You can read this site just fine without the formatting, but using the later browsers increases the readability and enhances the look.

How often is this site updated?

I don't update this site on an especially regular basis, although I do try to put up a few new functions every two weeks. However, it depends on how much free time I can devote to the site, how difficult to figure out the functions are, and other factors. The date of the last update is at the top of the main index page. All of the function and data structure entries which have been added since the last update will be marked with NEW next to their listing on the main index page.

Back to the top.
Back to the index.


Go to Paul Kuliniewicz's Home Page.
E-mail: rogue953@hotmail.com
This page is at http://skyscraper.fortunecity.com/transmission/45/intro.html