网站首页  软件下载  游戏下载  翻译软件  电子书下载  电影下载  电视剧下载  教程攻略

请输入您要查询的图书:

 

书名 Windows程序设计(第5版英文版上下)/微软技术系列/图灵程序设计丛书
分类 计算机-操作系统
作者 (美)佩佐尔
出版社 人民邮电出版社
下载
简介
编辑推荐

本书是Windows 程序设计方面不可替代的权威著作,由著名技术大师Charles Petzold 编写。书中涵盖了从基本输入输出、对话框、图形、内核、多线程、网络编程等Win32 程序设计的核心内容。

本书是各层次Windows 程序员的必备参考书。

目录

上册

Section I The Basics

Chapter 1 Getting Started 3

 The Windows Environment 4

  A History of Windows 4

  Aspects of Windows 6

  Dynamic Linking 8

 Windows Programming Options 9

  APIs and Memory Models 9

  Language Options 10

  The Programming Environment 11

  API Documentation 12

 Your First Windows Program 13

  A Character-Mode Model 13

  The Windows Equivalent 14

  The Header Files 15

  Program Entry Point 15

  The MessageBox Function 16

  Compile, Link, and Run 18

Chapter 2 An Introduction to Unicode 19

 A Brief History of Character Sets 20

  American Standards 20

  The World Beyond 21

  Extending ASCII 22

  Double-Byte Character Sets 24

  Unicode to the Rescue 25

 Wide Characters and C 26

  The char Data Type 26

  Wider Characters 27

  Wide-Character Library Functions 28

  Maintaining a Single Source 29

 Wide Characters and Windows 31

  Windows Header File Types 31

  The Windows Function Calls 33

  Windows?String Functions 34

  Using printf in Windows 34

  A Formatting Message Box 37

  Internationalization and This Book 38

Chapter 3 Windows and Messages 41

 A Window of One抯 Own 41

  An Architectural Overview 42

  The HELLOWIN Program 44

  Thinking Globally 47

  Registering the Window Class 51

  Creating the Window 57

  Displaying the Window 59

  The Message Loop 60

  The Window Procedure 62

  Processing the Messages 62

  Playing a Sound File 63

  The WM_PAINT Message 64

  The WM_DESTROY Message 66

 The Windows Programming Hurdles 66

  Don’t Call Me, I'll Call You 66

  Queued and Nonqueued Messages 68

  Get In and Out Fast 70

Chapter 4 An Exercise in Text Output 71

 Painting and Repainting 72

  The WM_PAINT Message 72

  Valid and Invalid Rectangles 74

 An Introduction to GDI 74

  The Device Context 75

  Getting a Device Context Handle: Method One 75

  The Paint Information Structure 77

  Getting a Device Context Handle: Method Two 79

  TextOut: The Details 80

  The System Font 82

  The Size of a Character 82

  Text Metrics: The Details 83

  Formatting Text 85

  Putting It All Together 86

  The SYSMETS1.C Window Procedure 94

  Not Enough Room 95

  The Size of the Client Area 95

 Scroll Bars 97

  Scroll Bar Range and Position 99

  Scroll Bar Messages 100

  Scrolling SYSMETS 102

  Structuring Your Program for Painting 107

 Building a Better Scroll 108

  The Scroll Bar Information Functions 108

  How Low Can You Scroll? 110

  The New SYSMETS 111

  But I Don’t Like to Use the Mouse 118

