Windows API Reference

Welcome to the comprehensive reference for the Windows Application Programming Interface (API). This section provides detailed information on the functions, structures, constants, and concepts you need to develop applications for the Windows operating system.

System Services

APIs related to operating system functionalities, process management, memory, threading, and system information.

Core Functions

VOID GetSystemInfo(LPSYSTEM_INFO lpSystemInfo);

Retrieves information about the current system. This includes data identifying the processor architecture, the system memory, and the number of processors on the current system. A pointer to a SYSTEM_INFO structure that receives the information.

BOOL CreateProcess(LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCTSTR lpCurrentDirectory, LPSTARTUPINFO lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);

Creates a new process and its primary thread. The new process is represented by a handle to the process and a handle to the main thread of the process. The function returns the handles and any associated information.

User Interface

APIs for creating windows, handling user input, drawing controls, and managing the graphical user interface.

Window Management

HWND CreateWindowEx(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);

Creates a top-level window. This function combines calls to CreateWindow and SetWindowLong to specify extended window styles.

Graphics

APIs for 2D and 3D graphics rendering, including GDI, Direct2D, and DirectX.

GDI Functions

HDC CreateDC(LPCTSTR lpszDriver, LPCTSTR lpszDevice, LPCTSTR lpszPort, const DEVMODE *lpInitData);

Creates a device context (DC) for a specified device. A device context is a data structure that contains information about the drawing attributes of a device, such as the:

  • lpszDriver: The name of the graphics driver.
  • lpszDevice: The name of the device.
  • lpszPort: The name of the device's output port.
  • lpInitData: A pointer to a DEVMODE structure that specifies system-independent properties of the desired device.

Networking

APIs for network communication, including Winsock, WinINet, and Remote Procedure Call (RPC).

Winsock Functions

Security

APIs for managing security descriptors, access tokens, and cryptographic operations.

Access Control

File System

APIs for file and directory operations, including creating, reading, writing, and manipulating files.

File Management

Interoperability

APIs for interacting with other systems or applications, such as COM, .NET interop, and DDE.

COM

Device Drivers

APIs for developing and interacting with device drivers.

Registry

APIs for accessing and manipulating the Windows Registry.

Process Management

APIs for creating, managing, and terminating processes and threads.

Common Data Types

Fundamental data types used across the Windows API.

Type Description Size
BOOL Boolean value. 1 byte
INT Signed integer. Platform-dependent (typically 4 bytes)
UINT Unsigned integer. Platform-dependent (typically 4 bytes)
LONG Signed 32-bit integer. 4 bytes
DWORD Unsigned 32-bit integer. 4 bytes
LPVOID Generic pointer. Platform-dependent (typically 4 or 8 bytes)
HWND Handle to a window. Platform-dependent (typically 4 or 8 bytes)