Book ReviewDan Appleman's Visual Basic Programmer's Guide to the Win32 API
By Robert Gelb

Buy it now at Amazon!

If there is one book, any serious VBer needs it is this one.  It should be on the desk of anyone who does more than call SQL all day long.  This is not the first edition of the book - there was one for Win16.  Those who read the Win16 edition will find this one similarly useful.  We all know that the moment you want to push VB beyond its limits, it chokes horribly.  For instance, how do you do multi-colored list box, or at least a multi-columned one.  Well, using VB alone you can't.  Enter Win32 API.  Dan Appleman takes his time to explain in the first few chapters the basics of how Windows works, what makes it tick, crash and burn, how the messaging works and other API basics.  Even though I knew most of the basic material, it was still entertaining to read it because of Appleman's irreverant style.  In the later chapters, the book gets into traditionally complicated subjects such as graphics manipulation, printing, etc...  In addition, the author provides reference on many (thousands) Win32 API functions, messages and data types.  Not that you cannot look it up on the MSDN CD, but Appleman goes one step further and points out any issues that may come up as a result of using those functions with VB.  In addition, the code on the included CD-ROM is the mirror image of what is explained in the book and a bit more.  After reading the book, I found that over the years I used it in the following situations:

  • When I want to do something that is part of the control, but is not exposed by VB.  For instance, Windows provides a way to make the textbox accept numeric values only, however, this functionality is not exposed thru VB.  I found the message I needed to send to the OS in the book.
  • When there is a bug in the intrinsic VB control and the only way around it is to do SendMessage to fix the bug.  Happened several times with various controls over the years
  • When I want to do something that I have no idea how to do.  I look to the book first to see if there is a related topic.  For instance, I wanted to do some fancy printing and the book had exactly what I needed.

My only problem with the book is Appleman's continued use of his C DLL to perform various memory and other operations, that are difficult to do in VB.  I understand that it is difficult, but there have been many examples on the Web on how to use CopyMemory and other similar APIs.  Particularly now that we have AddressOf operator in VB, there is no excuse for using external C DLLs.  This will most likely be fixed in the next edition of the book (Win64 ???), should there ever be one. 

Regardless of the caveats, the book is a great reference to both advanced VB programmers and newbies that are looking to make a career out of it.  I give it 4 and a half fingers up .

 


Want more reviews and sample chapters? Click here.