Chapter 5 Basic Drawing 121

 The Structure of GDI 121

  The GDI Philosophy 121

  The GDI Function Calls 123

  The GDI Primitives 124

  Other Stuff 125

 The Device Context 126

  Getting a Device Context Handle 126

  Getting Device Context Information 128

  The DEVCAPS1 Program 129

  The Size of the Device 133

  Finding Out About Color 138

  The Device Context Attributes 140

  Saving Device Contexts 142

 Drawing Dots and Lines 143

  Setting Pixels 143

  Straight Lines 144

  The Bounding Box Functions 149

  Bezier Splines 156

  Using Stock Pens 161

  Creating, Selecting, and Deleting Pens 162

  Filling in the Gaps 165

  Drawing Modes 166

 Drawing Filled Areas 168

  The Polygon Function and the Polygon-Filling Mode 169

  Brushing the Interior 174

 The GDI Mapping Mode 176

  Device Coordinates and Logical Coordinates 177

  The Device Coordinate Systems 178

  The Viewport and the Window 179

  Working with MM_TEXT 181

  The Metric Mapping Modes 183

  The “Roll Your Own” Mapping Modes 187

  The WHATSIZE Program 192

 Rectangles, Regions, and Clipping 196

  Working with Rectangles 196

  Random Rectangles 198

  Creating and Painting Regions 202

  Clipping with Rectangles and Regions 204

  The CLOVER Program 205

Chapter 6 The Keyboard 211

 Keyboard Basics 211

  Ignoring the Keyboard 212

  Who's Got the Focus? 212

  Queues and Synchronization 213

  Keystrokes and Characters 214

 Keystroke Messages 214

  System and Nonsystem Keystrokes 215

  Virtual Key Codes 216

  The lParam Information 219

  Shift States 221

  Using Keystroke Messages 222

  Enhancing SYSMETS for the Keyboard 223

 Character Messages 231

  The Four Character Messages 232

  Message Ordering 233

  Control Character Processing 234

  Dead-Character Messages 235

 Keyboard Messages and Character Sets 236

  The KEYVIEW1 Program 236

  The Foreign-Language Keyboard Problem 242

  Character Sets and Fonts 244

  What About Unicode? 255

  TrueType and Big Fonts 256

 The Caret (Not the Cursor) 263

  The Caret Functions 264

  The TYPER Program 265

Chapter 7 The Mouse 273

 Mouse Basics 274

  Some Quick Definitions 274

  The Plural of Mouse Is?275

 Client-Area Mouse Messages 276

  Simple Mouse Processing: An Example 277

  Processing Shift Keys 281

  Mouse Double-Clicks 283

 Nonclient-Area Mouse Messages 284

  The Hit-Test Message 285

  Messages Beget Messages 286

 Hit-Testing in Your Programs 287

  A Hypothetical Example 287

  A Sample Program 288

  Emulating the Mouse with the Keyboard 291

  Add a Keyboard Interface to CHECKER 293

  Using Child Windows for Hit-Testing 297

  Child Windows in CHECKER 297

  Child Windows and the Keyboard 303

 Capturing the Mouse 309

  Blocking Out a Rectangle 309

  The Capture Solution 313

  The BLOKOUT2 Program 314

 The Mouse Wheel 318

  Still to Come 326

Chapter 8 The Timer 327

 Timer Basics 328

  The System and the Timer 328

  Timer Messages Are Not Asynchronous 329

 Using the Timer: Three Methods 330

  Method One 330

  Method Two 334

  Method Three 337

 Using the Timer for a Clock 338

  Building a Digital Clock 338

  Getting the Current Time 343

  Displaying Digits and Colons 344

  Going International 344

  Building an Analog Clock 346

  Using the Timer for a Status Report 351

Chapter 9 Child Window Controls 357

 The Button Class 359

  Creating the Child Windows 363

  The Child Talks to Its Parent 365

  The Parent Talks to Its Child 366

  Push Buttons 367

  Check Boxes 368

  Radio Buttons 369

  Group Boxes 369

  Changing the Button Text 369

  Visible and Enabled Buttons 370

  Buttons and Input Focus 370

 Controls and Colors 371

  System Colors 372

  The Button Colors 373

  The WM_CTLCOLORBTN Message 374

  Owner-Draw Buttons 375

 The Static Class 382

 The Scroll Bar Class 383

  The COLORS1 Program 384

  The Automatic Keyboard Interface 392

  Window Subclassing 393

  Coloring the Background 393

  Coloring the Scroll Bars and Static Text 394

 The Edit Class 395

  The Edit Class Styles 398

  Edit Control Notification 399

  Using the Edit Controls 399

  Messages to an Edit Control 400

 The Listbox Class 401

  List Box Styles 401

  Putting Strings in the List Box 402

  Selecting and Extracting Entries 403

  Receiving Messages from List Boxes 404

  A Simple List Box Application 405

  Listing Files 409

  A head for Windows 411

