Learn to program Tic Tac Toe Game in Visual C++ on Windows | Mohammad El-Haj | Skillshare

Learn to program Tic Tac Toe Game in Visual C++ on Windows

Mohammad El-Haj, Passionate Developer / Trainer / Constant Learner

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
16 Videos (3h)
    • Quick Overview

    • Course & Instructor Intro

    • Creating a Generic Windows Application using Visual Studio

    • How to draw the game board centered inside our Window

    • Slicing the game board into 3x3 individual cells

    • How to handle mouse clicks and determine a cell number from 0 to 8

    • How to get the dimensions of a cell as a rectangle given its index

    • How to work with BRUSH objects in Windows and how to use 2 brushes for 2 players

    • How to store player moves inside an array and repaint them during WM_PAINT

    • How to determine and show if we have a winner

    • Working with Menus and adding New Game functionality

    • Drawing text inside our window for Player 1 and Player 2 using different colors

    • Showing and displaying player turns

    • How to draw images instead of colors

    • How to highlight the winning move using color

    • Some Ideas for further improvements and next steps


About This Class


Do you want to learn how to build Windows applications using C++ and Windows API? Do you want to build a native Windows application in C++ and have it run on any version of Windows including Windows 7, Windows 8, Windows 8.1 and Windows 10?

Do you want to learn some cool techniques for handling arrays in C/C++? Are you curious to learn what it takes to build a game with Visual C++ on Windows?

If you say yes to any of these questions, then you should consider taking this course today!


  • The basic concepts, tools and functions you need to build a complete Tic Tac Toe game with Visual C++ on Windows
  • The building blocks of a Windows GUI application including Windows, Menus, Texts, Shapes and Icons
  • How to prompt the user for messages and how to use MessageBox API
  • What is GDI and how to use it to draw texts, shapes and icons
  • How to handle Windows messages and how to center elements inside your window
  • And more tips and tricks of the trade!

This course is 100% free, so there is nothing to lose! I made my best efforts to provide high quality content and to make this both useful and fun to watch.

Let’s get started today! Enroll now!


  • Over 15 lectures and 3 hours of video content
  • Code Tic-Tac-Toe in C/C++ on Windows
  • Understand how to write efficient C++ for Windows
  • Learn how Windows applications work
  • Understand how painting works on Windows and how to utilize it for your apps
  • Build a complete tic-tac-toe game by following this course
  • Learn how to add menus, messages and how to draw inside your application with GDI



  • This course is a quick overview and an introduction to anyone interested in learning building Windows Applications and Programming Windows API using C/C++
  • You must have some basic knowledge of Programming in C/C++ to be able to understand the concepts mentioned here



  • Installation of Visual Studio 2015 Community Edition (Free)
  • Understanding of Windows environment and applications
  • Basic knowledge of C/C++ like loops, functions, variables and if conditions
  • Basic understanding of pointers and structs in C/C++
  • Windows 7 or newer
  • Developers who want to learn how to program on Windows with C++
  • Anyone who wants to learn how to use Visual C++ and Windows API



In this course I try to cover basic understanding of Windows programming as well as the functions we use. However, it requires a lot of time and effort to cover Windows programming and Windows APIs from scratch, which is outside the scope of this course.





  • --
  • Beginner
  • Intermediate
  • Advanced
  • All Levels
  • Beg/Int
  • Int/Adv


Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

Mohammad El-Haj

Passionate Developer / Trainer / Constant Learner

Hi there!

My name is Mohammad and I have a degree in computer sciences and have been working as a professional software engineer since 1995. I wrote my first program in GW-BASIC when I was 14 years old and since then I knew that I wanna grow up to become a programmer as it is the love and passion of my life!

I also started teaching Visual C/C++ and Visual Basic back in 1997 and that is when I learned how much I enjoy teaching and helping others!

I lived in Seattle for 17 ...

See full profile

Report class