Returns the calling thread's lasterror code value
#include <WinAPI.au3> _WinAPI_GetLastError ( )
_WinAPI_GetLastErrorMessage
Search GetLastError in MSDN Library.