Getting to know Windows
Getting to know Windows – Part 1
Volume - Windows User Interface
Forward: This is the first part of the series where we get to know windows from a technical point of view.
By: Chrysanthus Date Published: 28 Aug 2012
Introduction
Note: If you cannot see the code or if you think anything is missing (broken link, image absent), just contact me at forchatrans@yahoo.com. That is, contact me for the slightest problem you have about what you are reading.
Prerequisite
You need to have knowledge in a C++ professional course before beginning this tutorial. If you do not have C++ professional knowledge, then first visit the pages for the professional course of the link below.
Computer programming builds up. There are certain things you have to learn first and then use them to learn other (higher) things.
API stands for Application Programming Interface. An API is software through which one program communicates with another, or software through which one program communicates with the computer hardware. In simple terms, Windows API stands between the program you have written in C++ (or any other high level language) and the computer hardware. Windows API is of the Microsoft Company.
win16 was first developed as windows API. win16 is now obsolete. Then you had win32 and now win64. win64 is more than 4 years old today, but it is not as popular as other new software versions. From the programmer’s (developer’s) point of view, win32 and win64 are almost the same. The difference is mainly in their internal coding and a programmer will hardly interfere with that. If you write an interface in win32 following the win64 changes, you will be able to compile it in a wind64 compiler. More than four years ago, you would hear of win16 API, win32 API, and win64 API. Today, win32 and win64 are together called Windows API.
In these volumes our focus will be on win32, respecting the changes that win64 has brought. In my opinion, Windows API is the next thing you should learn after learning C++. Windows API is for the Windows Operating System. What I give you in these volumes is applicable to Windows XP and higher version of windows.
Requirements
Here I give you the requirements for my computer in order to study Windows API. Nothing stops you from using some other requirements if you know what you are doing.
- MinGW Compiler Suite
- gcc-g++ (bin, dll) for C++
- Text Editor
- Your Personal Computer and a Windows Operating System.
The MinGW Compiler Suite is free to download. There is the downloading for automatic installation and the downloading for manual installation. I will talk only about the downloading for manual installation.
Go to the page, www.mingw.org on the web. Look for the link, Getting Started, and click it. The Getting Started page opens. Under the heading, Manual Installation on the page, you should see some lines like:
binutils
mingw-runtime (dev, dll)
w32api
Required runtime libraries for GCC (gmp, libiconv, MPFR, pthreads)
gcc-core (bin, dll)
Below these lines, you should see another line like,
gcc-g++ (bin, dll) for C++
In these lines, the following words are links: binutils; dev and dll from the mingw-runtime phrase; w32api; gmp and libiconv and MPFR and pthreads from the Required runtime libraries for GCC phrase; bin and dll from the gcc-core phrase. All that will compile a C program very well. In addition to that you have the links, bin and dll for compiling C++ (gcc-g++) programs. You must install all the software to compile C and the one to compile C++, before your C++ code can be compiled.
Click all the above links including the two links for C++ to download the following files:
binutils-2.19.1-mingw32-bin.tar.gz | tar x
mingwrt-3.16-mingw32-dev.tar.gz | tar x
mingwrt-3.16-mingw32-dll.tar.gz | tar x
w32api-3.13-mingw32-dev.tar.gz | tar x
gmp-4.2.4-mingw32-dll.tar.gz | tar x
libiconv-1.13.1-1-mingw32-dll-2.tar.lzma | tar x
mpfr-2.4.1-mingw32-dll.tar.gz | tar x
pthreads-w32-2.8.0-mingw32-dll.tar.gz | tar x
gcc-core-4.4.0-mingw32-bin.tar.gz | tar x
gcc-core-4.4.0-mingw32-dll.tar.gz | tar x
gcc-c++-4.4.0-mingw32-bin.tar.gz
gcc-c++-4.4.0-mingw32-dll.tar.gz
The last two files are specifically for C++. Create a directory called, MinGW in the root directory, (C:) of the hard disk. Copy these 12 downloaded files into the created directory, MinGW.
Search the web for the zip software called 7-zip. Download it; it is free. Use the 7-zip File Manager to unzip these 12 files into the same MinGW directory. During the unzip process if the zip software ask you to overwrite any file, choose the bigger file.
You will have to do something to the path environment variable. You will do something similar to the following: Go to the Control Panel of your windows operating system; click the System icon. The System Properties window opens; Click the Advanced tab. Click the Environment Variables button, in the Advanced tab pane. Add the following without the quotes to the path variable (under System variables): “C:\MinGW\bin;%path%”. If you already have other values in the path variable, then precede this value with a semicolon.
You are now ready to write source code, to compile it and run (execute) it.
Your working directory is the MinGW you created above.
User Interface
Production of windows (on screen) through which the user accesses an application is under the course, User Interface, of the Windows API. In this writing project, User Interface comprises a volume. This series of which, this article is part 1, is a division in the User Interface Volume. This series is titled, Getting to know Windows.
The Library
The library for the User Interface is, comctl32.dll, for windows XP and higher. You normally will not need to know the directory in which libraries in these volumes are kept. You just need to know what header files are to be used. We shall see examples as we go along.
You have to read the tutorials, divisions and volumes in the order that I give you. One series forms a division. Before starting each series (volume), I tell you what you should have read.
Do you want to learn how to produce windows (ob screen) for your applications? Do you want to know about the file system, device drivers, threads and processes of personal computers? Do you want to know how to provide graphical content to the monitor, printers and other output devices? After knowing how to write an application in a high level language, like C++, or Visual Basic dot Net, Borland Delphi or Java, do you want to know how to produce your own installation program so that you can sell the application to users who will install the program independently of you? Do you want to know how to produce standard dialog boxes (small windows) for your applications? Do you want to produce state of the art windows for your applications? Do you want to know what is called the Windows Shell? Have you ever heard about sockets and do you want to know how to use windows API to write code for a computer network? Do you want to know what is happening behind the browser as the browser is operating? Do you want to take up the modern challenge and produce multimedia application for your users? Answering each of these questions is dealing with Windows API and each involves one volume.
The Windows API Volumes
These volumes I am producing are the first of their kind. You will find the same information (and even more) in the Microsoft web site. However, the information there has been written for experienced programmers like me; not for people who are learning programming. What you will see in that web site are not tutorials. What you have in these volumes, are tutorials, which you have free.
I find the writing of these volumes exciting; I hope you will find them interesting. Since you have heard a lot in this part of the series, while not take a break now and continue in the next part.
Chrys
Related Courses
C++ CourseRelational Database and Sybase
Windows User Interface
Computer Programmer – A Jack of all Trade – Poem
NEXT