Aimed at aspiring C# programmers of all levels, legendary Windows expert Charles Petzold's Programming Windows with C#
provides an extremely in-depth and intelligent tutorial to the APIs underpinning Microsoft's .NET Framework.
For a generation of programmers, Petzold's Programming Windows: The Definitive Guide to the Win32 API provided a virtual bible on how to get started with Windows development. This massive, handsomely bound hardcover edition attempts the same breadth of coverage for Microsoft's new C# language and the new .NET. With several examples clearly inspired by the earlier C title, this book demonstrates the author's keen eye for showing off and explaining the capabilities of low-level APIs to good effect.
The book first outlines basic "Hello World" examples for both a console and Windows Forms. Next, there's coverage of basic support classes (like points and rectangles) before turning toward using these structures in extensive sections on graphics programming. Petzold's traditional strengths as a computer author are in ample evidence here, with many short examples that exercise the capabilities of the new .NET APIs.
Veteran readers will recognize the basic shape of the early Win32 title in the organization of this (completely rewritten) C# version in the flow of topics from graphics, keyboard, mouse and timers, and the like. (One production note here is that the order of later chapters does jump around somewhat, circling back to graphics topics several times instead of presenting related APIs in order.)
The sections on graphics transforms and how to manipulate images are worthy of note. There's excellent coverage of the possibilities of working with text and fonts output in .NET. Nifty working samples for several types of clocks and shape-drawing demos will let you explore graphical APIs in detail.
Several chapters cover basic Windows Forms control programming with buttons, labels, and edit controls and then splitters, ListView, and TreeView controls. This volume closes out with references to files and streams, and math and string APIs. For any developer who wants to create state-of-the-art, "traditional" client-side software, this book is sure to be required reading for its in-depth look at graphics and other leading-edge .NET features. It proves once again that learning low-level APIs in detail is still a good way to learn Windows programming. --Richard Dragan
Topics covered: Overview of C# and .NET Windows programming fundamentals; a "Hello World" console application; C# language and object basics; a simple Windows Forms application (creating a main window and handling the paint events); basic .NET structures (including rectangles, points, and colors); text output and scrolling; exploring .NET system information; in-depth tutorial for GDI+ programming: pens, lines, rectangles, and polygons; keyboard processing (plus a custom class for caret processing); graphics transformations (including scaling, linear transforms with matrices); mouse processing (plus processing the mouse wheel); text and fonts (TrueType and OpenType fonts, antialiasing, measuring text); using timers; date and time APIs; a sample code for clocks; drawing and transforming images (displaying JPG and BMP files); simple animation; basic control programming (buttons, labels, scroll bars, and track bars); exploring Bezier curves and splines; menus (basic and custom); graphics paths and regions; clipping techniques; basic dialog box programming (modal and modeless forms); edit, list, and spin controls; font transforms and special effects, using toolbars and status bars, printing techniques (including print dialogs), splitter, TreeView, and ListView controls; programming with the clipboard, drag-and-drop support, reference sections on APIs for programming with files and streams, math functions, and strings.