Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
C++ Windows Programming

You're reading from  C++ Windows Programming

Product type Book
Published in Sep 2016
Publisher Packt
ISBN-13 9781786464224
Pages 588 pages
Edition 1st Edition
Languages
Author (1):
Stefan Björnander Stefan Björnander
Profile icon Stefan Björnander

Table of Contents (22) Chapters

C++ Windows Programming
Credits
About the Author
About the Reviewer
www.PacktPub.com
Dedication
Preface
1. Introduction 2. Hello, Small World! 3. Building a Tetris Application 4. Working with Shapes and Figures 5. The Figure Hierarchy 6. Building a Word Processor 7. Keyboard Input and Character Calculation 8. Building a Spreadsheet Application 9. Formula Interpretation 10. The Framework 11. The Document 12. The Auxiliary Classes 13. The Registry, Clipboard, Standard Dialogs, and Print Preview 14. Dialogs, Controls, and Page Setup Rational and Complex Numbers

The circle application


In this section, we look into a simple circle application. As the name implies, it enables the user to handle circles in a graphical application. The user can add a new circle by pressing the left mouse button. The user can also move an existing circle by dragging it. Moreover, the user can change the color of a circle as well as save and open the document:

The main window

As we will see throughout this book, the MainWindow function always does the same thing: it sets the application name and creates the main window of the application. The name is used by the Save and Open standard dialogs, the About menu item, and the registry.

The difference between the main window and other windows of the application is that, when the user closes the main window, the application exits. Moreover, when the user selects the Exit menu item, the main window is closed, and its destructor is called:

MainWindow.cpp

#include "..\\SmallWindows\\SmallWindows.h" 
#include "Circle.h" 
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}