Article ID: 113998
Article Last Modified on 1/8/2003
' Enter the following Declare statement as one, single line:
Declare Function GetFileVersionInfo% Lib "VER.DLL" (ByVal lpszFileName$,
ByVal handle As Any, ByVal cbBuf&, ByVal lpvData$)
Sub Form_Load ()
Dim pos As Integer
Dim version As String * 255
Dim ans As String
version = Space$(255)
' Get the version info and fill the version string:
ret% = GetFileVersionInfo("user.exe", 0&, 254, version)
' Find the position in the string where the FileVersion stamp is:
pos = InStr(1, version, "FileVersion")
' 12 is the length of "FileVersion" +1 for the null
' 4 is the length of string (3.11 in this case) to return
ans = Mid$(version, pos + 12, 4)
' Display the answer:
MsgBox ans
End Sub
Additional query words: 3.00
Keywords: kbprb KB113998