0% found this document useful (0 votes)
417 views31 pages

Advanced MFC Programming: Supporting Document

This document contains a summary of advanced MFC programming techniques discussed over 10 chapters. Chapter 1 discusses toolbars, dialog bars, adding controls like combo boxes to toolbars. Chapter 2 covers customizing menus, right click menus, dynamic menu updates. Chapter 3 discusses splitters windows. Chapter 4 discusses bitmap buttons and mouse handling. Chapter 5 summarizes common controls like list boxes, tree controls, property sheets. Chapter 6 covers dialog boxes and properties. Chapter 7 summarizes file dialogs, color pickers, font dialogs. Chapter 8 discusses GDI objects, palettes, device contexts. Chapter 9 covers fonts and text display. Chapter 10 summarizes bitmap loading, conversion and manipulation.

Uploaded by

GuilhermeMiranda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
417 views31 pages

Advanced MFC Programming: Supporting Document

This document contains a summary of advanced MFC programming techniques discussed over 10 chapters. Chapter 1 discusses toolbars, dialog bars, adding controls like combo boxes to toolbars. Chapter 2 covers customizing menus, right click menus, dynamic menu updates. Chapter 3 discusses splitters windows. Chapter 4 discusses bitmap buttons and mouse handling. Chapter 5 summarizes common controls like list boxes, tree controls, property sheets. Chapter 6 covers dialog boxes and properties. Chapter 7 summarizes file dialogs, color pickers, font dialogs. Chapter 8 discusses GDI objects, palettes, device contexts. Chapter 9 covers fonts and text display. Chapter 10 summarizes bitmap loading, conversion and manipulation.

Uploaded by

GuilhermeMiranda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 31

Advanced MFC Programming

Supporting Document
Table of Contents

CHAPTER 1. TOOL BAR AND DIALOG BAR

1.1. Adding an Extra Docking Tool Bar


Default Tool Bar
Tool Bar Implementation
Message Mapping
Adding New Tool Bar Resource
Declaring New Member Variable
Creating New Tool Bar
Command Message Mapping

1.2. Imitating the Behavior of Radio Buttons


Radio Button & Check Box
Sample

1.3. Check Box Implementation


Using Boolean Type Variables
Function CButton::SetButtonInfo(…)

1.4. Message Mapping for a Contiguous Range of Command IDs


Contiguous IDs
Modifying an ID

1.5. Fixing the Size of Tool Bar

1.6. Adding Combo Box to Tool Bar

1.7. Modifying the Default Styles of Tool Bar

1.8. Dialog Bar

1.9. Resizable Dialog Bar


Deriving New Class from CDialogBar
Resizing Edit Control
Dynamic Layout
Using the New Class

1.10. Adding Flyby and Tool Tip

1.11. Toggling Control Bars On/Off

Summary:

CHAPTER 2. MENU

2.1 Message WM_COMMAND and UPDATE_COMMAND_UI


Handling WM_COMMAND Command
Enabling & Disabling a Command
Changing Menu Text

ii
Checking a Menu Item

2.2 Right Click Pop Up Menu


Adding Menu Resource
Trapping Right Button Clicking Event
Using Class CMenu
Implementing Right-Click Menu
Message Mapping for Right-Click Menu

2.3 Updating Menu Dynamically


Menu Struture
Inserting and Removing Menu Item
Sample Implementation

2.4 Bitmap Check

2.5 System Menu and Bitmap Menu Item


System Menu
Bitmap Menu Item
New Functions
Menu Modification
Message Mapping for System Command

2.6 Owner-Draw Menu


Overriding Two Functions
Drawing a Bitmap
Deriving a New Class from CMenu
Overriding Function CMenu::MeasureItem(…)
Overriding Function CMenu::DrawItem(…)
Using the New Class

2.7 Changing the Whole Menu Dynamically

Summary

CHAPTER 3. SPLITTER WINDOW

3.1 Implementing Static Splitter Windows

3.2 Dynamic Splitter Window

3.3 Customizing the Behavior of Split Bar


Splitter Window Layout
Overriding CSplitterWnd::DeleteRow(…) and CSplitterWnd:: DeleteColumn(…)
Using the New Class

3.4 Customizing the Default Appearance


Drawing Functions
Sample

3.5 Splitter Window That Can’t be Resized by Tracking

Summary

iii
CHAPTER 4. BUTTONS

4.1 Bitmap Button: Automatic Method


Button States
Owner-Draw Bitmap Button
Automatic Method
Sample

4.2 Bitmap Check Box and Radio Button: Method 1

4.3 Subclass
Implementing Subclass
Bitmap Button

4.4 Bitmap Check Box and Radio Button: Method 2

4.5 Irregular Shape Bitmap Button


Transparent Background
New Class
Overriding Function CBitmapButton::LoadBitmaps(…)
Overriding Function CBitmapButton::AutoLoad(…)
Overriding Function CBitmapButton::DrawItem(…)
Using Class MCBitmapButton

4.6 Making Button Aware of Mouse Position


Trapping Message WM_LBUTTONUP within Button
User-Defined Message
Sample

4.7 Mouse Sensitive Button


Setting Capture
New Class
Implementation

Summary

CHAPTER 5. COMMON CONTROLS

5.1 Spin Control


Using Spin Control with Edit Box

5.2 Customizing the Properties of Spin Control

5.3 Displaying Text Strings in the Buddy Window

5.4 Bitmap Button Buddy

5.5 Slider
Including Slider Control in the Application
Handling Slider Related Messages

5.6 List Box

5.7 Handling List Box Messages

iv
Trapping Double Clicking Message
Retrieving the Contents of an Item
Message WM_DESTROY

5.8 Combo Box


Implementing Combo Boxes
Handling Messages CBN_CLOSEUP and CBN_SELCHANGE

5.9 Trapping RETURN key strokes for the Combo Box


Problem & Workaround
Function CWnd::PreTranslateMessage(…)
Accessing the Edit Box of a Combo Box

5.10 Implementing Subclass for the Edit Box of a Combo Box


Designing New Classes
Implementing Subclass

5.11 Owner Draw List Box and Combo Box


Owner-Draw Styles
Preparing Bitmaps
Identifying Item Types
Handling Message WM_MEASUREITEM
Handling Message WM_DRAWITEM

5.12 Tree Control


Image List
Adding Nodes
Sample

5.13 Handling Tree Control Messages


Handling TVN_ITEMEXPANDING to Change a Node’s Associated Image
Handling TVN_ENDLABELEDIT to Enable Label Editing
Using the New Class

5.14 Drag-n-Drop
Handling New Messages
New Member Variables and Functions
Node Copy
TVN_BEGINDRAG
WM_MOUSEMOVE
WM_LBUTTONUP

5.15 List Control


LV_COLUMN and LV_ITEM
Sample
Creating Image Lists
Creating Columns
Creating Sub-items
Changing List Style Dynamically

5.16 Tab Control


Using Tab Control
Handling Tab Control Message

5.17 Animate Control and Progress Control

v
Using Animate Control and Progress Control
Timer
Custom Resource
Sample Implementation

Summary:

CHAPTER 6. DIALOG BOX

6.1 Modeless Dialog Box


Modal and Modeless Dialog Box
Sample

6.2 Property Sheet

6.3 Modeless Property Sheet

6.4 Sizes
Initial Size
Dialog Box Unit
Tracking Size and Maximized Size
Sample

6.5 Customizing Dialog Box Background


Background Drawing
Sample
Changing the Background of Common Controls
Stock Objects
Text Foreground and Background

6.6 Resizing the Form View


Coordinates Conversion
Sample

6.7 Tool Tips


Tool Tip Implementation
Sample

6.8 Tool Bar and Status Bar in Dialog Box


Frame Window
Flyby Related Messages
Tool Bar Resource
Status Bar
Adding Control Bars to Dialog Box
Resizing the Client Area to Accommodate Control Bars
Tool Tip and Flyby Implementation
Implementing Control Bars for Dialog Boxes Implemented in SDI or MDI Applications
Problem
Work Around
Overriding CToolBar::OnTimer(…)
An Alternate Solution

Summary:

vi
CHAPTER 7. COMMON DIALOG BOXES

7.1 File Open and Save Dialog Box


Implementing a Standard File Open Dialog Box
Structure OPENFILENAME
File Extension Filter
Retrieving File Names
File Open
File Save

7.2 More Customizations


New Style and Old Style File Dialog Boxes
Other Bits of Flags
Dialog Box Title
Retrieving Multiple Path Names and File Names
Sample

7.3 Selecting Only Directory


New Style
Old Style

7.4 Adding File Preview


