Extracting a Program's Version Information | |||
| |||
-------------------------------------------------------------------------------- Extracting a Program's Version Information by Michael Burton - rimrock@rimrocksoftware.com Delphi 3 and Delphi 4 each have a page in their Project Options dialog called Version Info. This page allows you to set up version information that will be stored in your program when it is compiled. How can you extract the version information programmatically, so you can display it in your About box? There is no function provided by Inprise to get the version information directly, so you have to use Windows API calls to do that. The object TrsFileVersion (shown below) encapsulates a function called ReadVersionInfo, which does all the heavy work of reading version information. TrsFileVersion has one method, GetFileVersion, which calls ReadVersionInfo and sets version properties accordingly. You can then read the version information from the TrsFileVersion properties. A small demo project that exercises TrsFileVersion is included in the TrsFileVersion zip file. To use the TrsFileVersion object, you Create an instance of it and call the GetFileVersion method. If GetFileVersion returns True, you can read the version information out of the Version, Major, Minor, Release and Build properties. Be sure to Free the object when you finish with it. The demo shows you how a program can read its own version information, and how to read the information for other executable files. Version information can be read from exe, dll, ocx, vbx, drv, vxd, pdr and mpd files (and probably others that I haven't yet discovered). Tags: version 윈도우즈 | |||
| |||
| |||
Login for comment |
OTHER POSTS IN THE SAME CATEGORY Web Browser Control에서 Enter키 먹게 하기 |