Cover image for Windows 2000 programming from the ground up
Windows 2000 programming from the ground up
Schildt, Herbert.
Personal Author:
Publication Information:
Berkeley, Calif. : Osborne/McGraw-Hill, [2000]

Physical Description:
xviii, 782 pages : illustrations ; 24 cm
General Note:
Includes index.

Subject Term:
Format :


Call Number
Material Type
Home Location
Item Holds
QA76.76.W56 S35 2000 Adult Non-Fiction Central Closed Stacks

On Order



A repugnant Amercian widow is killed during a trip to Petra...

Among the towering red cliffs of Petra, like some monstrous swollen Buddha, sat the corpse of Mrs Boynton. A tiny puncture mark on her wrist was the only sign of the fatal injection that had killed her.

With only 24 hours available to solve the mystery, Hercule Poirot recalled a chance remark he'd overheard back in Jerusalem: 'You see, don't you, that she's got to be killed?' Mrs Boynton was, indeed, the most detestable woman he'd ever met...

Table of Contents

Prefacep. xv
For Further Studyp. xvii
1 Windows 2000 Overviewp. 1
What Is Windows 2000?p. 2
The Application Programming Interfacep. 3
Dynamic Link Libraries (DLLs)p. 4
Windows 2000 Supports Multithreaded Multitaskingp. 4
Multiple File Systemsp. 5
Challenging but Rewardingp. 6
2 Windows 2000 Programming Fundamentalsp. 7
Two Ways to Program for Windowsp. 8
Windows 2000 Programming Perspectivep. 9
The Desktop Modelp. 9
The Mousep. 10
Icons, Bitmaps, and Graphicsp. 10
Menus, Controls, and Dialog Boxesp. 10
The Components of a Windowp. 11
How Windows and Your Program Interactp. 11
Some Windows 2000 Application Basicsp. 12
WinMain()p. 12
The Window Procedurep. 13
Window Classesp. 14
The Message Loopp. 14
Windows Data Typesp. 14
A Windows 2000 Skeletonp. 15
Defining the Window Classp. 19
Creating a Windowp. 22
The Message Loopp. 24
The Window Functionp. 26
Definition File No Longer Neededp. 27
Naming Conventionsp. 28
3 Application Essentials: Messages and Basic I/Op. 31
Message Boxesp. 32
Understanding Windows 2000 Messagesp. 35
Responding to a Keypressp. 37
A Closer Look at Keyboard Messagesp. 41
More Keyboard Messagesp. 46
Outputting Text to a Windowp. 46
Device Contextsp. 52
Processing the WM_PAINT Messagep. 52
Generating a WM_PAINT Messagep. 58
Responding to Mouse Messagesp. 63
A Closer Look at Mouse Messagesp. 67
Using Button-Up Messagesp. 68
Responding to a Double Clickp. 68
More Messagesp. 73
4 Introducing Menusp. 75
Menu Basicsp. 76
Resourcesp. 77
Compiling RC Filesp. 77
Creating a Simple Menup. 77
Including a Menu in Your Programp. 81
Responding to Menu Selectionsp. 81
A Sample Menu Programp. 82
Adding Menu Accelerator Keysp. 86
Loading the Accelerator Tablep. 89
Translating Accelerator Keysp. 90
Trying Accelerator Keysp. 90
Non-Menu Accelerator Keysp. 92
Overriding the Class Menup. 96
An Example that Overrides the Class Menup. 97
More Menus to Comep. 103
5 Dialog Boxesp. 105
Dialog Boxes Use Controlsp. 106
Modal vs. Modeless Dialog Boxesp. 107
Receiving Dialog Box Messagesp. 107
Activating a Dialog Boxp. 108
Deactivating a Dialog Boxp. 109
Creating a Simple Dialog Boxp. 109
The Dialog Box Resource Filep. 109
The Dialog Box Window Functionp. 112
A First Dialog Box Sample Programp. 113
Adding a List Boxp. 118
List Box Basicsp. 119
Initializing the List Boxp. 121
Processing a Selectionp. 122
Adding an Edit Boxp. 124
The Entire Modal Dialog Box Programp. 127
Using a Modeless Dialog Boxp. 133
Creating a Modeless Dialog Boxp. 136
6 More Controlsp. 145
Scroll Barsp. 146
Activating the Standard Scroll Barsp. 146
Receiving Scroll Bar Messagesp. 146
SetScrollinfo() and GetScrollinfo()p. 148
Working with Scroll Barsp. 149
A Sample Scroll Bar Programp. 150
Using a Scroll Bar Controlp. 157
Creating a Scroll Bar Controlp. 157
Demonstrating a Scroll Bar Controlp. 158
Check Boxesp. 166
Obtaining the State of a Check Boxp. 167
Checking a Check Boxp. 167
Check Box Messagesp. 168
Radio Buttonsp. 169
Demonstrating Check Boxes, Radio Buttons, and Scroll Barsp. 170
Generating Timer Messagesp. 170
The Countdown Timer Resource and Header Filesp. 171
The Countdown Timer Programp. 173
A Closer Look at the Countdown Programp. 178
Static Controlsp. 180
7 Working with Bitmaps and Solving the Repaint Problemp. 185
Two Types of Bitmapsp. 186
Two Ways to Obtain a Bitmapp. 186
Using a Bitmap Resourcep. 187
Creating a Bitmap Resourcep. 187
Displaying a Bitmapp. 188
Deleting a Bitmapp. 191
The Complete Bitmap Example Programp. 192
Creating a Bitmap Dynamicallyp. 196
Using a Dynamically Created Bitmapp. 196
Solving the Repaint Problemp. 201
Some Additional API Functionsp. 202
Creating and Using a Virtual Windowp. 203
The Entire Virtual Window Demonstration Programp. 205
Improving Repaint Efficiencyp. 210
A Closer Look at BeginPaint()p. 211
Reducing Virtual Window Repaint Timep. 211
Creating a Custom Icon and Cursorp. 213
Defining Icons and Cursorsp. 213
Loading Your Icons and Cursorp. 216
A Sample Program that Demonstrates a Custom Icon and Cursorp. 216
Using Loadlmage()p. 219
8 Working with Textp. 221
Window Coordinatesp. 222
Setting the Text and Background Colorp. 223
Setting the Background Display Modep. 224
Obtaining the Text Metricsp. 224
Computing the Length of a Stringp. 227
A Short Text Demonstrationp. 228
Working with Fontsp. 233
Fonts, Families, Typefaces, and Stylesp. 233
Raster, Vector, and TrueType Fontsp. 234
Using Built-in Fontsp. 234
Creating Custom Fontsp. 242
Using CreateFontIndirect()p. 250
Rotating Textp. 251
Enumerating Fontsp. 255
A Font Enumeration Programp. 257
9 Using Graphicsp. 267
The Graphics Coordinate Systemp. 268
Pens and Brushesp. 268
Setting a Pixelp. 269
Drawing a Linep. 269
Setting the Current Locationp. 269
Drawing an Arcp. 270
Displaying Rectanglesp. 270
Drawing Ellipses and Pie Slicesp. 271
Working with Pensp. 272
Creating Custom Brushesp. 274
Deleting Custom Pens and Brushesp. 275
Setting the Output Modep. 275
A Graphics Demonstrationp. 277
A Closer Look at the Paint Programp. 286
Using World Transformsp. 289
Coordinate Spacesp. 289
SetWorldTransform()p. 290
Setting the Graphics Modep. 291
Adding Rotation to the Paint Programp. 292
A Closer Look at the Rotation Mechanismp. 302
Things to Tryp. 303
Mapping Modes and Viewportsp. 304
Setting the Mapping Modep. 304
Defining Window Extentsp. 305
Defining a Viewportp. 306
Setting the Viewport Originp. 307
A Viewport and Mapping Mode Demonstration Programp. 307
Experiment with the GDIp. 311
10 Introducing Common Controls and Common Dialog Boxesp. 313
The Common Controlsp. 314
Including and Initializing the Common Controlsp. 316
Common Controls Are Windowsp. 318
Using a Toolbarp. 318
Adding Tooltipsp. 322
Creating a Toolbar Bitmapp. 324
A Toolbar Sample Programp. 326
A Closer Look at the Toolbar Programp. 338
Introducing the Common Dialogsp. 339
GetOpenFileName() and GetSaveFileName()p. 342
A Short Word on Using Files in a Windows 2000 Programp. 347
11 More Common Controls: Up-Down Controls, Trackbars, and Progress Barsp. 349
Up-Down Controlsp. 350
Creating an Up-Down Controlp. 351
Receiving Up-Down Control Messagesp. 351
Sending Up-Down Control Messagesp. 352
Creating a Spin Controlp. 352
Using a Trackbarp. 353
Trackbar Stylesp. 354
Sending Trackbar Messagesp. 355
Processing Trackbar Notification Messagesp. 356
Using a Progress Barp. 357
Demonstrating a Spin Control, Trackbar, and Progress Barp. 359
Creating the Spin Control, Trackbar, and Progress Barp. 369
Managing the Spin Controlp. 371
Managing the Trackbarp. 371
Managing the Progress Barp. 373
Large Reward, Little Effortp. 374
12 Status Windows, Tab Controls, and the Tree-Viewsp. 377
Using a Status Windowp. 378
Creating a Status Windowp. 378
Status Window Messagesp. 379
Using a Status Barp. 380
Introducing Tab Controlsp. 390
Creating a Tab Controlp. 390
Sending Tab Control Messagesp. 392
Tab Notification Messagesp. 392
A Simple Tab Demonstration Programp. 394
Using Tab Controlsp. 398
Tree-View Controlsp. 409
Create a Tree-View Controlp. 410
Sending Tree-View Messagesp. 411
Tree-View Notification Messagesp. 415
A Tree-View Demonstration Programp. 416
13 Property Sheets and Wizardsp. 425
Property Sheet Basicsp. 426
Creating a Property Sheetp. 428
Defining a Property Sheet Pagep. 428
Initializing Each Pagep. 431
Initializing the PROPSHEETHEADER Structurep. 431
Creating the Property Sheet Controlp. 435
Processing Property Sheet Messagesp. 435
Sending Messages to the Property Sheetp. 436
Property Sheet Dialog Dimensionsp. 439
A Property Sheet Demonstration Programp. 439
Creating a Wizardp. 453
The Wizard 97 Specificationp. 453
Enabling Wizard Buttonsp. 456
A Wizard Demonstration Programp. 457
A Closer Look at the Wizard Examplep. 473
Worth the Effortp. 474
14 Using the Header and Month Calendar Controlsp. 475
Header Controlsp. 476
Creating a Header Controlp. 476
Sending Messages to a Header Controlp. 477
Sizing the Headerp. 482
Inserting Headings into the Header Controlp. 484
Displaying the Header Controlp. 485
Header Notification Messagesp. 485
A Simple Header Control Examplep. 486
A Closer Look at the First Header Control Examplep. 496
Enhancing the Header Controlp. 497
Creating Button Headersp. 497
Responding to Mouse Eventsp. 498
Using the HDN_TRACK Messagep. 498
An Enhanced Header Control Examplep. 498
A Closer Look at the Enhanced Header Control Programp. 508
Some Things to Tryp. 510
The Month Calendar Controlp. 510
Creating a Month Calendarp. 510
Sending Messages to a Month Calendarp. 510
Month Calendar Notification Messagesp. 512
Sizing the Month Calendar Controlp. 513
Demonstrating a Month Calendar Controlp. 514
Common Control Wrap-upp. 519
15 Thread-based Multitaskingp. 521
Creating a Multithreaded Programp. 522
Creating a Threadp. 523
Terminating a Threadp. 524
A Multithreaded Examplep. 524
A Closer Look at the Multithreaded Programp. 529
Alternatives to CreateThread() and ExitThread()p. 530
The Microsoft Alternativesp. 530
Using the Microsoft C/C++ Thread Functionsp. 532
Avoiding the C Library Functionsp. 536
Suspending and Resuming a Threadp. 536
Thread Prioritiesp. 537
Priority Classesp. 537
Thread Prioritiesp. 538
Creating a Thread Control Panelp. 539
A Thread Control Panel Programp. 540
A Closer Look at the Thread Control Panelp. 549
Synchronizationp. 554
Understanding the Synchronization Problemp. 556
Windows 2000 Synchronization Objectsp. 558
Using a Semaphore to Synchronize Threadsp. 559
A Closer Look at the Semaphore Programp. 565
Using an Event Objectp. 565
Using a Waitable Timerp. 567
Uses for Waitable Timersp. 575
Creating a Separate Taskp. 575
16 Using the Two Help Systemsp. 581
Two Styles of Helpp. 582
Context-Sensitive Versus Reference Helpp. 582
How the User Invokes Helpp. 584
Using the WinHelp Help Systemp. 585
The WinHelp Help Filep. 585
Creating a Help Filep. 586
The General Form of an RTF Help Filep. 586
Some RTF Commandsp. 586
A Sample WinHelp Help Filep. 591
Executing Help Using WinHelp()p. 598
Responding to WM_HELP and WM_CONTEXTMENU Messagesp. 600
WM_HELPp. 601
Including the? Buttonp. 603
A WinHelp Demonstration Programp. 603
A Closer Look at the WinHelp Demonstration Programp. 611
Using WinHelp Secondary Windowsp. 612
Using HTML Helpp. 613
HTML, not RTFp. 614
The HTML Help Workshopp. 614
HtmlHelp()p. 616
Demonstrating HtmlHelp()p. 620
Some Things to Tryp. 628
17 Using the Printerp. 629
Obtaining a Printer Device Contextp. 630
CreateDC()p. 630
PrintDlgEx()p. 631
The Printer Functionsp. 637
A Simple Printing Examplep. 639
A Closer Look at the First Printing Programp. 645
Printing Bitmapsp. 647
Determining Printer Raster Capabilitiesp. 647
Maintaining Perspectivep. 648
StretchBlt()p. 649
Obtaining Printer-Compatible DCsp. 650
A Bitmap Printing Demonstration Programp. 651
A Closer Look at the Bitmap Printing Programp. 660
Adding an Abort Functionp. 664
SetAbortProc()p. 664
The Cancel Printing Dialog Boxp. 666
A Complete Printing Examplep. 666
Some Things to Tryp. 678
18 Using the System Registry and Creating Screen Saversp. 679
Screen Saver Fundamentalsp. 680
The Screen Saver Functionsp. 681
Two Screen Saver Resourcesp. 682
Other Programming Considerationsp. 683
Creating a Minimal Screen Saverp. 684
A Closer Look at the First Screen Saverp. 686
Problems with the First Screen Saverp. 687
Understanding the System Registryp. 687
The Registry Structurep. 688
The Built-in Keysp. 689
Registry Valuesp. 691
Creating and Opening a Keyp. 692
Storing Valuesp. 694
Retrieving Valuesp. 695
Closing a Keyp. 695
Using REGEDITp. 697
Creating a Configurable Screen Saverp. 697
A Closer Look at the Configurable Screen Saverp. 702
Some Things to Tryp. 706
19 Supercharging Menusp. 709
Dynamic Menusp. 710
Adding an Item to a Menup. 710
Deleting a Menu Itemp. 714
Obtaining a Handle to a Menup. 714
Obtaining the Size of a Menup. 715
Enabling and Disabling a Menu Itemp. 715
Dynamically Adding Menu Itemsp. 716
A Closer Look at the First Dynamic Menu Programp. 722
Creating Dynamic Pop-up Menusp. 724
Using Floating Menusp. 731
Activating a Floating Menup. 731
Demonstrating Floating Menusp. 736
A Closer Look at the Floating Menu Programp. 743
Animating Pop-up Menusp. 745
Handling WM_MENURBUTTONUP Messagesp. 746
Some Things to Tryp. 747
20 DLLs and Securityp. 749
Creating DLLsp. 750
Dynamic Linking vs. Static Linkingp. 750
Why Create a DLL?p. 751
DLL Basicsp. 751
A Simple DLLp. 753
Creating A Header Filep. 754
Using the DLLp. 755
Using DllMain()p. 758
Adding a DllMain() to MYDLLp. 759
Demonstrating DllMain()p. 760
Securityp. 764
Defining Termsp. 767
How Security Worksp. 768
Some Security-Related API Functionsp. 769
What Next?p. 769
Indexp. 771