Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get the translation code from VerQueryValue?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
How to get the translation code from VerQueryValue?
Divers
Thread ID:
00993793
Message ID:
00993793
Vues:
103
Hi,

Can anyone help me find the translation code for the stringFileInfo, I have the following code but i keep getting error message like
--specified resource type cannot be found in the image file--
DECLARE INTEGER GetFileVersionInfoSize IN version.dll STRING, INTEGER
DECLARE INTEGER GetFileVersionInfo IN version.dll STRING, INTEGER, INTEGER, STRING @
DECLARE INTEGER VerQueryValue IN version.dll STRING, STRING, STRING @, INTEGER @
DECLARE INTEGER GetLastError IN kernel32
fileName = "C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\VFP9.EXE"
dwHandle = 0
nDataLen = GetFileVersionInfoSize(fileName, dwHandle)
lpData = SPACE(nDataLen)
GetFileVersionInfo(fileName, dwHandle, nDataLen, @lpData)
subblock = "\VarFileInfo\Translation"
lpblockData = SPACE(nDataLen)
nblockLength = 0
VerQueryValue(lpData, subblock, @lpblockData, @nblockLength)
subblock = "\StringFileInfo\"
         + RIGHT(TRANSFORM(ASC(SUBSTR(lpblockData, 2, 1)), "@0"), 2)
         + RIGHT(TRANSFORM(ASC(SUBSTR(lpblockData, 1, 1)), "@0"), 2)
         + RIGHT(TRANSFORM(ASC(SUBSTR(lpblockData, 4, 1)), "@0"), 2)
         + RIGHT(TRANSFORM(ASC(SUBSTR(lpblockData, 3, 1)), "@0"), 2) + "\ProductName"
lpblockData = SPACE(nDataLen)
nblockLength = 0
VerQueryValue(lpData, subblock, @lpblockData, @nblockLength)
GetLastError()
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform