DetourIt

 SDK 

 

GetVersionInfo
 
Retrievs information about an application. 
 
Syntax:
 
HRESULT GetVersionInfo(
   LPSTR szFullPath,
   LPSTR InfoItem,
   LPSTR szResult,
   int maxlen
);
 
 
Parameters:
 
 
szFullPath
 
            type: LPSTR
 
            The full path to the .exe file.
 
 
InfoItem
 
            type: LPSTR
            The info to retrieve.
 
 
"Comments", "CompanyName", "FileDescription",
 
"FileVersion", "InternalName", "LegalCopyright",
 
"FileDescription", "LegalTrademarks", "PrivateBuild",
 
"FileVersion", "OriginalFilename", "SpecialBuild";
 
 
 
 
szResult
 
            type: LPSTR
 
            Pointer to the retrieved information.
 
 
maxlen
 
             type: int
 
             Max number of bytes to be copied.
 
 
 
 
 
Return Value:
 
 
Return 0 if successful.
 
 
 
Example:
 
 
#include "detourit.h"
 
void main()
{
 
    //The full path to notepad.exe.
    CHAR *szNotepad = "C:/Windows/System32/Notepad.exe"
 
    //Declare a buffer for the file version info.
    CHAR szFileVersion[256] = {0};
 
    //GetVersionInfo returns 0 if successful.
    if (!GetVersionInfo(szNotepad, "FileVersion", szFileVersion, 255))
        printf("Retrieved information successfully: %s", szFileVersion);
    else
        printf("Information retrieval failed");
}