Adding Extra Controls
Notification CDN_SELCHANGE
Sample

7.5 Color Dialog Box


Introduction
Initializing Selected Color and Custom Colors
Sample
Full Open

7.6 Custom Dialog Box Template


Custom Dialog Template
Commands Implementation

7.7 Font Dialog Box


Basics
Structure LOGFONT
Retrieving Selected Font
Sample

7.8 Customizing Dialog Box Template

7.9 Modeless Common Dialog Boxes


Tricks
Hook Function
Using MFC Classes together with API Functions
Obtaining Handle
Accessing Member Variable from Static or Global Function
Sample Implementation
Applying Selected Color Instantly

Summary:

vii
CHAPTER 8. DC, PEN, BRUSH AND PALETTE

8.0 Device Context & GDI Objects


Situation
Device Context
GDI Objects
Obtaining DC
Using DC with GDI Objects

8.1 Line
Creating Pen
Drawing Mode
Storing Data
Recording One Line

8.2 Rectangle and Ellipse

8.3 Curve

8.4 Other Shapes

8.5 Flood Fill

8.6 Pattern Brush

8.7 Color Approximation


Palette Device vs. Non-Palette Device
Color Approximation
Sample
Adjusting Display Settings
Results

8.8 Logical Palette


Palette
Color Mapping
Foreground and Background Palette
Creating Logical Palette
Using Logical Palette
Realizing Palette
Macro PALETTEINDEX
Sample

8.9 Monitoring System Palette

8.10 Palette Animation


Flag PC_RESERVED
Animation
Sample

8.11 Find Out Device Capability

Summary:

CHAPTER 9. FONT

viii
9.1 Outputting Text Using Different Fonts

9.2 Enumerating Fonts in the System


Font Types
Enumerating Font Family
Enumerating Font

9.3 Output Text Using CDC::ExtTextOut(…)


Function CDC::ExtTextOut(…)
New Class
Implementing Percentage Bar

9.4 One-Line Text Editor, Step 1: Displaying a Static String

9.5 One Line Text Editor, Step 2: Adding Caret


Caret Functions
Sample

9.6 One Line Text Editor, Step 3: Enabling Input


New Member Functions
Message WM_CHAR

9.7 One Line Text Editor, Step 4: Caret Moving & Cursor Shape
New Functions
Moving Caret Using Keyboard
Moving Caret Using Mouse
Cursor Shape
Handling WM_LBUTTONDOWN to Move Caret

9.8 One Line Text Editor, Step 5: Selection


Highlighting the Selected Text
Setting Selection Indices
Handling Mouse Events

9.9 One Line Text Editor, Step 6: Cut, Copy and Paste
Global Memory
Clipboard Funcitons
Deleting Selected Text
Message Handlers for Cut, Copy Paste Commands

9.10 One Line Text Editor, Step 7: Getting Rid of Flickering


Function CDocument::UpdateAllViews(…)
Defining Hints
Calling Function CDocument::UpdateAllViews(…)
Overriding CView::OnUpdate(…)

Summary:

CHAPTER 10. BITMAP

10.1 BitBlt and StretchBlt


DIB & DDB
Drawing DDB
Creating Memory DC

ix
Retrieving the Dimension of Bitmap Image
Sample 10.1\GDI
Sample 10.1-2\GDI

10.2 Extracting Palette from DIB


DIB Format
DIB Example
Creating DDB from DIB
Loading Resource
Sample

10.3 Loading DIB from File


File Format
Supporting File Type
Loading DIB through Serialization
Creating DDB

10.4 Saving DDB to File


Converting DDB to DIB
New Functions
Using New Functions

10.5 Drawing DIB Directly


New Functions
Modifications Made to Document
Modifications Made to View

10.6 Bitmap Format Conversion: 256-color to 24-bit


Conversion
Current Format
Function Implementation

10.7 Converting 24-bit Format to 256-color Format


Two Cases
Sample

10.8 Pixel Manipulation

10.9 DIB Section: Using Both DIB and DDB


Importance of DDB
DIB Section
New Variables
Cleaning Up
Loading Bitmap & Creating Mask Bitmap
Drawing Bitmap with Transparancy
Adding Background

10.10 Creating Chiseled Effect


Algorithm
Creating Binary Bitmap Image
Raster Operation Mode
Chiselled Effect
Highlighted and Shadowed Colors
New Function
Function CGDIView::LoadBitmap(…) & CGDIView::OnDraw(…)

x
Summary

CHAPTER 11. SAMPLE: SIMPLE PAINT

11.0 Preparation

11.1 Ratio and Grid


Zoom In & Zoom Out
Grid
Pattern Brush and Its Origin

11.2 Color Selection


Color Selection Control
Color Bar
Color Selection
Integrate the Color Bar into the Program

11.3 Simple Drawing


New Tool Bar
New Functions
Mouse Cursor

11.4 Tracker
Implementing Tracker
Moving and Resizing Tracker
Customizing Cursor Shape
New Tool
If Mouse Clicking Doesn’t Hit the Tracker
If Mouse Clicking Hits the Tracker

11.5 Moving the Selected Image


Normalizing Tracker
Moving and Resizing the Selected Image
When Left Button is Up

11.6 Region
Basics
Region Creation
Using Region
Sample

11.7 Path
Basics
Path & Region
Sample 11.7-1\GDI
Obtaining Path
Sample 11.7-2\GDI

11.8 Freeform Selection


Implementation
Scaling Region
New Tool
Resizing and Moving the Freeform Selection

xi
11.9 Cut, Copy and Paste
Clipboard DIB Format
Preparing DIB Data
Cut & Copy
Paste

11.10 Palette Change & Flickering


Problems
Message WM_PALETTECHANGED
Flickering

Summary

CHAPTER 12. SCREEN CAPTURING & PRINTING

12.1 Capturing the Whole Screen


Capture
Converting DDB to DIB
New Command

12.2 Capturing a Specified Window


Picking Up a Window
Dialog Box IDD_DIALOG_SELECT
New Command

12.3 Simple Printing


Mapping Mode
Converting between Logical and Device Units
Implementing Print
Scaling the Image before Printing
Displaying or Printing?
Function CGDIView::OnDraw(…)

12.4 Fixed Scale Printing


Printing Related Functions
Sample 12.4\GDI

12.5 Printing on Separate Pages


Number of required Pages is Known Beforehand
Setting Number of Pages Just Before Printing Starts
Calculating the Number of Pages when the Printing Is Undergoing

12.6 Customizing Print Dialog Box


Customizing Common Controls
Using Custom Dialog Template

Summary

CHAPTER 13. ADDING SPECIAL FEATURES TO APPLICATION

13.1 One Instance Application


Window Creation
Function CWnd::PreCreateWindow(…)
One-Instance Application in MFC

xii
Sample 13.1\Once

13.2 Creating Applications without Using Document/View Structure


How Application, Document and View Are Bound Together
Creating Window
Sample 13.2\Gen
Excluding Classes from Build

13.3 Implementing Multiple Views


Simple View Implementation
Attaching Multiple Views to One Document
Sample 13.3\Chart
Window Origin and View Port Origin
MM_ANISOTROPIC & MM_ISOTROPIC
Window Extents and View Port Extents
Pie Chart Drawing

13.4 Multiple Documents Implementation

13.5 Painting Caption Bar


Non-client Area and Related Messages
Caption Text Area
Sample 13.5\Cap

13.6 Irregular Shape Window


Problem
Style WS_EX_TRANSPARENT
Using Dialog Box
Disabling Default Background Painting
Disabling Non-client Area Painting
Moving the Window with Mouse

13.7 Saving Initial States


Where to Save the Information
Functions Used to Write and Read Information
Format of “.ini” File
Sample 13.7\Ini

13.8 Exchanging User-Defined Messages Among Applications


Registering User Defined Messages
Sample
Finding Window & Sending Message

13.9 Z-Order

13.10 Hook
Hook Installation
System Wide Hook
Variables in DLL
Defining Data Segment
DLL Implementation
Sample 13.6\Hook

13.11 Journal Record and Journal Playback Hooks


Analyzing Events

xiii
Playing back the Recorded Events
Using Functions Contained in DLL

13.12 Memory Sharing Among Processes


Problem with Global Memory
File Mapping
File Mapping Functions
Samples

Summary

CHAPTER 14. VIEWS

14.1 Edit View


Generating the Application
Search Related Commands
Other Commands

14.2 Rich Edit View


Customizing File Open Dialog Box
Customizing “Save As” Dialog Box
Formatting Text

14.3 Simple Explorer, Step 1: Preparation

