BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?

VB Shell Programming Integrating Applications with the Windows Shell

By J.P. Hamilton
July 2000
Pages: 388
ISBN 10: 1-56592-670-6 | ISBN 13: 9781565926707
starstarstarstarstar (Average of 8 Customer Reviews)

This book is OUT OF PRINT, but is available on Safari Books Online.

Book description

Visual Basic Shell Programming ventures where none have gone before by showing how to develop shell extensions that more closely integrate an application with the Windows shell, while at the same time providing an advanced tutorial-style treatment of COM programming with Visual Basic. Each major type of shell extension gets attention, including customized context menu handlers, per instance icons, and customized property sheets.
Full Description

Visual Basic's outstanding set of resources for rapidly developing stand-alone applications doesn't include shell extensions for integrating those applications or their data files with the Windows shell. Typically, such extensions as customized context menu handlers, per instance icons (such as a data file icon that's based on the contents of the file), and customized property sheets are written in C++, and all of the available documentation focuses on using C++ for shell extensions. But even C++ programmers find the task rough going, given the woefully inadequate state of the documentation. Very few programmers know that writing shell extensions is not tied to a single language or development environment, and that Visual Basic is an excellent tool for creating shell extensions that more closely tie an application to the Windows shell. That, however, is precisely the focus of Visual Basic Shell Programming. It shows how to take advantage of shell services to develop shell extensions and it provides the basic documentation needed for accomplishing this. Each major type of shell extension gets attention, including:
  • Context menu handlers that can add items to the popup menu that appears when the user right clicks a file.
  • con handlers for displaying per instance icons that, like the standard Recycle Bin icon, vary depending on some condition
  • Property sheet pages, which appear when the user selects the Properties option from a file's context menu.
  • InfoTip handlers, which display tooltips, or "info" tips for a file object on a per instance basis.
In showing how to integrate applications with the Windows shell by building shell extensions, author J.P. Hamilton provides a concrete tutorial on COM programming with Visual Basic. And while developing their own shell extensions, readers get to learn advanced VB concepts and techniques such as:
  • Pointers. Since VB tends to hide pointers from the programmer, Hamilton shows how to take advantage of the undocumented VarPtr, StrPtr, and ObjPtr functions, as well as the Win32
  • RtlMoveMemory function.
  • Using class identifiers (CLSIDs) from Visual Basic.
  • VTable modification, which allows control of the HRESULT (or status code) returned by a call to a COM method.
Visual Basic Shell Programming ventures where none have gone before by giving readers both the know-how to develop shell extensions and an advanced treatment of COM programming with Visual Basic.
Post-purchase benefits:

Register your book | Submit Errata | Examples | Author's Articles


Browse within this book

Cover | Table of Contents | Index | Sample Chapter | Colophon

Book details

First Edition: July 2000
ISBN: 1-56592-670-6
Pages: 388
Average Customer Reviews: starstarstarstarstar (Based on 8 Reviews)


Featured customer reviews

Write a Review


Visual Basic Shell Programming Review,  February 26 2004
Rating: StarStarStarStarStar
Submitted by Haroeris Astrum   [Respond | View]

I should have written this review years ago. This book is largely for the VB programmer who can actually program but knows little about extending the windows shell. It shows you how to create useful objects such as band objects that may live inside internet explorer. The main of the example refer to Win98 / Win2000. However, when packaged as an msi file, the compiled code seems to be easily distributable on any 32 bit Microsoft operating system. The filespider project that he provide is rather useful and extensible. Here is a snapshot of my version: http://fof.daisyblossom.com/thisiswhatitlookslike.jpg ... The whole package is available here: http://fof.daisyblossom.com/archives/2004_02_22_dphilc_archive.html#107762687662807528


Visual Basic Shell Programming Review,  August 20 2001
Rating: StarStarStarStarStar
Submitted by Guy   [Respond | View]

Loads of detailed information. Just wish it would have been a little more linear in the way examples were introduced.

For anyone that gets stuck on the first example, context menus, and are using W2k and have at some point set the extension to OPENWITH with ALLWAYS enabled check and delete the value in "Application" for the ".RAD" in

KEY:HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.RAD

DWORD:Application

VALUE:NOTEPAD.EXE<<<<<<<DELETE THIS

Took some time and frustration to figure this one out. Now I am back to thinking the book is GOOD

Just remember that it was written pre W2k and give the author a break.;)




Visual Basic Shell Programming Review,  July 08 2001
Rating: StarStarStarStarStar
Submitted by Syd Shewchuk   [Respond | View]

Wow! I thought I was a pretty good VB programmer. I thought I had a good handle on COM and what it could do for me. This book has provided a whole new dimension to my programming language of choice.

The material is simply great, very absorbing. I became more and more fascinated as each page went by.

My only complaint is that the book ended. I certainly hope that J.P. Hamilton doesn't make this the last book on the topic of VB Shell programming. I, for one, would like to see more material of this quality.

Read all reviews


Visual Basic Shell Programming Review,  June 29 2001
Rating: StarStarStarStarStar
Submitted by Rodrigo Vieira   [Respond | View]

This book is very good.

I was looking for a way to build those fancy IE toolbands and was really disappointed with the Microsoft site, since all the reference about this subject there is on C++. Since those bands are COM objects, I was wondering whether someone had implemented it on VB already. Tried all the search engines and got nothing. Well this book is the only place (by now) where you'll find this information!

