Search This Blog

Monday, 16 April 2012

A dialog based Win32 C++ Application

1. Introduction

In this article, I’ll guide you how to write C++ (pure, means no MFC, no ATL, no WTL, no CLR and no .Net) Win32 application (with the help of images). When writing pure Win32 programs, usually you see tutorials on internet or in help files shows how to use “RAW” windows, by filling a WNDCLASSEX structure, calling RegisterClassEx and then CreateWindowEx. This is explained in detail in Charles Petzold's classic Programming Windows book – a must-have for any Win32 programmer.
But sometimes you don’t need to create a new window entirely from scratch, a simple dialog box would fill your needs.

In this article, I’ll discuss how to use a Dialog Box as the main window for your program or application, from scratch. A dialog box resource can be quickly created – with labels, editboxes, and buttons with no controls adjusting (which take lots of work and time) – using any resource editor. Here I’ll use Visual Studio 2010, but the steps should be similar for other Visual Studio versions, or even other IDEs, just learn basic concept.

I’ll use pure Win32 C++ code to keep things as simple as possible: no MFC, no ATL, no WTL, or whatever. There is also the use of TCHAR functions (declared in tchar.h, more information click here) to make the code portable with ANSI and Unicode, and only functions that are both x86 and x64 compatible.

Tuesday, 10 April 2012

Programming language - C++

Programming language

A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely.

 The earliest programming languages predate the invention of the computer, and were used to direct the behavior of machines such as Jacquard looms and player pianos. Thousands of different programming languages have been created, mainly in the computer field, with many more being created every year. Most programming languages describe computation in an imperative style, i.e., as a sequence of commands, although some languages, such as those that support functional programming or logic programming, use alternative forms of description.


A programming language is a notation for writing programs, which are specifications of a computation or algorithm. Some, but not all, authors restrict the term "programming language" to those languages that can express all possible algorithms. Traits often considered important for what constitutes a programming language include:

    Function and target: A computer programming language is a language used to write computer programs, which involve a computer performing some kind of computation or algorithm and possibly control external devices such as printers, disk drives, robots, and so on. For example PostScript programs are frequently created by another program to control a computer printer or display. More generally, a programming language may describe computation on some, possibly abstract, machine. It is generally accepted that a complete specification for a programming language includes a description, possibly idealized, of a machine or processor for that language. In most practical contexts, a programming language involves a computer; consequently programming languages are usually defined and studied this way. Programming languages differ from natural languages in that natural languages are only used for interaction between people, while programming languages also allow humans to communicate instructions to machines.

Popular Posts

Site Map