14.4 Simple Explorer, Step 2: List Drives


Creating Image List
Alternative Ways of Creating Image List
Selecting Image List into Tree Control
Setting Styles of Tree Control
Adding Root Node
Finding out Available Drives in the System

14.5 Simple Explorer, Step 3: Listing Directories


Enumerating Files and Directories
Adding Directory Nodes

14.6 Simple Explorer, Step 4: Displaying Files


Image Lists
Adding Columns
Listing Files
Destroying the Old List
Using Function CExplorerView::ChangeDir()

14.7 Simple Explorer, Step 5: Displaying Registered Icons


Which Icon to Use
Sample

14.8 Simple Explorer, Step 6: Clicking and Double Clicking


Tree Control Messages
Obtaining Full Path
Finding out the Clicked Item
When an Item Is Clicked
When a Node Expands

xiv
14.9 Simple Explorer, Step 7: File Sort
Sort Related Functions
Adding Parameters to Items
Functions Implementing Comparisons
Using Parameter to Find an Item
Comparing Two Items by File Names
Notification LVN_COLUMNCLICK

14.10 Using Form View


New Class and Dialog Template
Implementing New Member Functions
Resizing Tree Control
Mouse Cursor Coordinates
Replacing CDirView with CDirFormView

Summary

CHAPTER 15. DDE

15.1 DDE Registration


DDE Initialization, Uninitialization, Service Registration, Unregistration
DDE Callback Function
Server
Monitoring DDE Activities

15.2 Connecting to Server


DDE Connection: Client Side
DDE Connection: Server Side
Client Implementation
Confirm Connection
DDE Disconnection
Test

15.3 Transaction: Data Request


Data Request Transaction: Client Side
Data Request Transaction: Server Side
Preparing Data
Receiving Data
Samples

15.4 Transaction: Advise


Basics
Initiating Advise Transaction
Advise Transaction Responding
Upon Receiving Advise
Terminating Advise Transaction

15.5 Transactions: Poke and Execute


Poke Transaction: Client Side
Poke Transaction: Server Side
Transaction: Executing Commands

15.6 Asynchronous Transaction


Synchronous vs. Asynchronous
Implementing Asynchronous Transaction

xv
Samples

15.7 Program Manager: A DDE Server


Program Manager

Summary

CHAPTER 16. CONTEXT SENSITIVE HELP

16.1 Context Sensitive Help for Menu Commands


Context Sensitive Help
Context Sensitive Help for Menu Commands
Sample
New Commands
Editing “AfxCore.rtf”
ID Mapping
Help Topics Dialog Box

16.2 Context Sensitive Help for Common Controls


Supporting Context Sensitive Help in Dialog Box
ID Naming Rules
Enabling Context Sensitive Help for Common Controls
Function CWnd::OnHelpInfo(…)
Displaying Help in a Pop up Window

Summary

INDEX

xvi
Appendix A. Virtual-key Codes
Index

Index

# BEGIN_MESSAGE_MAP, 7
Bezier curve, 344
#if, 402 BIF_BROWSEFORCOMPUTER, 171
#pragma, 401 BIF_BROWSEFORPRINTER, 171
.cnt, 465 BIF_RETURNFSANCESTORS, 172
.hm, 468 BIF_RETURNONLYFSDIRS, 172
.hpj, 465 Binary bitmap image, 313
__declspec, 402 Bit count per pixel, 276
_AfxCommDlgProc, 188 BITMAP, 50, 195, 273, 285
_chdir, 101 Mask bitmap, 77
_chdrive, 423 Obtain handle, 72
_getdrive, 423 Transparent background, 76
16 color, 215 Bitmap resource
16 color DIB, 276, 282 Add, 44
24 bit, 215 Bitmap size, 51
24-bit DIB, 276, 282 Bitmap with transparancy, 309
24-bit to 256-color format conversion, 297 BITMAPFILEHEADER, 282
256 color, 215 BITMAPINFO, 276, 305
256 color DIB, 276, 282 BITMAPINFORHEADER, 276
256-color to 24-bit conversion, 293 Black-and-white image, 302
8.3 format, 168 BN_CLICKED, 131
-SECTION, 403 BROWSEINFO, 171, 172
-SEGMENT, 401 Brush, 64, 65, 195
Hatched, 64
Hollow brush, 202
A Solid, 64
Button
AFX_IDS_APP_TITLE, 390 Bitmap check box and radio button, 70, 74
AFX_IDW_CNTROLBAR_FIRST, 157 Button states, 68
AFX_IDW_CONTROLBAR_LAST, 157 Irregular shape bitmap button, 76
AFX_IDW_PANE_FIRST, 57 Mouse sensitive button, 87
AfxCore.rtf, 465 Owner-draw bitmap button, 68
AfxGetApp, 27 Trap WM_LBUTTONUP message, 84
AfxGetInstanceHandle, 173, 181
AfxGetMainWnd, 43, 193
AfxGetResourceHandle, 154, 278 C
AfxRegisterClass, 380
AND, 304, 314, 339 Callback function, 233
Animate control, 134–36 CallNextHookEx, 403
APPCLASS_STANDARD, 442 CAnimateCtrl, 134
APPCMD_CLIENTONLY, 442 CAnimateCtrl::Open, 134
APPCMD_FILTERINITS, 442 CAnimateCtrl::Play, 134
ARROW key, 252 CAPS LOCK key, 252
Attach menu, 53 Caption bar, 388
Auto tick, 96 Caption text, 389
AVI, 134 Capture, 87
Release capture, 87
Set capture, 87
B Capture screen, 357
Caret, 244
BACK SPACE key, 250
Index

CB_ERR, 104 CCtrlBar::EnableDocking, 5


CBitmap, 195 CDC, 195
CBitmap::Attach, 281 CDC::BeginPath, 341, 342
CBitmap::CreateCompatibleBitmap, 82 CDC::BitBlt, 83, 272
CBitmap::DeleteObject, 79 CDC::Chord, 209
CBitmap::GetBitmap, 50, 112, 273, 285 CDC::CreateCompatibleDC, 82, 273
CBitmap::GetSafeHandle, 72 CDC::DeleteDC, 304
CBitmap::LoadBitmap, 44, 272 CDC::DPtoLP, 366
CBitmap::SizeToContent, 73 CDC::Draw3dRect, 210
CBitmapButton, 68 CDC::DrawDragRect, 393
CBitmapButton::AutoLoad, 69 CDC::DrawEdge, 328
CBitmapButton::DrawItem, 80, 327 CDC::DrawFocusRect, 209, 336
CBitmapButton::LoadBitmaps, 72, 79 CDC::Ellipse, 204
CBitmapButton::OnDrawItem, 78 CDC::EndPath, 341, 342
CBN_CLOSEUP, 103, 104 CDC::ExtFloodFill, 210
CBN_SELCHANGE, 103, 104 CDC::ExtTextOut, 238
CBRS_ALIGN_ANY, 5, 24 CDC::FillPath, 342
CBRS_ALIGN_BOTTOM, 5, 24 CDC::FillRect, 214
CBRS_ALIGN_LEFT, 5 CDC::FloodFill, 210
CBRS_ALIGN_TOP, 5, 24 CDC::FromHandle, 52, 81
CBRS_FLYBY, 5, 28 CDC::GetCurrentFont, 231
CBRS_SIZE_DYNAMIC, 15 CDC::GetDeviceCap, 367
CBRS_SIZE_FIXED, 16 CDC::GetDeviceCaps, 226
CBRS_TOOLTIP, 28 CDC::GetOutputTextMetrics, 247
CBRS_TOOLTIPS, 5 CDC::GetPath, 343
CBrush, 195, 201 CDC::GetPixel, 212, 309
CBrush::CreateHatchBrush, 201, 204 CDC::GetTextExtent, 239, 245
CBrush::CreatePatternBrush, 201, 212 CDC::IsPrinting, 368
CBrush::CreateSolidBrush, 201 CDC::LineTo, 200
CBS_AUTOHSCROLL, 18 CDC::LPtoDP, 366
CBS_DROPDOWN, 18 CDC::MoveTo, 200
CBS_HASSTRINGS, 18 CDC::OffsetClipRgn, 346
CButton, 70 CDC::OffsetViewportOrg, 385
CButton::GetCheck, 72, 74 CDC::OffsetWindowOrg, 385
CButton::SetBitmap, 71 CDC::PatBlt, 65, 315, 326
CButton::SetButtonInfo, 12 CDC::Pie, 209
CButton::SetState, 88 CDC::PolyBezier, 204
CC_CHORD, 226 CDC::Polygon, 210
CC_CIRCLES, 226 CDC::RealizePalette, 218
CC_ELLIPSES, 226 CDC::Rectangle, 64, 204
CC_ENABLETEMPLATE, 181 CDC::Rentangle, 201
CC_FULLOPEN, 181 CDC::RoundRect, 209
CC_PIE, 226 CDC::ScaleViewportExt, 386
CC_PREVENTFULLOPEN, 181 CDC::SelectClipPath, 342
CChildFrame, 59, 384 CDC::SelectClipRgn, 339, 340
CClientDC, 195, 200, 389 CDC::SelectObject, 64, 196
CCmdUI, 9, 34 CDC::SelectPalette, 218
CCmdUI::Enable, 9, 35 CDC::SetBkColor, 209
CCmdUI::SetCheck, 9, 30, 36 CDC::SetBkMode, 150, 209
CCmdUI::SetRadio, 9, 36 CDC::SetBrushOrg, 326
CCmdUI::SetText, 35 CDC::SetMapMode, 366
CColorDialog, 178 CDC::SetPixel, 309
CColorDialog::DoModal, 178 CDC::SetROP2, 197, 362
CColorDialog::GetColor, 179 CDC::SetTextAlign, 257
CComboBox, 103 CDC::SetTextColor, 209
CComboBox::AddString, 103, 109 CDC::SetViewportExt, 386
CComboBox::Create, 18 CDC::SetViewportOrg, 385
CComboBox::GetCurSel, 104 CDC::SetWindowExt, 386
CComboBox::GetLBText, 104 CDC::SetWindowOrg, 385
CControlBar:: CalcFixedLayout, 24 CDC::StretchBlt, 272
CControlBar::CalcDynamicLayout, 24 CDC::StrokeAndFillPath, 342
Index

