Contents

Chapter 1: Tools

> Dialog Box Editor
> Resource Compiler
> NMAKE
> IPFC
> Libraries
> Header (or INCLUDE) Files
> The Compiler Switches Used in This Book

Chapter 2: Memory Management

> Committing Memory
> Suballocating Memory
> Shared Memory
> DosAllocMem or malloc

Chapter 3: Multitasking

> The Scheduler
> The Subtleties of Creating a Thread
> Threads and the C Runtime
> A Thread Example
> The Thread Output
> Executing a Program
> Sessions

Chapter 4: File I/O and Extended Attributes

> Extended Attributes
> EAs-Fragile: Handle with
> The LIBPATH.C Example
> Getting the File Size
> Opening a File
> Reading a File
> More on DosOpen
> An Extended Attribute Example: CHKEA.C

Chapter 5: Interprocess Communication

> An OS/2 Named Pipe Client-Server Example
> DOS-OS/2 Client-Server Connection
> An OS/2 QUEUE Client-Server Example
> An OS/2 Semaphore vs. Flag Variable Example

Chapter 6: DLLs

> DLL Overview
> Thunking
> DLL Performance
> Simple DLL Example (32-32)
> Creating the .EXE and the DLL
> 16-32, 32-16 Transitions
> Call a 32-Bit DLL from 16-Bit
> Pointer Declarations
> Calling a 16-Bit DLL from a 32-Bit Program
> Loading/Unloading of DLLs
> Optimizing Performance in DLLs

Chapter 7: Exception Handling

> How to Register an Exception Handler
> What an Exception Handler Looks
> Signal Exceptions
> Dos and Don'ts for Exception
> DosExitList and Exception Handlers
> A Guard Page Example
> Summary

Chapter 8: Interfacing with OS/2 Devices

> Serial Interface Example Using DosDevIOCtl .
> Serial Interface Example Using inp.

Chapter 9: Introduction to Windows .

> Introduction .
> What Is a Window?
> The INCLUDE Files
> The Window Procedure Definition
> Helper Macros
> Presentation Manager Program Initialization
> Creating a New Class
> Creating a Window
> Message, Message, Who's Got the Message ?
> Terminating a Program
> The Window Procedure Revisited
> Parents and Owners
> Window Stylin'
> Another Window Example: WINDOW
> The Presentation Manager Coordinate Space
> More on Window Painting
> Painting by Numbers
> Enumerating Windows
> WriteWindowInfo
> The DrawString function
> Presentation Spaces
> Window Words
> Control Windows
> Presentation Parameters

Chapter 10: Window Management

> Visible, Invisible, Enabled, and Disabled Windows
> Window sizing
> Device Independence, Almost
> Subclassing the Frame Window
> In Case of Error, Use the Class Default
> Tracking the Frame.
> Saving Window Settings
> WinRestoreWindowPos
> X,Y,Z - Order
> Saving State

Chapter 11: Window Messages and Queues

> Message Ordering
> Focus Messages
> Size and Paint Messages
> The Last Messages a Window Receives
> Sending Messages
> Broadcasting Messages
> Peeking into the Message Queue
> Finding More Message Queue Information
> Message Priorities
> Messages and Synchronization of Events
> User-Defined Messages
> Some words about using window messages with non-PM threads

Chapter 12: Resources

> More About Resources, I Would Know
> Resource Files
> Using the Resource Compiler
> Pointers and Icons
> Bitmaps
> String Tables
> Accelerators
> Dialog Boxes
> Menus
> Help Tables
> Application-defined Data .

Chapter 13: Dialog Boxes

> The Dialog Box Template
> The Client Window Procedure
> Creating a Modal Dialog Box
> Creating a Modeless Dialog Box
> The Dialog Procedure DlgProc
> WM_COMMAND and Dialogs.
> Summary

Chapter 14: Menus

> Menus: The Keyboard and the Mouse
> Mnemosyne's Mnemonics
> Menu Styles
> Menu Item Styles
> The Resource File
> Menu Item Attributes
> Creating the Menu Bitmap
> The Client Window Procedure ClientWndProc
> The User Function displayMenuInfo
> Pop-up Menus
> Creating a Pop-up Menu
> I Think I Can, I Think Icon
> Popping Up a Menu
> The Workhorse Function WinPopupMenu

Chapter 15: List Boxes