Chapter 10 Menus and Other Resources 417

 Icons, Cursors, Strings, and Custom Resources 418

  Adding an Icon to a Program 418

  Getting a Handle on Icons 424

  Using Icons in Your Program 426

  Using Customized Cursors 427

  Character String Resources 428

  Custom Resources 430

 Menus 439

  Menu Concepts 440

  Menu Structure 440

  Defining the Menu 441

  Referencing the Menu in Your Program 441

  Menus and Messages 442

  A Sample Program 445

 Menu Etiquette 451

  Defining a Menu the Hard Way 452

  Floating Popup Menus 453

  Using the System Menu 459

  Changing the Menu 462

  Other Menu Commands 463

  An Unorthodox Approach to Menus 464

 Keyboard Accelerators 469

  Why You Should Use Keyboard Accelerators 469

  Some Rules on Assigning Accelerators 470

  The Accelerator Table 470

  Loading the Accelerator Table 471

  Translating the Keystrokes 471

  Receiving the Accelerator Messages 472

  POPPAD with a Menu and Accelerators 473

  Enabling Menu Items 480

  Processing the Menu Options 480

Chapter 11 Dialog Boxes 483

 Modal Dialog Boxes 484

  Creating an “About” Dialog Box 484

  The Dialog Box and Its Template 488

  The Dialog Box Procedure 491

  Invoking the Dialog Box 493

  Variations on a Theme 494

  A More Complex Dialog Box 497

  Working with Dialog Box Controls 505

  The OK and Cancel Buttons 507

  Avoiding Global Variables 509

  Tab Stops and Groups 510

  Painting on the Dialog Box 512

  Using Other Functions with Dialog Boxes 513

  Defining Your Own Controls 513

 Modeless Dialog Boxes 520

  Differences Between Modal and Modeless Dialog Boxes 521

  The New COLORS Program 523

  HEXCALC: Window or Dialog Box? 529

 The Common Dialog Boxes 538

  POPPAD Revisited 538

  Unicode File I/O 563

  Changing the Font 564

  Search and Replace 564

  The One-Function-Call Windows Program 565

Chapter 12 The Clipboard 567

 Simple Use of the Clipboard 568

  The Standard Clipboard Data Formats 568

  Memory Allocation 570

  Transferring Text to the Clipboard 572

  Getting Text from the Clipboard 573

  Opening and Closing the Clipboard 574

  The Clipboard and Unicode 575

 Beyond Simple Clipboard Use 581

  Using Multiple Data Items 581

  Delayed Rendering 583

  Private Data Formats 584

 Becoming a Clipboard Viewer 587

  The Clipboard Viewer Chain 587

  Clipboard Viewer Functions and Messages 587

  A Simple Clipboard Viewer 590

  

下册

Section II More Graphics

Chapter 13 Using the Printer 597

 Printing Fundamentals 598

  Printing and Spooling 598

  The Printer Device Context 602

  The Revised DEVCAPS Program 605

  The PrinterProperties Call 615

  Checking for BitBlt Capability 616

  The Simplest Printing Program 617

 Printing Graphics and Text 619

  Bare-Bones Printing 622

  Canceling Printing with an Abort Procedure 623

  How Windows Uses AbortProc 625

  Implementing an Abort Procedure 625

  Adding a Printing Dialog Box 628

  Adding Printing to POPPAD 633

