Getting Dll version and File discription
Can Do
Goto Guest book sign in page [Home]
Thanks for visiting my site lucky visitor:
This page was last updated on: March 21, 2009
Copyright © 2002. XcelFiles. All Rights Reserved Ivan F Moala
Tell a friend about this page
Google
Search WWW Search My Site!

It is important that when using API's that we have the correct DLL version. With codes that I use on this site I will endeavour to give you the correct DLL versions to use. In most cases this is usually not an issue and is usually operating sytem dependant. But if you need to get a Dll version then here is how. Also provided a file discription routen.

Below are actually 2 seperate codes to get
  • Dll Version (either via user selection of File or listing them to a worksheet)

The Dll version is NOT an API call, it uses the File System Object.

The GetFilediscription DOES use API's, I have included them together so you can use these in combination ie getting a file discription and the Version IF any.


Amendment: Extra:
Need to get the Functions in a Dll....then have a look here......

The File discription uses the;

Type structure taken fron the C Header file > shellapi.h
and looks like this;

typedef struct _SHFILEINFO {
   HICON hIcon;
   int iIcon;
   DWORD dwAttributes;
   TCHAR szDisplayName[MAX_PATH];
   TCHAR szTypeName[80];
} SHFILEINFO;

From this we can now build our VBA structure as follows;

Private Type SHFILEINFO
   hIcon                As Long
   iIcon                 As Long
   dwAttributes      As Long
   szDisplayName As String * MAX_PATH
   szTypeName     As String * 80
End Type

The API that we will use is;

Private Declare Function SHGetFileInfo Lib "Shell32" _
  Alias "SHGetFileInfoA" ( _
  ByVal pszPath As Any, _
  ByVal dwFileAttributes As Long, _
  psfi As SHFILEINFO, _
  ByVal cbFileInfo As Long, _
  ByVal uFlags As Long) As Long

Note this is one of the core Windows DLL and represents the objects in the Shell. Methods are provided to control the Shell and to execute commands within the Shell. There are also methods to obtain other Shell-related objects.

DLL Version Numbers
Most of the programming elements in the Shell and common controls documentation are contained in three DLLs: Comctl32.dll, Shell32.dll, and Shlwapi.dll.

Latter on I will discuss more about the other 2 DLLs.

The plus side of Windows OS is that enhancements are just a matter of updating DLLs, so as you would expect, different versions of these DLLs implement different features. Below is the version numbers which indicates that the programming element was first implemented in that version and will also be found in all subsequent versions of the DLL. If no version number is specified, the programming element is implemented in all versions. The following list outlines the different DLL versions and how they were distributed.

   VersionDLLDistribution Platform
  • 4.0  AllMicrosoft® Windows® 95/Microsoft Windows NT® 4.0.
  • 4.7  AllMicrosoft Internet Explorer 3.x.
  • 4.71AllInternet Explorer 4.0.
  • 4.72AllInternet Explorer 4.01 and Windows 98
  • 5.0  Shlwapi.dllInternet Explorer 5
  • 6.0  Shlwapi.dllInternet Explorer 6 and Windows XP.
  • 5.0  Shell32.dllWindows 2000 and Windows Millennium
                 Edition (Windows Me)
  • 6.0  Shell32.dllWindows XP.
  • 5.8  Comctl32.dllInternet Explorer 5.
  • 5.81       Comctl32.dllWindows 2000 and Windows Me
  • 6.0 Comctl32.dllWindows XP


Note: Minimum operating systems required for above API
        Windows NT 4.0, Windows 95