CDC::StrokePath, 342 CFontDialog::IsBold, 185


CDC::TextOut, 208, 257 CFormView, 57
CDialog::Create, 138 CFrameWnd::Create, 381
CDialog::DoModal, 138 CFrameWnd::DockControlBar, 5
CDialog::GetDlgItemInt, 193 CFrameWnd::EnableDocking, 5
Cdialog::IDD, 138 CFrameWnd::GetActiveDocument, 193
CDialog::MapDialogRect, 144 CFrameWnd::LoadBarState, 396
CDialog::OnDestroy, 118 CframeWnd::m_pMainWnd, 43
CDialog::OnInitDialog, 69 CframeWnd::OnCreateClient, 56
CDialogBar, 24 CFrameWnd::SaveBarState, 396
CDialogBar::Create, 22 CGdiObject::DeleteObject, 79, 304
CDialogBar::m_sizeDefault, 26 CGDIObject::UnrealizeObject, 326
CDN_SELCHANGE, 176 Character formatting, 418
CDocument CHARFORMAT, 418
OnCloseDocument, 190 Check box, 8
CDocument::DoSave, 417 Check menu item, 30
CDocument::GetFirstViewPosition, 245 Checked state, 8
CDocument::GetNextView, 245 Chiseled effect, 312
CDocument::GetTitle, 390 Chiselled effect, 314
CDocument::OnNewDocument, 243 CHOOSECOLOR, 179, 187
CDocument::OnUpdateAllViews, 263 CHOOSEFONT, 184, 187
CDocument::Serialize, 288 Chord, 209
CDocument::UpdateAllViews, 231, 243, 264, 265 CImageList, 115
CDWordArray, 205 CImageList:: DragLeave, 126
CDWordArray::Add, 205 CImageList::Add, 115, 421, 431
CEdit::Clear, 415 CImageList::BeginDrag, 123
CEdit::ReplaceSel, 414 CImageList::Create, 115, 117, 421
CEdit::SetSel, 108, 415 CImageList::DragLeave, 126
CEditCtrl::ReplaceSel, 444 CImageList::DragMove, 123, 126
CEditView, 57, 413, 444 CImageList::DragShowNolock, 123
CEditView::GetEditCtrl, 414 CImageList::EndDrag, 123, 126
CEditView::SerializeRaw, 413 CImageList::EnterDrag, 122, 123
CF_DIB, 261, 349 CImageList::GetImageList, 118
CF_EFFECTS, 184 CImageList::LeaveDrag, 122
CF_ENABLETEMPLATE, 186 CImageList::SetBkColor, 115
CF_INITTOLOGFONTSTRUCT, 185 CImageList::SetDragCursorImage, 122, 123
CF_LIMITSIZE, 184 Clipboard, 259, 260
CF_TEXT, 261 Clipboard DIB format, 349
CFileDialog, 165 CListBox::AddString, 99
CFileDialog::DoModal, 165 CListBox::Dir, 99
CFileDialog::GetFileName, 166 CListBox::GetCurSel, 100
CFileDialog::GetNextPathName, 169 CListBox::GetSelCount, 100
CFileDialog::GetPathName, 166 CListBox::GetSelItems, 101
CFileDialog::GetStartPosition, 169 CListBox::GetText, 100
CFileFind, 424 Clistbox::InsertString, 99
CFileFind::FindFile, 424, 428 CListBox::SetColumnWidth, 99
CFileFind::FindNextFile, 424, 428 CListCtrl, 99, 127, 436
CFileFind::GetLastWriteTime, 428 CListCtrl::FindItem, 435, 436
CFileFind::GetLength, 428 CListCtrl::GetText, 101
CFileFind::IsDirectory, 425, 428 CListCtrl::InsertColumn, 128, 427
CFileFind::IsDots, 426 CListCtrl::InsertItem, 128, 428
CFongDialog::IsItalic, 185 CListCtrl::ResetContent, 101
CFont, 195, 229 CListCtrl::SelectImageList, 128
CFont::CreateFont, 229 CListCtrl::SetItem, 131, 429
CFont::CreateFontIndirect, 229, 231 CListCtrl::SetItemText, 429
CFont::GetLogFont, 231 CListCtrl::SortItems, 434
CFontDialog, 184 CListView, 420
CFontDialog::DoModal, 184 CListView::GetListCtrl, 435
CFontDialog::GetColor, 231 CloseClipboard, 260
CFontDialog::GetCurrentFont, 231 CMainFrame:: OnPaint, 382
CFontDialog::GetFaceName, 185 CMainFrame::PreCreateWindow, 398
Index

CMenu, 37 Convert DDB to DIB, 285


CMenu::Attach, 53 Coordinate conversion, 39
CMenu::CheckMenuItem, 39 Coordinates conversion, 151
CMenu::DeleteMenu, 42 CPalette, 195
CMenu::Detach, 54 CPalette::AnimatePalette, 225
CMenu::DrawItem, 49, 51 CPalette::CreatePalette, 217
CMenu::EnableMenuItem, 38 CPalette::SetPaletteEntries, 323
CMenu::GetSafeHmenu, 42, 53 CPen, 195
CMenu::GetSubMenu, 38 CPen::CreatePen, 196, 200
CMenu::InsertMenu, 41 CPrintDialog, 374
CMenu::LoadMenu, 38 CPrintInfo, 369
CMenu::MeasureItem, 49, 50 CPrintInfo::m_nCurPage, 370
CMenu::ModifyMenu, 46 CPrintInfo::m_pPD, 374
CMenu::RemoveMenu, 42 CPrintInfo::SetMaxPage, 370
CMenu::SetMenuItemBitmaps, 44 CProgressCtrl, 134
CMenu::TrackPopupMenu, 39 CProgressCtrl::SetRange, 134
CMultiDocTemplate, 383 CProgressCtrl::SetStep, 134
Color approximation, 213–16 CProgressCtrl::StepIt, 134
Color dialog box, 178–84 CPropertyPage, 140
Custom colors, 179 CPropertySheet, 140
Custom dialog template, 181 CPropertySheet::AddPage, 141
Default selected color, 178 CPropertySheet::Create, 142
Full open, 181 CPropertySheet::SetWizardMode, 142
Obtain custom colors, 179 CPtrArray, 198
Obtain selected color, 179 Create DDB from DIB, 278
Color mapping, 217 Create window, 377, 381
Color table, 276 Create window dynamically, 17
COLOR_3DFACE, 315 CreateDIBitmap, 278, 281
COLOR_3DHIGHLIGHT, 315 CreateDIBSection, 305
COLOR_3DHILIGHT, 315 CreateFileMapping, 409
COLOR_3DLIGHT, 316 CREATESTRUCT, 422
COLOR_3DSHADOW, 316 Creation context, 58
COLOR_BTNFACE, 315 CRect, 64
COLOR_BTNHIGHLIGHT, 315, 316 CRect::InflateRect, 328
COLOR_BTNHILIGHT, 315 CRect::NormalizeRect, 337
COLOR_BTNSHADOW, 316 Crect::PtInRect, 88, 333
COLORREF, 117, 179, 230 CRectTrack::Track, 334
COLORRES, 226 CRectTracker, 333
Combo box, 102 CRectTracker::dottedLine, 333
Drop down combo box, 102 CRectTracker::Draw, 334
Fixed owner-draw style, 111 CRectTracker::hatchedBorder, 333
Simple combo box, 102 CRectTracker::hitBottomRight, 334
Trap RETURN key, 105 CRectTracker::hitNothing, 334
Variable owner-draw style, 111 CRectTracker::HitTest, 334
Common dialog box CRectTracker::hitTopLeft, 334
Custom data, 188 CRectTracker::hitTopRight, 334
Hook function, 187 CRectTracker::m_nStyle, 333
Modeless, 187–93 CRectTracker::m_rect, 334
Compatible DC, 273 CRectTracker::resizeInside, 333
Compatible memory DC, 49 CRectTracker::resizeOutside, 333
Context sensitive help, 464 CRectTracker::SetCursor, 334
Alias, 468 CRectTracker::solidLine, 333
Common controls, 469 CRectTracker::Track, 337
Footnote, 466 CRectTracker:hitBottom, 334
Heading, 468 CRectTracker:hitBottomLeft, 334
ID mapping, 468 CRectTracker:hitLeft, 334
ID naming rule, 470 CRectTracker:hitMiddle, 334
Pop up help window, 472 CRectTracker:hitRight, 334
Tab entry, 468 CRectTracker:hitTop, 334
Contiguous IDs, 13 CRgn, 195, 346
Control panel, 215 CRgn::CombineRgn, 339
Index

