One way is to call a Windows API function. If noboy can come up with a better solution in a couple of days, I dig out my notes and post them here.
James P. Cottingham
Well, nobody has posted anything, so I'll give it a try. I was hoping to get an example but I haven't had time. The only exmaple that I've found was at Borland's ite in their Community but it was in Pascal (Delphi). You need to call three Windows APIs: DWORD GetFileVersionInfoSize( LPTSTRlptstrFilename, // file name LPDWORDlpdwHandle // set to zero );
If the value return by this is zero, then it failed and you can't get the version.
BOOL GetFileVersionInfo(
LPSTRlptstrFilename, // file name (same as above) DWORDdwHandle, // ignored DWORDdwLen, // size of buffer from above API LPVOIDlpData // version info buffer )
Then you call: DWORD GetFileVersionInfoSize(
LPTSTRlptstrFilename, // file name (same as above) LPDWORDlpdwHandle // set to zero )
See msdn.microsoft.com/libary and search for these APIs for more info. Sorry I can't be of more help.
James P. Cottingham
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.