> List Box Styles
> Extended Selection
> Initializing the Client Window
> Initializing the List Box
> The WM_COMMAND Message Dialog Processing
> Processing the UM_LISTBOXSEL Message
> The Client Window Painting Routine
> Owner-Drawing Controls
> DlgProc
> The WM_MESSAGE message
> The WM_DRAWITEM message
> An Introduction to Owner-drawn States
> Drawing the List Box Labels
> Drawing the Bitmaps
> Summary

Chapter 16: Buttons

> Button Styles
> Example Program
> The BUTTON.RC Resource File
> DlgProc
> Dialog Units-Can We Talk?
> Button Actions
> Summary

Chapter 17: Entry Fields

> Entry Field Basics
> Selection Basics
> The Entry Field and the Clipboard
> And Other Things
> ENTRY I-Entry Field Samples

Chapter 18: Multiline Edit Controls

> Terminology, Etc.
> MLE1
> How to Upset a User Rather Quickly
> No Refreshment
> Clipboard Support
> Navigation without a Sextant
> Line by Line
> Searching for What Was That Again ?
> As If That Weren't Enough

Chapter 19: Other Window Classes

> Combo Boxes
> Frames
> Scrollbars
> Statics
> Titlebars

Chapter 20: Drag and Drop

> Tennis, Anyone ?
> Initialization Code for Drag and Drop Source
> Things Never Told to the Programmer That Should Have Been
> Direct Manipulation Is a Real Drag
> And Now a Word from Our Sponsor
> Data Transfer
> A Concrete Example
> More Cement, Please
> DrgDragFiles
> From the Top Now
> Pickup and Drop
> Functions Used for Lazy Drag
> Lazy Drag Sample

Chapter 21: Value Set

> Value Set Styles
> The VALUE.RC Resource File
> Initializing the Value Set
> Value Set Selection Notification
> VALUE Paint Processing
> The User-defined Message UM_UPDATE

Chapter 22: Notebook

> Notebook Pages
> Flipping Pages
> Creating a Notebook

Chapter 23: Containers

> Container Views
> Container Styles
> LPs or 45s ?
> Half Full or Half Empty ?
> Icon, Name, and Text Views
> Tree View
> Details View
> Splitbars
> Of Emphasis and Pop-ups
> Direct Editing
> Of Sorting and Filtering
> Where Does Direct Manipulation Fit In ?
> Summary

Chapter 24: Spin Buttons

> Spin Button Styles
> Accelerator
> WM_CREATE Processing
> WM_CONTROL Processing
> WM_COMMAND Processing
> WM_PAINT Processing

Chapter 25: Sliders

> Linear Slider Styles
> Creating a Linear Slider
> A Linear Slider Example Program
> Initializing the Slider
> Using an Ownerdrawn Slider
> Circular Sliders
> Circular Slider Styles
> Creating a Circular Slider
> A Circular Slider Example Program
> Initializing the Slider
> Circular Slider Colors
> Summary

Chapter 26: Font and File Dialogs

> The File Dialog
> Special Considerations for Multiple File Selections
> The FILEDLG Example Program
> The Window Word
> Putting it All Together: FindFile
> Initializing the FILEDLG Structure
> The Font Dialog
> An Example Program: FONTDLG
> Customizing the Font Dialog
> Querying the Current Font
> Initializing the Font Dialog Structure with the Current Font
> Bringing Up the Font Dialog

Chapter 27: Subclassing Windows

> Superclassing

Chapter 28: Presentation Manager Printing

> A Printer's Overview
> Where's My Thing ?
> I Want That with Mustard, Hold the Mayo, No Onions, Extra Ketch
> Where Were We?

Chapter 29: Help Manager

> Application Components
> The Application Source
> Messages
> The Help Tables
> Sample HELPTABLE
> Message Boxes
> Fishing, Anyone ?
> The Help Panels
> Sample Help Panel
> Putting It All Together
> Restrictions
> Using HELP TABLEs for Message Box Help

Chapter 30: Multithreading in Presentation Manager Applications

> Introduction
> Types of Threads
> Designing the Architecture
> Data Communications
> Entry and Exit Points
> What Have We So Far ?
> User Feedback
> User Feedback Example
> Synchronicity
> Synchronous Threading Example
> Object Windows
> Building a Blind Window
> Design Considerations

Appendix A - Window Messages

> Dialog Box Messages
> Button Messages
> List Box Messages
> Notebook Messages
> Value Set Messages
> Slider Messages
> Circular Slider Messages
> File Dialog Messages
> Font Dialog Messages
> Menu Messages
> Entryfield Messages
> Spin Button Messages
> Help Manager Messages
> Drag and Drop Messages
> Container Messages

Appendix B - References
Index