Book Image

C++ Windows Programming

By : Stefan Björnander
Book Image

C++ Windows Programming

By: Stefan Björnander

Overview of this book

It is critical that modern developers have the right tools to build practical, user-friendly, and efficient applications in order to compete in today’s market. Through hands-on guidance, this book illustrates and demonstrates C++ best practices and the Small Windows object-oriented class library to ease your development of interactive Windows applications. Begin with a focus on high level application development using Small Windows. Learn how to build four real-world applications which focus on the general problems faced when developing graphical applications. Get essential troubleshooting guidance on drawing, spreadsheet, and word processing applications. Finally finish up with a deep dive into the workings of the Small Windows class library, which will give you all the insights you need to build your own object-oriented class library in C++.
Table of Contents (22 chapters)
C++ Windows Programming
Credits
About the Author
About the Reviewer
www.PacktPub.com
Dedication
Preface
Free Chapter
1
Introduction

The Accelerator class


It is possible to add an accelerator to a menu item. The accelerator text is preceded by a tabulator character (\t) and the text is made up of the optional prefixes Ctrl+, Shift+, or Alt+ followed by a character (for instance, &Open\tCtrl+O) or the name of a virtual key (for instance, &Save\tAlt+F2).

Accelerator.h

namespace SmallWindows { 

The Win32 API holds a set of virtual keys with names beginning with VK_. In Small Windows, they have been given other names, hopefully easier to understand. The virtual keys available are: F1 - F12, Insert, Delete, Backspace, Tab, Home, End, Page Up, Page Down, Left, Right, Up, Down, Space, Escape, and Return:

  enum Keys {KeyF1 = VK_F1, KeyF2 = VK_F2, KeyF3 = VK_F3, 
             KeyF4 = VK_F4, KeyF5 = VK_F5, KeyF6 = VK_F6, 
             KeyF7 = VK_F7, KeyF8 = VK_F8, KeyF9 = VK_F9, 
             KeyF10 = VK_F10, KeyF11 = VK_F11, KeyF12 = VK_F12, 
             KeyInsert = VK_INSERT, KeyDelete = VK_DELETE...