Chapter 14 Bitmaps and Bitblts 641

 Bitmap Basics 641

  Where Do Bitmaps Come From? 642

 Bitmap Dimensions 643

  Color and Bitmaps 644

  Real-World Devices  644

  Bitmap Support in GDI 647

 The Bit-Block Transfer 648

  A Simple BitBlt 648

  Stretching the Bitmap 652

  The StretchBlt Mode 656

  The Raster Operations 657

  The Pattern Blt 659

 The GDI Bitmap Object 662

  Creating a DDB 662

  The Bitmap Bits 665

  The Memory Device Context 666

  Loading Bitmap Resources 667

  The Monochrome Bitmap Format 671

  Brushes from Bitmaps 674

  Drawing on Bitmaps 677

  The Shadow Bitmap 682

  Using Bitmaps in Menus 687

  Nonrectangular Bitmap Images 701

  Some Simple Animation 707

  Bitmaps Outside the Window 711

Chapter 15 The Device-Independent Bitmap 723

 The DIB File Format 724

  The OS/2-Style DIB 725

  Bottoms Up! 728

  The DIB Pixel Bits 728

  The Expanded Windows DIB 730

  Reality Check 733

  DIB Compression  734

  Color Masking 737

  The Version 4 Header 740

  The Version 5 Header 744

  Displaying DIB Information 746

 Displaying and Printing 755

  Digging into the DIB 755

  Pixel to Pixel 758

  The Topsy-Turvy World of DIBs 769

  Sequential Display 777

  Stretching to Fit 786

  Color Conversion, Palettes, and Performance 797

 The Union of DIBs and DDBs 799

  Creating a DDB from a DIB 799

  From DDB to DIB 808

  The DIB Section 808

  More DIB Section Differences 817

  The File-Mapping Option 818

  In Summary 820

Chapter 16 The Palette Manager 821

 Using Palettes 821

  Video Hardware 822

  Displaying Gray Shades 823

  The Palette Messages 831

  The Palette Index Approach 832

  Querying the Palette Support 836

  The System Palette 837

  Other Palette Functions 837

  The Raster-Op Problem 838

  Looking at the System Palette 839

 Palette Animation 850

  The Bouncing Ball 851

  One-Entry Palette Animation 859

  Engineering Applications 865

 Palettes and Real-World Images 870

  Palettes and Packed DIBs 870

  The All-Purpose Palette 883

  The Halftone Palette 890

  Indexing Palette Colors 896

  Palettes and Bitmap Objects 902

  Palettes and DIB Sections 909

 A Library for DIBs 915

  The DIBSTRUCT Structure 917

  The Information Functions 918

  Reading and Writing Pixels 927

  Creating and Converting 932

  The DIBHELP Header File and Macros 946

  The DIBBLE Program 949

  Simple Palettes; Optimized Palettes 975

  Converting Formats 991

Chapter 17 Text and Fonts 997

 Simple Text Output 997

  The Text Drawing Functions 997

  Device Context Attributes for Text 1000

  Using Stock Fonts 1002

 Background on Fonts 1002

  The Types of Fonts 1003

  TrueType Fonts 1004

  Attributes or Styles? 1005

  The Point Size 1005

  Leading and Spacing 1005

  The Logical Inch Problem 1006

 The Logical Font 1007

  Logical Font Creation and Selection 1007

  The PICKFONT Program 1009

  The Logical Font Structure 1026

  The Font-Mapping Algorithm 1030

  Finding Out About the Font 1031

  Character Sets and Unicode 1033

  The EZFONT System 1035  

  Font Rotation 1044

 Font Enumeration 1046

  The Enumeration Functions 1046

  The ChooseFont Dialog 1047

 Paragraph Formatting 1057

  Simple Text Formatting 1058

  Working with Paragraphs 1059

  Previewing Printer Output 1069

 The Fun and Fancy Stuff 1082

  The GDI Path 1082

  Extended Pens 1083

  Four Sample Programs 1088

