What exactly is the Windows API, and how does it work?

An application programming interface enables interactions between multiple software intermediaries. It defines the types of requests that can be made, how they are made, the data formats that are used, and the conventions to follow. Developers widely use APIs, and without them, Windows operating systems would not be able to function as they do.

An Overview of the Windows API

Without APIs, your applications’ functionality would be limited, and your development time would significantly increase. If you are new to developing APIs, check out this API guide which includes a detailed example. In the meantime, let’s look at one of the most crucial application programming interfaces: the Windows API.

Informally known as WinAPI, the Windows API is the core set of application programming interfaces that Microsoft uses in its Windows operating systems. Virtually every Windows program interacts with the Windows API. The term Windows API is a little misleading, though, as it collectively refers to several platform implementations that are frequently referred to by their distinct version names.

How APIs Work
Image source: https://pixabay.com/photos/work-typing-computer-notebook-731198/

How does the Windows API work?

The Windows API focuses mainly in the general-purpose programming language known as C. The APIs’ data structures and exposed functions are described in that programming language in recent versions of its documentation. But the API can be used by any programming language assembler to handle low-level data structures, along with things like calling conventions for calls and call-backs.

Versions of the Windows API

Virtually every time Microsoft launches a new version of Windows, it includes changes and additions to the Windows API. However, the name of the API stayed mostly consistent between different Windows versions, although there were name changes along the way. Most notably, the current Win32 API family was altered to become simply “the Windows API,” making it a catch-all term for both the past and future versions of the API. Over the years, we have seen the following Windows API versions.

Win 16

The Win 16 API was used for the first 16-bit versions of Windows. The functions of the Win16 API reside mainly in the core files of the OS: kernel.exe, gdi.exe, and user.exe.

Win 32

This is the 32-bit API for versions of Microsoft Windows from 95 onwards. It consists of functions implemented in system DLLs. The core DLLs are kernel32.dll, user32.dll, and gdi32.dll. The Win32 API was first introduced with Windows NT.

Win32s

Win32s is an extension for the Windows 3.1x family of Microsoft Windows that used a subset of the Win32 API for those systems. The “s” in Win32s stands for “subset.”

Win64

This is a variant of the API implemented on Windows 64-bit platforms. Both 32-bit and 64-bit versions of an application can be compiled from one codebase. However, some older APIs have been deprecated. And some of the APIs that were previously deprecated in the Win32 API has been removed. Because the memory pointers are all 64-bit, by default, the source code must be checked to ensure it is compatible with 64-bit pointer arithmetic, and be rewritten as required.

WinCE

WinCE is the implementation of the Windows API for the Microsoft Windows CE operating system.

A die-hard fan of Windows, Windows 10 Mobile, Windows Phone and Xbox, Loves to Do Video reviews on Windows Phone Apps, Games, Xbox Games, Xbox Tutorials.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.