Lecture Notes for Fall 2004

The lectures are posted in HTML form. In many cases I have also posted a Word file.

If you find an error in the lecture notes, send me an email and I will correct it. If errors have been corrected, the files will be noted below as "updated". You can also send an email if you think the notes are confusing or just can be improved. Please be specific enough that I can figure out what needs fixing.

Lecture Zero:  Using C and C++ correctly.  This is information specific to the C and C++ programming languages.  While you do not need to be an expert C++ programmer to learn Windows programming,  if you are inexperienced in C++ and C there will be a few stumbling blocks.  The material in the lecture notes is supposed to be review,  but you are expected to review it independently. Please study this material carefully, as you will save yourself a lot of trouble by doing these things right.  The topics covered include:  #-defined constants; header files; prototypes and where to put them; static data area, stack, and heap; the keyword static as applied to local, global, and class member variables, as well as functions. Bitwise versus logical operations; flags and their use in Windows. Call by reference versus call by value; correct use of & and *. (Word file)

Monday, August 30 : How Windows Works Event-driven programming; applications, windows, and messages. What messages are and how they are created and "sent". The main message loop; the application message queue. Processing messages. WinMain.  The SDK (or the Win32 API) versus MFC.

Wednesday, September 1: Introduction to Visual C++.NET.   Your first Windows program. 

Monday, September 6: Labor Day Holiday, no school.

Wednesday, September 8: Menus and Toolbars. Creating a menu using the menu editor; the .rc file; the WM_COMMAND message; the message map and message handlers; creating handlers using Class Wizard; keeping the data in the document class and using accessor and mutator functions; drawing only in OnDraw and using Invalidate() elsewhere. Creating a toolbar using the toolbar editor.

Monday, September 13 : Introduction to Windows Graphics WM_PAINT, rectangles, device contexts, clipping, the invalid rectangle; RGB colors. (Word file)

Wednesday, Septermber 15 : Windows Graphics 2 Selecting pens and brushes; concept of GDIObject; creating and deleting GDI objects; stock objects; basic drawing functions, TextOut details. (Word file). [Last updated 2.28.04 to make sure the material on dragging is deleted--it's moved to another lecture.]

Monday, September 20: The Mouse Responding to mouse clicks; responding to double-clicks; hit-testing. (Word file).

Wednesday, September 22: Regions and Dragging. Regions: CRgn, PtInRegion, functions for creating regions. Dragging: Tracking whether the mouse is down for dragging something. SetCapture. Example: using the mouse to select a rectangle. (Word file).

More lecture notes will be posted by September 20.