[VB6] Modern Shell Interface Type Library - oleexp.tlb
OLEEXP : Modern Shell Interfaces
Current Version: 6.8 (Released 06 November 2025)
Go to: Download | Changelog
MAINTENANCE MODE: oleexp will no longer receive feature updates, only bug fixes, as I've moved to twinBASIC, the backwards compatible true successor to VB6. There, oleexp is superseded by my Windows Development Library for twinBASIC (WinDevLib) project, which contains 100% of oleexp plus 15,000+ APIs and additional interfaces, all with x64 support.
About Project
oleexp.tlb is a type library containing a vast collection of Windows COM interfaces, forking an older project in order to bring in the expansive set of new stuff introduced in Windows Vista through 11. It also includes virtually all structures, types, and enums used by these interfaces, and a limited set of related APIs. While some of the interfaces may be present in system libraries, these, and the original versions for everything from the SDK, often use variable types that are incompatible with VB5/6; all interfaces have been reviewed and modified to use variable types that ensure compatibility with VB5 and VB6.
History
oleexp is based on Edanmo's olelib, forked and expanded. It's a very strong foundation for any desktop application.
Back in the day, E. Morcillo released the very comprehensive interface library olelib.tlb (Edanmo's OLE interfaces & functions). It contained a massive number of interfaces, enums, structs, etc. But after a point it was no longer updated and thus doesn't have any interfaces from Windows Vista or Windows 7. So I set out to bring these interfaces to VB, and quickly realized that so much would have to be duplicated and would then be conflicting, that the only sensible way to approach this would be to fork and expand olelib, particularly since anyone using oleexp would almost certainly be using olelib.
This project is completely free to use and modify as you see fit, for any purpose, including commercial. All that's requested is an acknowledgement and if you're distributing a modified version publicly, to change the project GUID to avoid conflicts, found in oleexp.odl.
Requirements and Installation / Setup
Requirements
oleexp can be used with any version of Windows. If you attempt to call an interface/API that is not present on the current OS version, an error will occur, but the presence of those definitions in the library do not effect the usage of any other interfaces/APIs.
No other files are required. You do not need to add oleexpimp or mimelib unless you specifically want to use them. All of the addon modules are optional, but mIID is strongly recommended; it saves a ton of time by allowing direct IID_ / FOLDERID_ / etc usage without having to convert a string to a GUID.
Installing oleexp
oleexp.tlb (and oleexmpimp.tlb/mimelib.tlb if you're using them) should be placed in a common folder all projects can access-- typically SysWow64 (or System32 on a 32-bit Windows install). You can register it manually, but I've never had trouble with the registration VB6 performs when you add it for the first time. IMPORTANT: oleexp is a common file, and you should only have one copy installed. Do not place multiple copies in the folders of projects that use it. Also, it's a direct replacement for olelib; a project should not have both.
The add-on modules are updated too, so those and any other files you're keeping, should go in a common directory for your VB projects, not the system folder. E.g. all the sample projects point at ..\tl_ole by default, so if you keep your projects in C:\vb\Prj1 Prj2 etc, a good spot would be C:\vb\tl_ole.
Setting up oleexp in your project VB6
oleexp.tlb is added via Project->References. As with any typelib, a sample project may reference a different location, if so, update the location if the References window says it's 'MISSING:' twinBASIC
It is strongly recommended you switch to WinDevLib, since oleexp cannot support x64 and has far less content. However, you can use oleexp in tB. It's added via References->Available COM References. After that, check the Enabled Libraries tab: if the Library Symbol is oleexpCtl, change it to oleexp, and scroll all the way to the right and uncheck the "Use ActiveX Controls" column.
NOTE: Like all TLBs, oleexp is a dependency only for the IDE. Once your project is compiled, the TLB is no longer used. It does not need to be present on end user machines. See the 'File Size' section in post #2 for additional details.
[VB6/Win7+] Using the Windows UI Ribbon Framework - Take advantage of the fancy Ribbon seen in Explorer, Wordpad, and Paint (and very similar to Office) in your app. Brings the basic version of my twinBASIC series to VB6. IUIRibbonFramework, IUIApplication, IUISimplePropertySet, IUICommandHandler
UPDATED 18 Jun 2022[VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive features - A highly customizable UserControl for browsing the file system with all the modern shell features; customize from a simple Directory List / FileList control in VB through a full-fledged Explorer-like window, and everything in between. First use: IColumnManager, ICategoryProvider, ICategorizer, IPropertyStoreCapabilities, IPropertyEnumType, IPropertyEnumTypeList; dozens of others previously demonstrated.
[VB6, Vista+] Core Audio - Peak Meter - Check whether or not audio is playing on the default rendering device, and display the most recent peak volume level in a meter. IAudioMeterInfo, IMMDevice, IMMDeviceEnumerator
[VB6] Intro to the Windows Imaging Component (WIC): Scale and convert to JPG or PNG - Open a variety of image types then optionally scale and convert to PNG or JPG. IWICImagingFactory, IWICBitmapDecoder, IWICBitmapFrameDecode, IWICFormatConverter, IWICBitmapScaler, IWICBitmapSource, IWICBitmapEncoder, IWICStream, IWICBitmapFrameEncode, IPropertyBag2
[VB6] Virtual File Drag Drop - Virtual files are created from data that's only read when dropped, instead of beforehand. Uses some neat IDataObject tricks and also supports multiple files at once. IDataObject, IStream
[VB6, Vista+] Add the Windows Send To submenu to your popup menu - Uses shell interfaces to implement the Send To menu exactly as Explorer does. IShellItem, IShellItemImageFactory, IDataObject, IDropTarget, IEnumShellItems, IShellItemArray, IFileOpenDialog
[VB6] Get extended details about Explorer windows by getting their IFolderView - Get that interface and many more for highly detailed information about open Explorer windows and their items. Changing window settings and selections is also possible. IShellWindows, IFolderView, IFolderView2, IShellBrowser, IShellView, IEnumVARIANT, IShellItem, IDispatch
[VB6, Vista+] List all file properties, locale/unit formatted, by modern PROPERTYKEY - Demonstrates use of the modern PROPERTYKEY/IPropertyStore system, with PROPVARIANT handling made simple. Update includes a new sample project attached displaying a ListView of properties and using IPropertySystem to create a property display management technique.
See Also: A compact function to retrieve any property by name, which loads a property store directly by file name without IShellItem, and then displays a formatted string for anyone property name. IPropertyStore, IPropertyDescription, IPropertySystem, IShellItem2, IShellFolder2
[VB6] Easy image disp/edit; scale/rotate, show animated gifs, conv2JPG, +more; No GDI+/DLL - Shows off oleexp 3.1's new image interfaces, which make dealing with images and imagelists far easier. Scale, rotate, show animated GIFs, transcode to JPG/BMP, get image properties, resize an imagelist, all with mostly single-line calls. IShellImageData, IShellImageDataFactory, ITranscodeImage, IImageList, IImageList2, IShellItem, IFileOpenDialog, IShellItem, IShellItemArray, IEnumShellItems, IPersistFile, IExtractImage.
[VB6] IPreviewHandler: Show non-image file previews from any reg'd preview handler - Don't limit your previews to just images anymore; documents, music, videos, PDFs, Powerpoint/Excel, and lots more have existing or available preview handlers you can access with IPreviewHandler. IPreviewHandler, IInitializeWithFile, IInitializeWithStream, IInitializeWithItem, IUnknown
[VB6, Vista+] Code snippet: KnownFolders made easy with IKnownFolderManager - The KnownFolderManager coclass (a default implementation you can get with the New keyword) greatly simplifies all aspects of working with special folders, their locations, properties, names, and identifiers. IKnownFolderManager, IKnownFolder, IShellItem, IShellItemImageFactory
[VB6, Vista+] Host Windows Explorer on your form: navigation tree and/or folder - Use IExplorerBrowser and INamespaceTreeControl as a simple way (they have default implementations-- you don't even need a ListView, the whole thing is automatically created right on your form) to add a full-fledged Explorer view to your form. IExplorerBrowser, IExplorerBrowserEvents, INamespaceTreeControl, INamespaceTreeControlEvents, IDataObject, IShellView, IShellItem
[VB6] API File Drag from multiple paths w/o native OLE or dragsource, SHDoDragDrop - Create an IDataObject with SHCreateDataObject/SHCreateFileDataObject to initiate a drag operation with very low-level access to all elements of the drag operation. Later comments in the thread show the use of DragDropHelper coclass (IDragSourceHelper, IDragSourceHelper2). IDataObject, IDragSourceHelper2
[VB6] Using the new IFileDialog interface for customizable Open/Save (TLB, Vista+) - Has the benefit of allowing easy access to events from the dialog, as well as making it very easy to add your own controls. IFileDialog2, IFileDialogCustomize, IFileOpenDialog, IFileSaveDialog, IFileDialogEvents, IShellItem, IShellItemArray, IEnumShellItems
[VB6] Working with Libraries (Win7+) - Uses the IShellLibrary interface to get all folders in a library, add more, get the default save location, get the icon, and even create a new library. Also shows the use of IEnumShellItems and IShellItemArray. IShellLibrary, IShellItem, IShellItemArray, IEnumShellItems
Add-ons are optional modules full of definitions related to a particular feature set, like a header #include in other languages. Like adding mPKEY.bas is exactly the same as '#include propkey.h' in a C/C++ project. Only the items you actually use get compiled into the .exe, so don't worry about a bloated executable containing unused GUIDs.
mIID.bas (UPDATED with 6.6) - All IID_/BHID_/FOLDERID_/SID_ values, usable directly without CLSIDFromString, e.g. SHCreateItemFromIDList(pidl, IID_IShellItem, psi), never have to worry about converting a string. Strongly recommended for all oleexp projects.
mPKEY.bas - All PROPERTYKEY's from propkey.h, directly usable.
mCoreAudio.bas / mDirectShow.bas / mPortableDevices.bas / mWIC.bas / mDirectX.bas / mSpeech.bas / mUIA.bas / mMF.bas - IIDs and functions used exclusively by those particular features.