Add this two line to WinAPI.au3
Global Const $__WINAPICONSTANT_FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x100
Global Const $__WINAPICONSTANT_FORMAT_MESSAGE_FROM_SYSTEM = 0x1000
Func _WinAPI_GetErrorMessageByCode($code)
Local $tBufferPtr = DllStructCreate("ptr")
Local $pBufferPtr = DllStructGetPtr($tBufferPtr)
Local $nCount = _WinAPI_FormatMessage(BitOR($__WINAPICONSTANT_FORMAT_MESSAGE_ALLOCATE_BUFFER, $__WINAPICONSTANT_FORMAT_MESSAGE_FROM_SYSTEM), _
0, $code, 0, $pBufferPtr, 0, 0)
If @error Then Return SetError(@error, 0, "")
Local $sText = ""
Local $pBuffer = DllStructGetData($tBufferPtr, 1)
If $pBuffer Then
If $nCount > 0 Then
Local $tBuffer = DllStructCreate("wchar[" &($nCount+1) & "]", $pBuffer)
$sText = DllStructGetData($tBuffer, 1)
EndIf
_WinAPI_LocalFree($pBuffer)
EndIf
Return $sText
EndFunc ;==>_WinAPI_GetErrorMessageByCode