Reader small image

You're reading from  C++ Windows Programming

Product typeBook
Published inSep 2016
Reading LevelIntermediate
PublisherPackt
ISBN-139781786464224
Edition1st Edition
Languages
Right arrow
Author (1)
Stefan Björnander
Stefan Björnander
author image
Stefan Björnander

Stefan Björnander is the author of the books Microsoft Windows C++ and C++ Windows Programming. He holds a Master of Engineering and a Licentiate in Computer Science. He has worked as a software developer and as a teacher in computer science and mathematics for many years.
Read more about Stefan Björnander

Right arrow

"Hello" window for the Win32 API


First of all, let's take a look at the Hello application from the first chapter of this book. The following code snippet is the same application written directly with the Win32 API, without Small Windows. Note that the code is written in C rather than C++ as the Win32 API is a C function library rather than a C++ class library. As you can see, the code is a lot more complicated compared to the application in the first chapter.

Do not worry if it looks complicated. Its purpose is actually to demonstrate the complexity of the Win32 API; we'll discuss the details in this and the following chapters.

MainWindow.c

#include <Windows.h> 
#include <Assert.h> 
#include <String.h> 
#include <TChar.h> 
 
LRESULT CALLBACK WindowProc(HWND windowHandle, UINT message, 
                            WPARAM wordParam, LPARAM longParam); 

The WinMain method is called when the application starts to execute. It corresponds...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
C++ Windows Programming
Published in: Sep 2016Publisher: PacktISBN-13: 9781786464224

Author (1)

author image
Stefan Björnander

Stefan Björnander is the author of the books Microsoft Windows C++ and C++ Windows Programming. He holds a Master of Engineering and a Licentiate in Computer Science. He has worked as a software developer and as a teacher in computer science and mathematics for many years.
Read more about Stefan Björnander