CTEC1638 Windows Programming 2010W

Lab #2 - A Win32 Application (Tic-Tac-Toe)

Purpose:

In this course of developing this lab, Win32 API Functions used include: LoadIcon, LoadCursor, LoadAccelerators, TranslateAccelerator, LoadBitmap, BeginPaint, EndPaint, SelectObject, CreateCompatibleDC, DeleteDC, BitBlt, MessageBox, SendMessage, LoadIcon, LoadCursor. Win32 Data Types and Structures used include: HDC, HBITMAP, RECT, HACCEL, PAINTSTRUCT, HGDIOBJ. Win32 Messages which are handled include: WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_COMMAND, WM_PAINT, WM_CLOSE, WM_CREATE, WM_DESTROY.

Lab:

Students will write a simple Tic Tac Toe game as a Windows application, using bitmaps, a menu with accelerators, custom mouse cursor and icons.

Tic Tac Toe Screen Shot

Download the SOLUTION written by Mike Boldin detailing use of Windows controls

Download the LAB OUTLINE from 2007W. This document outlines a step-by-step process to complete this lab however it does not assume the use of a "Hello World" application as a starting point (resources, for example, are edited manually). It does, however, describe the required outcome of the lab. Ignore the due date and submission policy in hat document.

The basic steps to complete the project are as follows:

  1. Change the application title and name.
  2. Add exit confirmation in the form of a message box - when the WM_CLOSE message is received, ask "Are You Sure ..."
  3. Detect mouse clicks (which will determine where to place a user "X" on the grid
  4. Add resources including icons, bitmaps, a cursor, a menu, and accelerators
  5. Add code to handle the resources - respond to menu selections and mouse clicks (by placing icons)
  6. Add computer-play code from lab #1

Start with a "Hello World" application and modify it as we did in class.

Submission:

On a R/W memory device (USB key or flash card), submit files for the ENTIRE PROJECT in a directory named '\LAB2'. This directory will contain, among other files, the .CPP file, as well as the project .DSP and workspace .DSP files. A subdirectory '\LAB2\DEBUG' will contain object files in addition to the working executable.

Files in the DEBUG directory may be rebuilt during the marking process, files in the \LAB2 directory will be left intact.

Non-working (crashing) or nonexistent .EXE files (in the DEBUG directory) will be penalized at 50% so that the maximum mark on the lab is 50%! Ditto for submissions in which required files are missing prohibiting the immediate rebuilding of the project.

Remember, this term submissions are NOT accepted via e-mail and late submissions are penalized at the rate of 10% per day and receive a ZERO after five days late.


Copyright (C) Niagara College, Canada, 2008-2010