CRgn::CreateEllipticRgn, 339 CSplitterWnd::SetColumnInfo, 61


CRgn::CreateEllipticRgnIndirect, 339 CSplitterWnd::SetRowInfo, 61
CRgn::CreateFromPath, 342 CSplitterWnd::splitBar, 63
CRgn::CreatePolygonRgn, 339 CSplitterWnd::splitBorder, 63
CRgn::CreatePolyPolygonRgn, 339 CSplitterWnd::splitBox, 63
CRgn::CreateRectRgn, 339 CStatic, 239
CRgn::CreateRectRgnIndirect, 339 CStatic::SetIcon, 362
CRgn::CreateRoundRectRgn, 339 CStatusBar::SetPaneText, 160
CRgn::GetRegionData, 346 CString, 263, 428
CRgn::PtInRegion, 393 CString::Find, 252
CRichEditDoc, 415 CString::IsEmpty, 108
CRichEditDoc::m_bRTF, 416 CString::Left, 245
CRichEditView, 415 CString::Mid, 101
CRichEditView::GetCharFormat, 419 CString::ReverseFind, 252
CRichEditView::GetParaFormat, 419 CTabCtrl, 132
CRichEditView::OnCharBold, 419 CTabCtrl::GetCurSel, 133
CRichEditView::OnCharItalic, 419 CTabCtrl::InsertItem, 132
CRichEditView::OnCharUnderline, 419 CTabCtrl::SetImageList, 132
CRichEditView::OnParaCenter, 419 CTime, 415, 428
CRichEditView::OnParaLeft, 419 CTime::Format, 415, 428
CRichEditView::OnParaRight, 419 CTime::GetCurrentTime, 415
CRichEditView::OnUpdateCharBold, 419 CToolBar::CalcDynamicLayout, 19
CRichEditView::OnUpdateCharItalic, 419 CToolBar::GetItemRect, 18
CRichEditView::OnUpdateCharUnderline, 419 CToolBar::OnTimer, 162
CRichEditView::OnUpdateParaCenter, 419 CToolBar::SetBarStyle, 5
CRichEditView::OnUpdateParaLeft, 419 CToolBar::SetButtonInfo, 12, 17
CRichEditView::OnUpdateParaRight, 419 CToolBar::SetButtonStyle, 16
CRichEditView::SetCharFormat, 418 CTreeCtr::SetImageList, 115
CRichEditView::SetParaFormat, 418 CTreeCtrl, 115
CRuntimeClass, 58 CTreeCtrl::CreateDragImage, 122, 125
CScrollView, 242, 273 CTreeCtrl::DragEnter, 126
CScrollView::GetScrollPosition, 326 CTreeCtrl::GetChildItem, 433
CSingleDocTemplate, 381 CTreeCtrl::GetChileItem, 125
CSize, 239 CTreeCtrl::GetNextitem, 125
CSliderCtrl::GetPos, 97 CTreeCtrl::GetNextSiblingItem, 433
CSliderCtrl::SetLineSize, 96 CTreeCtrl::GetParentItem, 124
CSliderCtrl::SetPageSize, 96 CTreeCtrl::HitTest, 122, 125, 126, 432, 438
CSliderCtrl::SetRange, 96 CTreeCtrl::InsertItem, 116, 118, 423, 425
CSliderCtrl::SetRangeMax, 96 CTreeCtrl::ItemHasChildren, 433
CSliderCtrl::SetRangeMin, 96 CTreeCtrl::OnEndlabeledit, 120
CSliderCtrl::SetSelection, 97 CTreeCtrl::OnItemexpanding, 119
CSliderCtrl::SetTic, 96 CTreeCtrl::SelectDropTarget, 123, 126
CSliderCtrl::SetTicFreq, 96 CTreeCtrl::SetImageList, 117
CSpinButtonCtrl, 92 CTreeCtrl::SetItemImage, 120
CSpinButtonCtrl::SetBase, 92 CTreeCtrl::SetItemText, 121
CSpinButtonCtrl::SetBuddy, 91 CTreeView, 420
CSpinButtonCtrl::SetPos, 92 CTreeView::GetTreeCtrl, 423
CSpinButtonCtrl::SetRange, 92 CTRL key, 252
CSplitter::OnInvertTracker, 63 Cur, copy, paste, 261
CSplitterWnd, 56 Cursor shape, 253
CSplitterWnd::Create, 59 Curve, Error! Not a valid bookmark in entry on
CSplitterWnd::CreateStatic, 56, 57, 58 page 207
CSplitterWnd::CreateView, 58 CURVECAPS, 226
CSplitterWnd::DeleteColumn, 61 Custom raster operation code, 315
CSplitterWnd::DeleteRow, 61 Custom resource, 135
CSplitterWnd::GetColumnCount, 62 Cut, copy, paste, 259, 262, 349–53
CSplitterWnd::GetColumnInfo, 61 CView::OnDraw, 198
CSplitterWnd::GetRowCount, 62 CView::OnEndPrinting, 369
CSplitterWnd::GetRowInfo, 61 CView::OnPrepareDC, 371
CSplitterWnd::IdFromRowCol, 58 CView::OnPreparePrinting, 370
CSplitterWnd::OnDrawSplitter, 63 CView::OnPrint, 367, 369
Index

CView::OnUpdate, 264 CWnd::OnInitDialog, 241


