Shell Explorer's Cookbook — Subject Index

Here's a list of topics covered in this document, for quick reference. People in a real hurry could just use their browser's "Find in page" command to locate a keyword they are interested in. Except for the topic itself, the list offers some clue as to what to expect when you jump to the main document:

LegendTopic content
INFO General discussion and links to other important sources of information
CODE Sample source code solving a particular problem, followed by explanation
HOWTO Directions for tackling specific problems, mostly comprehensive but without any source code

IMPORTANT: sample code omits normal error-correction code. This code has been removed only to make the code more readable. You should include all appropriate error-correction code in your own applications.

Component Object Model (COM) basics
INFO I don't know the first thing about COM
INFO Unique object identifiers: CLSID, GUID etc.
CODE How do I use COM objects?
HOWTO Manage an object using IUnknown
HOWTO Figure out HRESULTS, the error codes returned by COM
INFO Class factories and suicidal COM objects
INFO Overview of shell COM objects
INFO IID_xxx constants for easy identification of shell COM objects
Fundamental Shell Concepts
INFO What is the shell's namespace?
INFO Shell file types, associations and verbs
INFO Special registry keys controlling the behaviour of shell folders
INFO What on earth is a PIDL?
CODE Count the number of "tokens" within a PIDL
HOWTO Convert a PIDL to a path and other similar tricks
HOWTO Cope with DLL hell, all these various shell versions
INFO What is a virtual folder?
HOWTO Get the location of various important or system folders
HOWTO Launch applications with ShellExecute and verbs
INFO Some less known yet useful standard verbs
HOWTO Launch an internet browser or send emails using ShellExecute
CODE Launch an application and wait for it to terminate
INFO Pitfalls in launching from background threads
Exploring the Filesystem Portion of the Namespace
CODE Read the contents of a filesystem folder using FindFirstFile et al.
CODE Huge file sizes: 64-bit integers explained
CODE Recursively read into a whole directory subtree
INFO Advantages of FindFirstFile over shell COM
HOWTO Wildcard (pattern) matching for filtering filenames
INFO Receiving notifications when the contents of some folder change
INFO Which notifications are triggered for certain kinds of events
CODE Coping with the problem of multiple notifications per event
HOWTO Monitor a complete subtree, even a whole drive, for changes
INFO Differences in notifications between win9x and NT
INFO Problems obtaining notification from network drives
Exploring the Complete Shell Namespace
HOWTO Parsing pathnames for PIDLs
HOWTO Parse relative MS/DOS paths that shell doesn't want to know
CODE Read the contents of a filesystem folder the COM way
HOWTO Manage COM objects and memory allocated for you by the shell
INFO I've never heard about UNICODE in my life
INFO Protect your address space from Mr. Buffalo Bill
INFO Excuse me Mr. COM, where is that creation date of mine?
INFO Interpreting the file information held in a PIDL
CODE Challenges in exploring namespace extensions
CODE Basic exploration of a virtual folder
INFO I asked for a display name but all I got was this STRRET thingy
HOWTO Tell the difference between a folder and a plain item the virtual way
INFO The twilight zone: semi-virtual folders like "Fonts"
INFO Customizing folders using that "desktop.ini" file
Managing File Operations
CODE Copy some files using SHFileOperation API
HOWTO Avoid headaches when working with double-null series of strings
INFO Things you need to know when using SHFileOperation
INFO Supply undo information which shell won't let you use
HOWTO Delete files directly or send them to the Recycle Bin
HOWTO Get rid of those annoying confirmation dialogs
INFO Connected HTML files — U wot?
INFO Of all things moniker and shell links
HOWTO Figure out whether a file is a shortcut or not
CODE Resolve a shortcut and get info for the linked target file
HOWTO Extend "file" management in virtual folders
Obtaining information for shell objects
CODE Obtain an icon for a file or folder
HOWTO Optimize icon extraction using SHGFI_USEFILEATTRIBUTES
HOWTO Obtain access to the system image list
HOWTO Extract icons within virtual folders
INFO COM interface alternatives to SHGetFileInfo
INFO Standard icon offsets in system image list
INFO Working with icon overlays for links and shared items
INFO Security measures in winNT cause problems with standard overlays
CODE Workaround for valid image lists, applicable to all win32 platforms
HOWTO Use Developer Studio to "nick" resources from other programs
HOWTO Take advantage of infotip improvements in windows 2000
HOWTO Show file comments and other properties in an infotip
INFO Thumbnail previews for images, HTML and Office documents
CODE Thumbnail extraction sample
INFO Asynchronous image extraction in threads
Shell context menu support
INFO How does explorer fill the context menu for each file type
INFO Static, extended and dynamic verbs
INFO Hard-coded commands vs. context menu extension handlers
INFO No less than 3 different context menu interface versions
CODE Obtain the highest possible IContextMenuxx pointer
HOWTO Fill in the menu & isolate shell command IDs to a convenient range
HOWTO Execute commands given either verbs or command IDs
CODE Execute the command selected from the menu
HOWTO Figure out the correct command to execute, given the menu item ID
HOWTO Handle the irregularities of "rename" command verbs
INFO Alternative ways of file management using shell context menu
INFO Complications surrounding the "Send To" submenu
CODE Complete context menu sample, mixing shell commands with your own
HOWTO Temporarily subclass your window providing access to the shell context menu handlers
INFO That context menu cowboy shot my stack in the head
Data objects and the clipboard
CODE Put some text in the clipboard, the traditional way
INFO Clipboard standard and registered formats
INFO My clipboard is not responding, what's wrong?
CODE Read text from the clipboard, the traditional way
INFO The new generation OLE clipboard
INFO The same data stored in various formats in a single data object
CODE Enumerate all the formats contained in a data object
INFO On FORMATETC, the generalisation of clipboard format identifiers
CODE Read text from the clipboard, the OLE way
INFO On STGMEDIUM, the generalisation of global memory handles
INFO Various STGMEDIUM cleanup procedures
CODE Read text in an IStream instead of global memory
CODE Minimal implementation of IDataObject interface
HOWTO Create a pseudo-COM object to be used on the stack
CODE Set text in the clipboard using IDataObject and OLE API
INFO Proxy data objects used by the clipboard
Shell data objects, clipboard and drag-drop
INFO Typical shell data object clipboard formats
INFO Managing various formats in shell data objects
INFO Auxiliary formats fine-tuning the target file operation
INFO Data change notification support in shell objects
HOWTO Place shell data in the clipboard with minimum effort using IContextMenu
HOWTO Differentiate between cut and copy operations
HOWTO Figure out whether some edit-style menu command is available
CODE Read filesystem items placed in the clipboard (CF_HDROP)
INFO Proxy data objects make a mess out of supported formats
INFO Drag-drop fundamentals: copy & paste in one stroke
INFO Registering windows as potential drop targets
HOWTO Implement a source data object for free using GetUIObjectOf
CODE Add any auxiliary format to a shell data object
INFO Standard keyboard modifiers controlling the drop operation
CODE Outline of drag initiation actions for data sources
HOWTO Devise a simple IDropTarget interface for shell items
CODE Complete drop target dialog-based application
HOWTO Delegate drop target notifications to the shell
INFO Two possible avenues for drag-drop termination
INFO Handling data transfer scenarios: info you can do without
INFO Proxy objects strike back, even for drag-drop



Contents