Obtaining DLL version information
Posted on 1997-05-28
Under WIN32 I would like to have an "About" box that will show the version numbers of all the DLLs that the currently-executing program is using. It appears that the "GetFileVersionInfo" API will return this information IF I KNOW THE FULL PATHNAME OF EACH DLL THAT THE PROGRAM IS USING. Unfortunately, I don't know how to GET those pathnames from the executing program. Alternatively, could I use 'EnumResourceNames' (or one of the other 'Enum' functions) to get the version information from all of the DLLs that are being using by the currently executing program?
1. Is there any way to obtain (from within an executing program) what DLLs are being used by that program? If so, is there any way to get the full pathnames associated with each such DLL?
2. Can one of the 'Enum' functions be used to search the currently-executing EXE file ALONG WITH ALL THE DLLs THAT IT IS USING to obtain the version information associated with the EXE file and with each of the DLLs?
If either of these approaches can be used, an outline of the required 'C' code would be most useful! (I can't find any reasonable example of using the 'Enum' functions.)