Introduction to Windows API programing e-book

The e-book has 244 pages. It has 114 code examples. The e-book is an introductory material on programming in Windows API with the C programming language. It is an ideal material for those who would like to start learning about programming with Windows API. We assume that the reader knows the basics of the C language. The e-book is the most recent book written about Windows API available.

Carefully chosen examples always focus on one important aspect. Buying this e-book you will save a lot of hours searching on the Internet, asking on forums and figuring things on your own. What took the author months and weeks to find out, you will get in days and hours. The e-book is written in plain English.

The code examples were tested with the Pelles C compiler. After purchasing the e-book, you will be redirected to a page where you can download a ZIP file. With the PDF file, you will also obtain all code examples.

If something goes wrong with the payment process, drop me an email at vronskij(at)gmail.com.


The e-book costs 19 €.

Other payment options

EU citizens can purchase the e-book via wire transfer without additional fees. If you would like to use this payment option, contact me at vronskij(at)gmail.com and I will send you the details.

About this E-book

This is Introduction to Windows API programing e-book. This e-book is an introductory material on programming in Windows API with the C programming language. It is based on ZetCode's Windows API tutorial with additional material.

The e-book has 14 chapters. The complete table of contents is listed at the end of the page.

The following is covered:

The Introduction chapter introduces Windows API and the Pelles C IDE. The Essentials chapter covers functions in a generic way, mentions windows data types, handles, and macros. The Main functions chapter talks about the available main functions. We mention both console and UI main functions. The System functions chapter describes several system-related functions. For instance, we show how to lock the workstation, get the computer name, or determine the CPU speed. The Strings chapter is dedicated to the all-important topic of strings in Windows API. We mention the classic ANSI C string functions, security enhanced string functions, and Windows API string functions.

In the Locale chapter we talk about functions related to the native-language environment. In this chapter, we show how to get locale information, format currency, numbers, or dates in the current locale, and compare strings. In the Date and time chapter we work with date and time. We determine the local and universal time, do arithmetic operations with dates, or format date and time. In the Files and directories chapter we work with files and directories. We create and remove directories, copy and delete files, or read and write to a file. In the Window chapter we describe how to create our first window in a detail.

In the First steps in UI chapter we create simple UI programs. For instance, we create a centered window, register a hot key, or flash a window. The Menus chapter is dedicated to menus. We create both classic menus and popup menus. In the Controls chapter we describe fourteen controls, including button, check box, trackbar, status bar, and combo box. The List box chapter describes the List box control; it has six examples describing it. In the Graphics chapter we perform drawing. We draw basic primitives, shapes, text or work with regions and clipping.


Here are some screenshots from the e-book.

Radio menu item
Figure: Radio menu item
Listbox, multiple selection example
Figure: Listbox, multiple selection example
Figure: Clipping example
Combining regions
Figure: Combining regions

Table of Contents

  1. Preface
  2. About the author
  3. Introduction
    1. Windows API
    2. Pelles C
    3. MSDN
  4. Essentials
    1. Functions
    2. Windows data types
    3. Handles
    4. Macros
  5. Main functions
    1. The main prototypes
    2. The wmain prototypes
    3. The _tmain prototypes
    4. The WinMain prototypes
  6. System functions
    1. Screen size
    2. Locking workstation
    3. Computer name
    4. User name
    5. Current directory
    6. Windows version
    7. Memory usage
    8. Known Folders
    9. Drive names
    10. Free disk space
    11. CPU speed
  7. Strings
    1. ANSI C string functions
    2. Security enhanced CRT functions
    3. Windows API kernel and user string functions
    4. Windows API Shell Lightweight Utility functions
    5. Windows API StrSafe functions
  8. Locale
    1. Default locale
    2. Getting locale information
    3. Currency format
    4. Number format
    5. Date format
    6. Comparing strings
  9. Date and time
    1. Local time
    2. UTC time
    3. Arithmetic
    4. Date
    5. Formatting date
    6. Determining a leap year
    7. Uptime
    8. Day of week
    9. Epoch
    10. Days until XMas
    11. Comparing times
    12. Time zones
  10. Files and directories
    1. Creating a directory
    2. Removing a directory
    3. Copying a file
    4. Deleting a file
    5. Moving a file
    6. File size
    7. Last write time
    8. File attributes
    9. Reading a file
    10. Writing to a file
  11. Window
    1. wWinMain() function
    2. Registering a window class
    3. Creating a window
    4. Messages
    5. Window procedure
    6. Simple window
  12. First steps in UI
    1. Message box
    2. Centering a window
    3. Hot key
    4. More windows
    5. Escape key
    6. Moving a window
    7. Flashing a window
  13. Menus
    1. Simple menu
    2. Popup menu
    3. Check menu item
    4. Radio menu item
    5. Submenu
  14. Controls
    1. Static control
    2. Button
    3. Check box
    4. Edit control
    5. Radio buttons and group box
    6. Combo box
    7. Status bar
    8. Progressbar
    9. Trackbar
    10. Updown control
    11. Month calendar control
    12. IP address control
    13. Hot key control
    14. Tab control
  15. List box
    1. Simple example
    2. Double click
    3. Adding and deleting items
    4. Selections
    5. Multiple selections
    6. Finding items
  16. Graphics
    1. Pixel
    2. Line
    3. Rectangle
    4. Bézier curve
    5. Pen
    6. Brush
    7. Star
    8. Shapes
    9. Text
    10. Drawig a bitmap
    11. Viewport origin
    12. Region
    13. Clipping
  17. Bibliography