CView::PreCreateWindw, 422 CWnd::OnKeyDown, 248
CWinApp, 27, 379 CWnd::OnNcActivate, 388
CWinApp::AddDocTemplate, 384 CWnd::OnNcPaint, 388
CWinApp::ExitInstance, 380 CWnd::OnNotify, 176
CWinApp::GetProfileInt, 394 CWnd::OnPaint, 239
CWinApp::GetProfileString, 394 CWnd::OnPaletteChanged, 353
CWinApp::InitInstance, 379, 383 CWnd::OnSetCursor, 255, 334
CWinApp::LoadCursor, 254 CWnd::OnSize, 25
CWinApp::LoadStandardCursor, 254, 332 CWnd::OnSysCommand, 48
CWinApp::m_nCmdShow, 396 CWnd::OnTimer, 225, 241
CWinApp::OpenDocumentFile, 416 CWnd::OnToolHitTest, 164
CwinApp::SetRegistryKey, 394 CWnd::OnToolTipNotify, 154
CWinApp::WinHelp, 472 CWnd::OpenClipboard, 260
CWinApp::WriteProfileInt, 394 CWnd::PostMessage, 85, 397
CWinApp::WriteProfileString, 394 CWnd::PreCreateWindow, 378
CWindowDC, 195, 389 CWnd::PreTranslateMessage, 105, 163
CWnd CWnd::ReleaseDC, 65
:, 112 CWnd::RepositionBars, 157
CWnd:: GetLastActivePopup, 379 CWnd::ScreenToClient, 122, 125, 151, 164, 255, 432
CWnd::Attach, 188 CWnd::SendMessage, 85, 397
CWnd::ClientToScreen, 39, 393 CWnd::SetCapture, 87, 127, 199
CWnd::Create, 17 CWnd::SetForegroundWindw, 380
CWnd::CreateCaret, 244 CWnd::SetMenu, 54
CWnd::CreateEx, 391 CWnd::SetTimer, 134
CWnd::CreateGrayCaret, 244 CWnd::SetWindowContextHelpId, 471
CWnd::CreateSolidCaret, 244, 248 CWnd::SetWindowPos, 144, 399
CWnd::Detach, 191 CWnd::SetWindowText, 94, 104
CWnd::DrawMenuBar, 44 CWnd::ShowCaret, 244, 248
CWnd::EnableToolTips, 153 CWnd::ShowWindow, 19, 138
CWnd::FindWindow, 379, 398 CWnd::SubclassDlgItem, 73
CWnd::GetClientRect, 26, 86, 130, 151 CWnd::SubclassWindow, 73, 110
CWnd::GetDC, 65, 195 CWnd::WindowFromPoint, 361
CWnd::GetDesktopWindw, 358 CWnd::wndBottom, 399
CWnd::GetDlgCtrlID, 85, 471 CWnd::wndNoTopMost, 399
CWnd::GetDlgItem, 25, 72 CWnd::wndTop, 399
CWnd::GetFocus, 106 CWnd::wndTopMost, 399
CWnd::GetMenu, 43
CWnd::GetNextWindow, 159
CWnd::GetParent, 85, 161
D
CWnd::GetSafeHwnd, 107, 140 Data segment, 401
CWnd::GetSystemMenu, 46 data_seg, 401
CWnd::GetTopLevelParent, 161 DC. See Device Context
CWnd::GetWindow, 106, 159, 471 DDB. See Device dependent bitmap
CWnd::GetWindowRect, 151, 389, 393 DDE. See Dynamic data exchange
CWnd::GetWindwoText, 80 DDE_FACK, 456
CWnd::HideCaret, 244, 248 DdeAccessData, 451, 456
CWnd::Invalidate, 88 DdeClientTransaction, 449, 453, 458, 460
CWnd::InvalidateRect, 264 DdeClientTransacton, 451
CWnd::IsIconic, 396 DdeCmpStringHandles, 446
CWnd::IsWindowVisible, 30, 140 DdeConnect, 445, 446
CWnd::IsZoomed, 396 DdeCreateDataHandle, 451, 455
CWnd::MapWindowPoints, 151 DdeCreateStringHandle, 442
CWnd::MoveWindow, 25, 26, 144, 393, 399 DdeDisconnect, 447
CWnd::OnChar, 250 DdeFreeDataHandle, 451, 456
CWnd::OnCtlColor, 148 DdeFreeStringHandle, 442
CWnd::OnDestroy, 101, 281 DdeGetData, 459
CWnd::OnDrawItem, 113 DdeInitialize, 441
CWnd::OnEraseBkgnd, 147, 311 DDEML. See Dynamic data exchange management
CWnd::OnGetMinMaxInfo, 145 library
CWnd::OnHelpInfo, 471
Index

DdeNameService, 442 DT_RASPRINTER, 226


DdePostAdvise, 453, 457 DWORD, 205
DdeUnaccessData, 451, 456 Dynamic data exchange, 441–63
DdeUninitialize, 442 Advise, 453
DECLARE_MESSAGE_MAP, 66, 84 Asynchronous transmission, 460
Delete DC, 304 Callback function, 442
Detach menu, 54 Confirm connection, 447
Device capability, 226–27 Data request, 449
Device context, 49, 194 Disconnection, 447
Chord, 209 Execute, 458
Color approximation, 213–16 Initialization, 441
Curve drawing, 204–7 Make connection, 445
Ellipse drawing, 204 Poke, 457
Flood fill, 212 Prepare data, 451
Obtain DC, 195 Receive data, 451
Rectangle drawing, 209 Registration, 441
Text dimension, 239 Server, 443
Device dependent bitmap, 272 Service name, 442
Device independent bitmap, 272 Service registration, 441
Format, 275 Synchronous transmission, 450
Device-space, 385 Topic name, 446
Dialog bar, 22–24 Uninitialization, 441
Add dialog bar, 22 Unregistration, 441
Dynamic layout, 26 Dynamic data exchange management library, 441
Find mainframe window, 27 Dynamic link library, 401
Resource, 23 Data segment, 401
Restrict docking, 24 Static variable, 401
Status bar, 155 Variable in DLL, 401
Toggle control bar, 30 Dynamic splitter window, 56, 59
Dialog box
Background, 147
Flyby, 155
E
Modal, 138 Edit view, 413–15
Modeless, 138 Cut, copy, paste, 413
Retrieve control ID, 155 Search, 414
Template ID, 138 Ellipse, 204
Title, 169 Embedded icon, 430
Tool bar, 155 Embossed effect, 312
Unit, 144 EmptyClipboard, 260
DIB. See Device independent bitmap Enable, disable command, 34
DIB drawing, 289 END key, 251
DIB file format, 282 END_MESSAGE_MAP, 7
DIB format, 275 ENTER key, 250
DIB Section, 305 Enumerate font, 235, 232–38
DIB_PAL_COLORS, 305 Enumerate font family, 233
DIB_RGB_COLORS, 305 EnumFontFamilies, 233
direct.h, 101 ES_READONLY, 444
Dithering, 214 ESCAPE key, 250
DLL. See Dynamic link library ETO_CLIPPED, 238, 240
dllexport, 402 ETO_OPAQUE, 238, 240
dllimport, 402 EVENTMSG, 405
DMLERR_NO_ERROR, 443 Exclude class from build, 382
Document/View structure, 381 EXTERN_C, 402
Dot drawing, 330 Extract color table, 297
Drawing bitmap, 49 Extract mask image, 305, 307
Drawing mode, 362 Extract palette, 275
DRAWITEMSTRUCT, 80, 112, 113
Drive, 421
DSTINVERT, 114 F
DT_PLOTTER, 226
DT_RASDISPLAY, 226 File dialog box, 165–78
Index

Add extra control, 176 Glyph, 232


Default file extension, 167 GMEM_FIXED, 260
Default file name, 167 GMEM_MOVEABLE, 260
Explorer-style, 168 GMEM_SHARE, 260
File extension filter, 166 GMEM_ZEROINIT, 260
File open dialog box, 165 GPF. See General protection fault
File save, 167 GPTR, 260
Help button, 168 Graphics Device Interface, 194
Multiple selection, 169 GRAY_BRUSH, 202
Old style, 168, 172 Grid, 323, 324
Read only check box, 168 GW_CHILD, 106, 159, 471
Retrieve file name, 166 GW_HWNDNEXT, 106, 471
Select directory, 171
Select folder, 171
User-designed template, 172
H
File enumerating, 424 Handle, 42, 259
File mapping, 409 Handle WM_COMMAND, 33
File mapping object, 409 HBITMAP, 72, 195, 281
File open dialog, 416 HBRUSH, 195
Finding window, 397 HCURSOR, 253
FindResource, 278 HDATA_APPOWNED, 451
First child window, 106 HDC, 195
Flood fill, 212 Help contents file, 465
FLOODFILLBORDER, 210 Help project file, 465
FLOODFILLSURFACE, 210 HELPINFO, 472
Flyby, 28 HFONT, 195
Font, 195, 229 HGLOBAL, 259
Enumerate, 232–38 Highlighted color, 315
Escapment, 230 HMENU, 42, 53
Face name, 185 HOLLOW_BTRUSH, 202
Orientation, 230 HOME key, 251
Font dialog box, 186 Hook, 400–405
Custom dialog template, 186 Installation, 400
Form view, 57, 150, 437–39 Journal playback, 405–8
Freeform selection, 348 Journal record, 405–8
FW_BOLD, 185 Keyboard hook procedure, 400
FW_NORMAL, 185 Mouse hook procedure, 400
System wide, 400
G Thread specific, 400
Hook procedure, 400
GDI, 79. See Graphics Device Interface HORZRES, 226, 367
General protection fault, 196 HORZSIZE, 226
GetClassName, 107 HPALETTE, 195
GetClipboardData, 261 HPEN, 195
GetCursorPos, 122, 125, 164, 255, 332 HRGN, 195
GetDIBits, 285, 289 Hszize, 444
GetDlgCtrlID, 155 HTREEITEM, 116
GetKeyState, 252
GetStockObject, 149, 201
GetSysColor, 315
I
GetSystemMetrics, 146, 390 IDC_ARROW, 254
GetWindowLong, 131, 422 IDC_CROSS, 254, 332
GHND, 260 IDC_IBEAM, 254, 332
Global memory, 259, 409 IDC_WAIT, 254
Lock, 259 IDR_MAINFRAME, 282, 387
GlobalAlloc, 259 ILC_COLOR, 115
GlobalFree, 259 ILC_COLOR4, 115
GlobalLock, 259 ILC_COLOR8, 115
GlobalReAlloc, 259 ILC_MASK, 115
GlobalUnlock, 259 Image list, 115, 421, 426
Index

