Microsoft .NET - Architecting Applications for the Enterprise
by Dino Esposito; Andrea Saltarello
Microsoft® Visual Basic® 2008 Step by Step
by Michael Halvorson
Microsoft® WSH and VBScript Programming for the Absolute Beginner, Third Edition
by Jerry Lee Ford Jr.
Mastering Microsoft® Visual Basic® 2008
by Evangelos Petroutsos
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.
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.
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: 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.
Average Amazon.com® Rating: ![]()
![]()
![]()
![]()
Based on 8 Ratings
Good Introduction to Shell Programming in VB - 2001-06-11
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
First off, if all what you want to do is to add an icon to the systray, go find _any_ Win32 API book or even search on the web. This book does not cover simple tricks like this. But if you want to write your own namespace extensions or property sheet handlers, read on.
Many people think VB and windows shell programming don't mix very well. Honestly, I was one of them. But after reading this great introduction, I figured I was wrong. Well, mostly wrong.
There are two issues that make shell programming hard in VB:
(1) As in most "advanced VB programming tasks", the first realization must be you _can't_ do it in pure VB. You need to import Win32 APIs and then fake you are writing your program in C. But that's a very old and well-solved problem, and in fact this book assumes you know how to do it: it shows the import statements without explaining how to get them. But that's fine, for I think most advanced VB programmers have already picked up this old trick.
(2) The windows shell is built heavily on COM, so must be the shell extensions. But this book is not about writing COM servers in VB... Apparently the author did not expect the readers to know COM before, so he offered a short chapter on COM basics that I find too short to be sufficient for the purpose of this book. For example, later on he started using jargons like "in-process COM servers" and "apartment threaded" (these are COM jargons) without explaining what they are. I tried to look up these terms in the index to quote the page number. They are absent---yet another proof of insufficient coverage of COM. I admit that shell extensions are in-process COM servers and so in most cases the readers are not expected to do anything else anyway, but this kind of treatment much weakens a reader's understanding of what he/she is doing.
And there are other problems that plague this almost excellent book:
(1) There is no separate treatment of what should the programmer do when a new shell extension comes out. As an example, icon overlay is not covered in this book. I think this is really the major reason I have to take half a star off: this book is more like "how I wrote those shell extensions" rather than "how you can write your own ones". For example, it does show many examples of how to turn a given IDL into more VB friendly, but not how can the programmer obtain the IDL of an interface that's not covered in the book. (OLE View won't answer all such prayers. Go check the platform SDK or, _cough_, wait for the second edition of the book to have a new chapter on that extension. :P)
(2) There is no coverage of debugging shell extensions. It's not as easy as one may expect, especially as VB will automatically re-register your COM servers when you execute your code while Explorer loads some registry entries only once...
Overall, this is a more than decent introduction to shell programming using VB. If you want to do some typical shell programming like having your own property sheet or namespace extensions, then this book is really good for the job and is worth every single penny. I would rather say it's 4.5 star, but I have to round down for the minor problems I mentioned.
Awsome Book !! - 2001-02-10
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
A must read for those who like to push VB beyond the limits, previously viewed as 'impossible to do in VB'. Very well organized and lots of examples.
Excellent reference material and a worthly investment.
Lot's of info, many mistakes - 2004-11-07
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
I have a love hate relationship with this book. There are a lot of useful techniques spelled out in the book, unfortunately there are serious bugs in the demo code. I have been able to fix a few of them, but am still working on others. Maybe this was on purpose to get the reader to truly understand the code rather than blindly copy it.
Overall good, but some sample codes crash in Win2K ... - 2002-04-27
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
I particularly like the Shell Extension part which is very
useful to understand somthing more advanced in Windows Shell.
However, what disappoints me is that I found the sample codes from
Chap 11 (Both sample projects DemoSpace and RegSpace) crash in
machines running Win2K. This means that if you want to use the
techniques taught from the book to implement a Shell Extension
by VB, you can only support platforms below Win2K. That will not
be much useful at all.
As far as I know, the author has not yet figured a solution
(through private communications with Orielly's book support).
Not neccessary but fun to read - 2001-01-30
Reviewer Rating: ![]()
![]()
![]()
![]()
![]()
Visual Basic and Shell Extension? I thought it should be Visual C++'s territory. The book proves Visual Basic can do anything as Visual C++ can. It might take more works to finish the same task compared to Visual C++ but the experience is simply rewarding and fun.
Some information on this page was provided using data from Amazon.com®. View at Amazon >