Chapter 18 Metafiles 1097

 The Old Metafile Format 1098

  Simple Use of Memory Metafiles 1098

  Storing Metafiles on Disk 1101

  Old Metafiles and the Clipboard 1102

 Enhanced Metafiles 1107

  The Basic Procedure 1107

  Looking Inside 1111

  Metafiles and GDI Objects 1118

  Metafiles and Bitmaps 1123

  Enumerating the Metafile 1127

  Embedding Images 1135

  An Enhanced Metafile Viewer and Printer 1139

  Displaying Accurate Metafile Images 1150

  Scaling and Aspect Ratios 1161

  Mapping Modes in Metafiles 1163

  Mapping and Playing 1166

Section III Advanced Topics

Chapter 19 The Multiple-Document Interface 1173

 MDI Concepts 1173

  The Elements of MDI 1173

  MDI Support 1175

 A Sample MDI Implementation 1177

  Three Menus 1190

  Program Initialization 1191

  Creating the Children 1192

  More Frame Window Message Processing 1193

  The Child Document Windows 1194

  Cleaning Up 1196

Chapter 20 Multitasking and Multithreading 1197

 Modes of Multitasking 1198

  Multitasking Under DOS? 1198

  Nonpreemptive Multitasking 1198

  PM and the Serialized Message Queue 1200

  The Multithreading Solution 1200

  Multithreaded Architecture 1201

  Thread Hassles 1202

  The Windows Advantage 1202

  New! Improved! Now with Threads! 1203

 Windows Multithreading 1204

  Random Rectangles Revisited 1205

  The Programming Contest Problem 1208

  The Multithreaded Solution 1216

  Any Problems? 1226

  The Benefits of Sleep 1226

 Thread Synchronization 1227

  The Critical Section 1227

 Event Signaling 1229

  The BIGJOB1 Program 1230

  The Event Object 1235

 Thread Local Storage 1240

Chapter 21 Dynamic-Link Libraries 1243

 Library Basics 1243

 Library: One Word, Many Meanings 1244

 A Simple DLL 1245

 The Library Entry and Exit Point 1248

 The Test Program 1249

 Shared Memory in DLLs 1252

 The STRPROG Program 1258

 Sharing Data Among STRPROG Instances 1264

 Miscellaneous DLL Topics 1264

 Dynamic Linking Without Imports 1265

 Resource-Only Libraries 1266

Chapter 22 Sound and Music 1273

 Windows and Multimedia 1273

 Multimedia Hardware 1273

 An API Overview 1274

 Exploring MCI with TESTMCI 1275

 MCITEXT and CD Audio 1280

 Waveform Audio 1285

 Sound and Waveforms 1285

 Pulse Code Modulation 1286

 The Sampling Rate 1287

 The Sample Size 1287

 Generating Sine Waves in Software 1288

 A Digital Sound Recorder 1299

 The MCI Alternative 1312

 The MCI Command String Approach 1320

 The Waveform Audio File Format 1325

 Experimenting with Additive Synthesis 1326

 Waking Up to Waveform Audio 1336

 MIDI and Music 1345

 The Workings of MIDI 1345

 The Program Change 1347

 The MIDI Channel 1347

 MIDI Messages 1349

 An Introduction to MIDI Sequencing 1351

 Playing a MIDI Synthesizer from the PC Keyboard 1357 

 A MIDI Drum Machine 1375

 The Multimedia time Functions 1399

 RIFF File I/O 1402

Chapter 23 A Taste of the Internet 1405

 Windows Sockets 1405

 Sockets and TCP/IP 1406

 Network Time Services 1406

 The NETTIME Program 1407

 WinInet and FTP 1421

 Overview of the FTP API 1421

 The Update Demo 1423

Index 1437

随便看

 

霍普软件下载网电子书栏目提供海量电子书在线免费阅读及下载。

 

Copyright © 2002-2024 101bt.net All Rights Reserved
更新时间:2025/4/24 14:31:38