Delete, 118 LV_COLUMN, 128, 427


Mask bitmap, 115 LV_FINDINFO, 435
IMalloc, 172 LV_ITEM, 128, 428, 429, 436
IMalloc::Free, 172 LVCF_FMT, 427
Initial states, 394 LVCF_TEXT, 427
INSERT key, 252 LVCF_WIDTH, 427
IsClipboardFormatAvailable, 262 LVCFMT_CENTER, 128
ITEMIDLIST, 171 LVCFMT_LEFT, 128
LVCFMT_RIGHT, 128
LVFI_PARAM, 435
L LVIF_IMAGE, 131, 436
Label editing LVN_COLUMNCLICK, 437
Disable, 121 LVS_ICON, 131
LB_ERR, 102 LVS_LIST, 131
LBN_DBLCLK, 100 LVS_REPORT, 131
LibMain, 402 LVS_SMALLICON, 131
Line, 196 LVS_TYPEMASK, 131
Line drawing, 330 LVSIL_NORMAL, 128, 427
List Box, 98 LVSIL_SMALL, 128, 427
Double clicking message, 100
Extended, 98 M
Fixed owner-draw style, 111
Multiple column, 98 Mainframe menu
Multiple style, 98 Access, 43
Owner-draw style, 98 Mainframe window
Set column width, 99 Access, 43
Single style, 98 Makehm, 470
Sort, 98 MAKEINTRESOURCE, 173
Variable owner-draw style, 111 MAKELPARAM, 85
List control, 127–32 Map registered message, 397
Add column, 128 MapViewOfFile, 409
Add sub-item, 128 MAX_PATH, 171
Change style, 131 Maximize button, 389
Image list, 129 MEASUREITEMSTRUCT, 51
List style, 127 Memory DC, 49, 273
Normal icon style, 127 Memory share, 408–11
Report style, 127 memset, 423
Share image list, 130 Menu
Small icon style, 127 Add menu resource, 36
List view Bitmap check, 44
Column, 427 Change menu item, 46
LM_HORZDOCK, 20, 26 Delete item, 42
LM_VERTDOCK, 20, 26 Get menu, 43
Load bitmap resource, 44 Get sub-menu, 38
Load resource, 278 handle, 42
LoadLibrary, 404 Insert and remove item, 41
LoadResource, 278 Load menu, 38
LocalAlloc, 260 Obtain handle, 42
LocalFree, 260 Owner-draw, 48–53
LocalLock, 260 Remove item, 42
LocalReAlloc, 260 Structure, 41
LocalUnlock, 260 Message mapping, 6–7
LockResource, 278 Add manually, 33
LOGFONT, 184, 229 MF_BYCOMMAND, 41
Logical palette, 216–20 MF_BYPOSITION, 39, 41
Logical unit and device unit, 366 MF_OWNERDRAW, 49
LOGPALETTE, 217 MF_SEPARATOR, 42
LOGPIXELSX, 367, 387 Microsoft Help Workshop, 465
LOGPIXELSY, 367, 387 Minimize button, 389
LPARAM, 6 MINMAXINFO, 145
Index

MK_LBUTTON, 259 ON_WM_SYSCOMMAND, 46


MM_ANISOTROPIC, 385 One instance application, 377–80
MM_HIENGLISH, 366 OpenFileMapping, 409
MM_HIMETRIC, 366 OPENFILENAME, 165, 172
MM_ISOTROPIC, 385 OR, 304, 314, 339
MM_LOENGLISH, 366 Owner-draw list box & combo box, 114
MM_LOMETRIC, 366
MM_TEXT, 366
MM_TWIPS, 366
P
Modal frame, 240 Page-space, 385
Modify resource ID, 13 Palette, 195, 216
Monochrome DIB, 282 Animation, 226
Monocrome DIB, 276 Background palette, 217
Mouse cursor position, 122 Change notice, 353
Move window, 393 Color mapping, 217
MSG, 105 Explicit mapping, 220
Multiple documents, 387 Foreground palette, 217
Multiple views, 383 Realize palette, 218
Select palette, 218
N Palette animation, 226
Palette device, 213
NM_CLICK, 431, 432 PALETTEENTRY, 217
NM_TREEVIEW, 119 PALETTEINDEX, 218, 328
NM_UPDOWN, 93 Pane, 56
NMHDR, 93, 176 PARAFORMAT, 418
Non-client area, 388 Paragraph formatting, 418
Non-palette device, 213 Path, 341–45
Non-system key, 106 Obtain path, 343
Normalize, 337 Path & Region, 342
Notepad, 415 Pattern brush, 212–13, 325
NULL_BRUSH, 202 Origin, 325
NUM LOCK key, 252 PC_EXPLICIT, 220
NUMRESERVED, 226 PC_NOCOLLAPSE, 220
PC_RESERVED, 220, 222
PD_NOPAGENUMS, 374
O PD_NOSELECTION, 374
ODS_DISABLED, 80 Pen, 195
ODS_FOCUS, 80 Create, 196
ODS_SELECTED, 80, 114 Dashed pen, 196
OFN_ALLOWMULTISELECT, 169 Dotted pen, 196
OFN_ENABLETEMPLATE, 172 Solid pen, 196
OFN_EXPLORER, 168 PFM_ALIGNMENT, 418
OFN_HIDEREADONLY, 168 Physical palette, 216
OFN_SHOWHELP, 168 POINT, 245, 326
OFNOTIFY, 176 POLYGONALCAPS, 226
OLE container, 415 POSITION, 169
OLE server, 415 Post message. See Send message
ON_COMMAND, 7, 33 Print dialog box, 374
ON_COMMAND_RANGE, 13 PRINTDLG, 374
ON_MESSAGE, 85 Printing, 365–75
ON_NOTIFY_EX, 155 Fixed scale, 369
ON_NOTIFY_REFLECT, 431, 437 Scale, 367
ON_RBUTTONDOWN, 37 Program manager, 462
ON_REGISTERED_MESSAGE, 397 Progress control, 134–36
ON_UPDATE_COMMAND_UI, 7, 9 Property sheet, 140
ON_UPDATE_COMMAND_UI_RANGE, 13 Modeless, 142
ON_WM_CAPTURECHANGED, 88 Tab mode, 142
ON_WM_LBUTTONDOWN, 66 Wizard mode, 142
ON_WM_MOUSEMOVE, 88 PS_DASH, 196
ON_WM_SIZE, 25 PS_DASHDOT, 196
Index

PS_DASHDOTDOT, 196 RGN_OR, 340


