Dal's Programming Course - Lesson 01

Getting Started

To do anything fun in modern programming with a PC running Windows, you must become familiar with Windows, and a development environment that works with Windows. In this lesson, we explore both the development environment and a bare-bones windows program.

The development environment that you should be using for this course is Microsoft's Visual C++ .NET (2003) or later.

Windows programming is not complicated -- but it is very extensive, consisting of thousands of subroutines that you can call upon to have Windows do stuff for you. It is so vast that nobody can be expected to know it "all". Therefore, to do any serious work with Windows, you must get in the habit of using the online documentation, and searching for information to your particular task at hand. By "online", we mean the documentation that is primarily installed on your computer with Visual C++ .NET, but it could also be on the web.

Since Windows is so extensive, it is almost impossible for someone to start programming in windows without an example program. This lesson is designed to get you started quickly by providing a working Windows program and letting you modify it.

Materials for this Lesson: Download.
Homework

Item

Time

Description

1 15 Mins Get the above project up and running on your computer with Visual C++ .Net. Make sure you can build it from scratch.
2 1 Hour Work through all the source code. Make a list of all the Window functions used in the program, such as MessageBox(). Look up each Window function’s documentation and read about it.
3 When doing number 2, pay special attention to the following topics:
a. Window Messaging
b. Registering and Creating Windows
c. Window Painting
4 3 Mins Experiment with your window. Does it resize? Does it minimize? What happens when you drag it around, and drag it off the screen and back again. What happens when a another application is put on top of it?
5 10 Mins Modify mcBasicWindow::RegisterWindow() so that all windows created with the mcBasicWindow class automatically colors the background to white. Use a "stock object" to accomplish this.
6 10 Mins Modify the window so that it can resize. (Hint: read about window styles).
7 5 Mins Modify the program so that two windows of the same type are displayed, but at different places.