Programming the windows shell is a HUGE topic and certainly would require one of those "brick-sized" books to cover it properly. But J.P. Hamilton made a great effort on abridging the most "juicy" stuff, and then it's up to the programmer to develop on top of that information.

Some examples don't work on Windows 2000, but that's something I can understand since I guess most of the techniques shown on this book were developed before the Win2k release. Anyway, as the author states on the preface, this book is not intended for beginners or people who need to be guided on baby steps, but for programmers with some intermediate VB skills at least. This book is all about COM programming, so if you nothing about COM, this book may still be useful (there's a decent COM introduction on chapter 2), but I'd suggest you to play with COM first.

All in all, this is a "cover to cover" interesting book and that kind of book we should keep nearby for reference. Shell programming is a brave new world for VB programmers. I think there are lots of subjects which could be explored on a volume II.

Great job Mr. Hamilton.




Visual Basic Shell Programming Review,  February 24 2001
Rating: StarStarStarStarStar
Submitted by Dombeu Mozert   [Respond | View]

hmm...

a good work, mr. Halminton.

The book is excelent, I didn't have enough experience in COM programming, but I fully understood the book !!

For everyone reading me at the moment, don't losts the occasion to become one of the first vb-programmer using this book.

But I have a question:

Microsoft develop Visual Basic, ok. but why doesn't Microsoft include in VB all the interfaces, APIs, documentations for accessing fully Windows ???

I will never understand Microsoft !!!

Please if someone have an answer to that question, mail me at camernet@ifrance.com.

Tank you.


Visual Basic Shell Programming Review,  August 24 2000
Rating: StarStarStarStarStar
Submitted by R Pingleton   [Respond | View]

The O'Reilly staff has promptly corrected the source code that I questioned in my former review.

I have to say this book really is a definitive guide to shell programming and really does clarify the murky waters of the MS documentation.


Visual Basic Shell Programming Review,  August 14 2000
Rating: StarStarStarStarStar
Submitted by R. Pingleton   [Respond | View]

I was excited to see a book detailing practical COM applications using Visual Basic. The core material is solid, though the book could stand to go into a little more detail (373 pages is not quite enough, I feel.)

I think more explanation could have been given to the basics of COM, though the author himself admits this is not a book for beginners.

A major complaint is that certain important details (such as using regsvr32 to register the DLLs) aren't repeated more often. The reader shouldn't have to read the book cover to cover, just to be able to get an example to work.

Another big complaint I have is that the FileSpider program simply does not work the way it is. The code to traverse the DOM is there, but the code to actually download the files is simply not there. It simply displays message boxes telling you what you selected. This was a huge disappointment and seems to be indicative of a product rushed too quickly to market without adequate review.

Take note O'Reilly. Your books have no compare on the market in terms of depth, but that doesn't mean you can let your quality control slip. Simply providing examples that work the way the book says they do would have changed this review from a 3 to a 5.


Visual Basic Shell Programming Review,  August 14 2000
Rating: StarStarStarStarStar
Submitted by Matthew Leverton   [Respond | View]

In a nutshell, this book was exactly what I was looking for. Hamilton does a great job with this ever-so difficult topic. He starts out with a simple example based upon his imaginary file type, and builds upon it every chapter. In the end, you can easily see how the different aspects of the shell can work together.

Although I was well versed in VB before reading this book, I had virtually no experience with COM. This posed no problem, since Hamilton does an excellent job quickly covering the basics. That said, shell programming is still no walk in the park. But with a bit of determination, it is well within grasp - even for the VB programmer.

The book does suffer minorly from "first edition" bugs. The downloadable examples that go with the book did not work fully on my Windows 2000 machine. The drop handler crashed Explorer every time the ".RAD" file was right-clicked on. Also there were a few mistakes in the source code in the book, but nothing that couldn't be figured out. Also, a couple of the examples could have been a little more detailed, such as the Property Sheet section.

All in all, this is a great book that you will not regret reading.


Media reviews

"On closer inspection, this is a serious book that shows you how to do a variety of things with VB which you probably thought weren't possible." --Dave Jewell, PC Pro, July 2001

"Visual Basic Shell Programming from O'Reilly & Associates gathers all the required knowledge and presents it in a concise and focused manner that will have you integrating these features fairly quickly...if you're a developer looking to take the next step with your apps then this is the book for you." --Paul G. Brown, MCP Magazine, March 2001

"Even if integrating an application with the Windows shell is not your burning ambition, the book provides a unique insight into the workings of the registry and how interfaces fit into the shell scheme of things." --Major Kearny, PC Update, March 2001

"Filled with expert knowledge of the underlying Windows shell COM objects, Visual Basic Shell Programming is all that you need to write shell-enabled applications that look more professional, as well as rival the functionality of programs that are written in C++. Overall, this book helps explain a rather difficult topic in Windows programming, and makes accessible for the very first time this exciting area of functionality to experienced VB programmers. Read Visual Basic Shell Programming to create applications that both are more professional looking and take full advantage of every available feature in today's Windows desktop." --Richard Dragan, amazon.com Delivers Computer Programming, Nov 2000

" A definitive guide." --Paper Clips, Oct 2000

Hide extended reviews


See larger cover