PS_DOT, 196 RGN_XOR, 340
PS_NULL, 196 RGNDATA, 346
PS_SOLID, 196 RGNDATAHEADER, 346
PT_BEZIERTO, 343 Rich edit document, 415
PT_CLOSEFIGURE, 343 Rich edit view, 415–19
PT_LINETO, 343 Right click menu, 36–41
PT_MOVETO, 343 Message mapping, 40
Push button, 8 Trap mouse event, 37
RUNTIME_CLASS, 58, 245, 384
R
S
R2_BLACK, 197
R2_COPYPEN, 197 Save As dialog box, 417
R2_MASKNOTPEN, 197 Screen resolution, 216
R2_MASKPEN, 197 Scroll bar, 242
R2_MASKPENNOT, 197 Scroll size, 273
R2_MERGENOTPEN, 197 Send message, 85
R2_MERGEPEN, 197 Serialization, 283
R2_MERGEPENNOT, 197 Set menu, 54
R2_NOP, 197 SetClipboardData, 260
R2_NOT, 197, 362 SetCursor, 253, 332
R2_NOTCOPYPEN, 197 SetDIBits, 289, 352
R2_NOTMASKPEN, 197 SetDIBitsToDevice, 289, 368
R2_NOTMERGEPEN, 197 SetSysColor, 315
R2_NOTXORPEN, 197 SetWindowLong, 133, 422
R2_WHITE, 197 SetWindowsHookEx, 400
R2_XORPEN, 197, 200 SetWindwoLong, 131
Radio button, 8 Shadowed color, 315
Raster code, 315 SHBrowseForFolder, 171
Raster device, 314 Shell icon, 430
Raster font, 232 SHFILEINFO, 430
Raster line, 295 SHGetFileInfo, 430
Raster operation mode, 314 SHGetMalloc, 172
RASTERCAPS, 226 SHGetPathFromIDList, 171
Ratio, 323 SHGFI_ICON, 430
RC_FLOODFILL, 226 SHGFI_LARGEICON, 430
RC_PALETTE, 226 SHGFI_SHELLICONSIZE, 430
RDH_RECTANGLES, 346 SHGFI_SMALLICON, 430
Read DIB file, 284 ShowWindow, 380
Rectangle, 201, 209 Sibling window, 106
Region, 195, 339–41 SIZEPALETTE, 226
Creation, 339 Slider, 95
Path & Region, 342 Line size, 96
Scale, 345 Message, 97
Select, 339 Non-linearly distributed tick marks, 96
Use, 339 Page size, 96
Register message, 397 Selection, 97
RegisterClipboardFormat, 261 Set tick marks automatically, 96
Registered icon, 430 Tick mark frequency, 96
RegisterWindowMessage, 397 SM_CXBORDER, 146
Registry, 394 SM_CXCURSOR, 146
ReleaseCapture, 87, 127, 199 SM_CXFULLSCREEN, 146
Resize window, 25 SM_CXICON, 146
Resource file, 182 SM_CXSMICON, 146
RGB, 64, 117 SM_CYBORDER, 146
RGBQUAD, 276 SM_CYCAPTION, 146
RGN_AND, 340 SM_CYCURSOR, 146
RGN_COPY, 340 SM_CYFULLSCREEN, 146
RGN_DIFF, 340 SM_CYICON, 146
Index

SM_CYSMICON, 146 TEXTCAPS, 226


Sort, 434 TEXTMETRIC, 247
Spin control, 90 TIMEOUT_ASYNC, 460
Alignment, 91 Timer, 134–35
Auto buddy, 90 Tool bar
Buddy control, 90 Combo box in tool bar, 17–19
Message UDN_DELTAPOS, 93 Create, 2–3
NM_UPDOWN, 93 Create resource, 3–4
Set base, 92 Default tool bar, 1
Set buddy integer, 91 Enable or disable a control, 9
Set initial position, 92 Enable tool tip, 28
Set range, 92 Fix size, 15
Spin control and edit box, 90 Layout modification, 19
Splitter window, 56 Message mapping, 3, 6
Layout, 61 Override CToolBar::CalcDynamicLayout, 19
Split bar, 60 Separator, 17
Split border, 63 Set or remove check, 9
Split box, 60 Set styles, 4
Split tracker, 63 Toggle control bar, 30
Standard cursors, 253 wrap, 16
Static colors, 214 Tool Tip, 28, 153
Static splitter window, 56 TOOLTIPTEXT, 154
Stock object, 149 TPM_LEFTALIGN, 39
StretchDIBits, 290, 368 TPM_RIGHTBUTTON, 39
Structure CREATESTRUCT, 378 Tracker, 333–37
Structure WNDCLASS, 377 Cursor shape, 334
CS_HREDRAW, 378 Move and resize, 334
CS_VREDRAW, 378 Normalize, 337
Subclass, 72, 109 Style, 333
SW_HIDE, 139 TRANSPARENT, 150
SW_MINIMIZE, 139 Tree control, 115–19
SW_SHOW, 19, 139 Add node, 116
SW_SHOWMAXIMIZED, 396 Dragging image, 122
SW_SHOWMINIMIZED, 396 Drag-n-drop, 122–27
SWP_NOMOVE, 399 Handle, 116
SWP_NOSIZE, 399 Label editing, 120
System button, 389 Lock, 122
System color, 315 Message handling, 119
System menu, 46 Window capture, 127
Message mapping, 47 True Type font, 232
Obtain, 46 TTN_NEEDTEXT, 153, 154
System metrics, 390 TV_DISPINFO, 121
System palette, 216 TV_INSERTSTRUCT, 116, 118, 423, 425, 427
TV_ITEM, 116
TVE_COLLAPSE, 120
T TVE_EXPAND, 120
TA_UPDATECP, 257 TVI_FIRST, 116
Tab control, 132–34 TVI_LAST, 116
TAB key, 250 TVI_SORT, 116
TBBS_BUTTON, 12 TVIF_CHILDREN, 116, 125
TBBS_CHECKBOX, 12 TVIF_HANDLE, 116, 125
TBBS_CHECKGROUP, 12 TVIF_IMAGE, 116, 125
TBBS_GROUP, 12 TVIF_PARAM, 116
TBBS_SEPARATOR, 12 TVIF_SELECTEDIMAGE, 116, 125
TBBS_WRAPPED, 16 TVIF_STATE, 116
TC_ITEM, 132 TVIF_TEXT, 116, 125
TCN_SELCHANGE, 132, 133 TVIFF_STATE, 125
TCN_SELCHANGING, 132 TVN_BEGINDRAG, 122, 125
Text alignment, 257 TVN_BEGINLABELEDIT, 121
Text editor, 413 TVN_ENDLABELEDIT, 120
TVN_ITEMEXPANDED, 119
Index

TVN_ITEMEXPANDING, 119, 432 WM_HSCROLL, 97


TVS_HASBUTTONS, 422, 424 WM_INITDIALOG, 188, 241
TVS_LINESATROOT, 422 WM_KEYDOWN, 106, 248, 406
WM_LBUTTONDOWN, 66, 196, 202, 334
WM_LBUTTONUP, 83, 122, 126, 196, 202
U WM_MEASUREITEM, 49, 111, 112
UDN_DELTAPOS, 93 WM_MESSAGE, 398
Unchecked state, 8 WM_MOUSEMOVE, 87, 122, 126, 196, 202, 393
UPDATE_COMMAND_UI, 8, 34, 414 WM_NCACTIVE, 388
UPDATE_COMMOND_UI, 32 WM_NCPAINT, 388
User-defined message, 84, 397 WM_NOTIFY, 176, 431
WM_PAINT, 239, 382
WM_PALETTECHANGED, 353
V WM_POPMESSAGESTRING, 156, 164
WM_RBUTTONDOWN, 37
Vector device, 314 WM_SETCURSOR, 254, 332, 333
Vector font, 232 WM_SETMESSAGESTRING, 156, 164
VERTRES, 226, 367 WM_SETTEXT, 388, 390
VERTSIZE, 226 WM_SIZE, 25, 151, 438
View port extents, 386 WM_SYSCOMMAND, 46, 388, 390
View port origin, 385 WM_TIMER, 134, 225, 241, 453
Virtual key, 248 WM_USER, 84
Virtue key code, 106 WM_VSCROLL, 97
VK_CONTROL, 252 WNDCLASS, 397
VK_END, 252 WPARAM, 6
VK_HOME, 252 WS_CHILD, 18
VK_LEFT, 248 WS_EX_TRANSPARENT, 391
VK_RETURN, 106 WS_VSCROLL, 18
VK_RIGHT, 248
VK_SHIFT, 252
X
W XOR, 196, 304, 314, 339
XOR operation, 65
WEP, 402 XTYP_ADVDATA, 453, 456
WH_JOURNALPLAYBACK, 405 XTYP_ADVREQ, 453
WH_JOURNALRECORD, 405 XTYP_ADVSTART, 453
WH_KEYBOARD, 401 XTYP_ADVSTOP, 453, 456
WH_MOUSE, 401 XTYP_CONNECT, 445
Window XTYP_CONNECT_CONFIRM, 447
Background, 147 XTYP_DISCONNECT, 447
Initial size, 144 XTYP_EXECUTE, 459
Maximized size, 144 XTYP_REQUEST, 453
Maximum tracking size, 144 XTYP_XACT_COMPLETE, 460
Minimum tracking size, 144 XTYPE_REQUEST, 449
Resizing, 150
Set capture, 199
Tracking size, 144 Z
Window class name, 106, 378
Window DC, 389 Z order
Window extents, 386 Rearrange, 90
Window origin, 385 Zoom in, 323
WM_CAPTURECHANGED, 87 Zoom out, 323
WM_CHAR, 109, 250 Z-order, 90, 399–400
WM_CLOSE, 444
WM_COMMAND, 6, 32, 414
WM_CTLCOLOR, 148
WM_DESTROY, 101, 118, 238, 242, 281
WM_DRAWITEM, 49, 68, 111, 113, 327
WM_ERASEBKGND, 147, 311, 391
WM_GETMINMAXINFO, 145

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy