函数参考


_WinAPI_DllGetVersion

Retrieves a DLL-specific version information.

#Include <WinAPIEx.au3>
_WinAPI_DllGetVersion ( $sPath )

参数

$sPath The path to the DLL file from which information is retrieved.

返回值

Success The array containing the following information:
[0] The major version.
[1] The minor version.
[2] The build number.
[3] The platform for which the DLL was built ($DLLVER_PLATFORM_*).
失败: 返回 0 并设置 @error 标志为非 0 值, @extended 标志可能包含一个系统错误代码.

注意/说明

This function is not an API. It is exported by name from each DLL that implements it. Currently, most of the Windows Shell
and common controls DLLs implement DllGetVersion. These include, but are not limited to, shell32.dll, comctl32.dll,
shdocvw.dll, and shlwapi.dll.

相关

详情参考

在MSDN中搜索


示例/演示


#Include <APIConstants.au3>
#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global Const $sDll = @SystemDir & '\comctl32.dll'

Global $Data, $Text

$Data = _WinAPI_DllGetVersion($sDll)
Switch @error
    Case 0
        Switch $Data[3]
            Case $DLLVER_PLATFORM_WINDOWS
                $Text = 'Windows 95/98'
            Case $DLLVER_PLATFORM_NT
                $Text = 'NT-based'
            Case Else
                $Text = 'Unknown platform'
        EndSwitch
        ConsoleWrite($sDll & ' => ' & $Data[0] & '.' & $Data[1] & '.' & $Data[2] & ' (' & $Text & ')' & @CR)
    Case 3
        ConsoleWrite('DllGetVersion not implemented in ' & $sDll & '.' & @CR)
    Case Else
        ConsoleWrite('Unable to retrieve version information.' & @CR)
EndSwitch