Overview

There are type of applications: Console and Windows.

A console application is an application that runs in the command prompt (cmd.exe).

A Windows applications is a desktop application with a user interface.

Windows API

Overview

Applications are developed using the Windows API, which is mostly a C API composed of functions and structures.

<aside> 💡 The Windows API is also known as the Win32 API.

</aside>

Windows applications need to at least include the windows.h header file.

Syntax

The Windows API follows the Hungarian Notation.

The Hungarian notation is the practice of adding prefixes to the names of variables, to provide additional information about the variable (mostly the type, and occasionally the usage).

For example, i stands for integer, b stands for boolean, p stands for pointer, and so on.

Types

The windows API contains many typedefs for the standard C types.

Untitled Database

Windows also contains the BOOL type as a typedef for an integer value instead of the standard bool C++ type.

Most data structures are defined with typedefs to their pointer representation. For example RECT is defined with LPRECT which is a typedef to RECT*. LP stands for long pointer which exists for historical reasons as Windows 16-bit needed to address different memory ranges.

Strings

Windows supports ANSI strings and Unicode strings.