Introduction
Who Should Read This Book?
The Source Code
Acknowledgments
Legal Matters
Section I Background
1 The Road Ahead
Destination: The Application
Roadbed: The Target Platform
Vehicle: The Programming Language
2 Designing for Users
Polite Applications
Robustness
Focused Design
The Windows Logo Program
Usability Testing
The Unified File Model
3 Designing for Programmers
Programming Guiding Principles
Getting Your Priorities Straight
Global Variables Considered Harmful
Assert Your Sanity
Constantly on Guard
Use Destruction Constructively
Programming Defensively
Is Windows Object-Oriented?
4 The Mechanics of Subclassing
Subclassing Defined
Instance subclassing
Global Subclassing
Class Cloning
General Mechanism for Global Subclassing
General Mechanism for Instance Subclassing
The Window Class: Wrapping the HWND
Section II Foreground
5 The Bare Bones
The Major Organs
The Heart
The Editor Class
The Document Class
The AbstractEditWnd Class
Of Strings and Pathnames
6 Exceptions
Return Codes
Exceptions
Two-Stage Construction
Global Object Constructor Exceptions
The TextEdit Exception Classes
Converting Allocation Failures to Exceptions
Recovering from Errors
Structured Exception Handling and C++ Exceptions
8 Child Windows
Window Creation
The Toolbar
The Status Bar
9 The Main Window
Handling WM_COMMAND Messages
The Clipboard User Interface
Persistence in the Main Window
Drag and Drop
Menu Management
Communication Between TextEdit Instances
Changing User Settings
Notifications
The Editor Connection
10 Customization and Persistence
Customizing Windows
Retrieving the Font
Customizing TextEdit
Long-Term Memory
The Registry Interface
MRU
RunOnce
Food for Persistent Thought
11 Wait a Moment
Changing the Cursor Image
12 File I/O
Drive Type
SilentErrorMode
Opening Files
Reading and Writing Files
Copying the Original
Conversion
Saving
Conflict of Interest
13 About Dialogs
What is a Dialog Box, Anyway?
The Dialog Class
The About Box
The Options Dialog
Enter with Care
14 File Management
File Properties
Deleting Files
The Open File Dialog
15 Search and Replace
Default Button Handling
Initializing the Dialog
Persistence
Text Not Found
The Relationship between Dialog and Main Window
Replacing Text
16 Printing
DEVMODE and DEVNAMES
The Page Setup Dialog
The Print Dialog
Text Rendering and Pagination
17 Changing Fonts
Subclassing the Font Common Dialog
18 Going Abroad
Resource Files
Formatting Messages
Formatting Numbers
Formatting Dates, and Money, and…
19 Meanwhile, in the Background
Threads in TextEdit
Starting Threads
Communication Between Threads
20 Setup, and Down Again
Installation
Uninstall
Mea Culpa
21 The End of the Road
Appendix A TextEdit Command Index
Appendix B Bibliography and Recommended Reading
Index
What’s on the CD-ROM?
(Start bottom menu)
Top •
Home
• Articles
• Book
• Resources
Windows Developer Magazine
• R&D Books
• CMP Books
Amazon.com
• Amazon.co.uk
• Contact Petter Hesselberg
(End bottom menu)