Retrieves information about the last write time to the specified registry key
#include <WinAPIReg.au3>
_WinAPI_RegQueryLastWriteTime ( $hKey )
$hKey | Handle to an open registry key. The key must have been opened with the $KEY_QUERY_VALUE access right. This handle is returned by the _WinAPI_RegCreateKey() or _WinAPI_RegOpenKey() function. It can also be one of the following predefined keys: $HKEY_CLASSES_ROOT $HKEY_CURRENT_CONFIG $HKEY_CURRENT_USER $HKEY_LOCAL_MACHINE $HKEY_PERFORMANCE_DATA $HKEY_USERS |
Success: | $tagFILETIME structure that contains the last write time. |
Failure: | Sets the @error flag to non-zero, @extended flag may contain the system error code. |
_WinAPI_RegCreateKey, _WinAPI_RegOpenKey
Search RegQueryInfoKey in MSDN Library.
#include <APIRegConstants.au3>
#include <Date.au3>
#include <Debug.au3>
#include <WinAPIError.au3>
#include <WinAPILocale.au3>
#include <WinAPIReg.au3>
_DebugSetup(Default, True)
Example()
Func Example()
Local $hKey = _WinAPI_RegOpenKey($HKEY_LOCAL_MACHINE, 'SOFTWARE\AutoIt v3\AutoIt', $KEY_QUERY_VALUE)
If @error Then
_DebugReport("! RegOpenKey @error =" & @error & @CRLF & @TAB &_WinAPI_GetErrorMessage(@extended) & @CRLF)
Exit
EndIf
Local $tFT = _WinAPI_RegQueryLastWriteTime($hKey)
$tFT = _Date_Time_FileTimeToLocalFileTime($tFT)
Local $tST = _Date_Time_FileTimeToSystemTime($tFT)
_WinAPI_RegCloseKey($hKey)
_DebugReport('! Last modified at: ' & _WinAPI_GetDateFormat(0, $tST) & ' ' & _WinAPI_GetTimeFormat(0, $tST) & @CRLF)
EndFunc ;==>Example
#include <APIRegConstants.au3> #include <Date.au3> #include <Debug.au3> #include <MsgBoxConstants.au3> #include <WinAPIError.au3> #include <WinAPILocale.au3> #include <WinAPIReg.au3> _DebugSetup(Default, True) Example() Func Example() Local $hKey = _WinAPI_RegOpenKey('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', '', $KEY_QUERY_VALUE) If @error Then _DebugReport("! RegOpenKey @error =" & @error & @TAB & _WinAPI_GetErrorMessage(@extended) & @CRLF) Exit EndIf Local $tFT = _WinAPI_RegQueryLastWriteTime($hKey) $tFT = _Date_Time_FileTimeToLocalFileTime($tFT) Local $tST = _Date_Time_FileTimeToSystemTime($tFT) _WinAPI_RegCloseKey($hKey) _DebugReport('!Last modified at: ' & _WinAPI_GetDateFormat(0, $tST) & ' ' & _WinAPI_GetTimeFormat(0, $tST) & @CRLF) EndFunc ;==>Example
#AutoIt3Wrapper_UseX64=Y #include <Date.au3> #include <Debug.au3> #include <WinAPIError.au3> #include <WinAPILocale.au3> #include <WinAPIReg.au3> _DebugSetup(Default, True) Example() Func Example() Local $hKey = _WinAPI_RegOpenKey($HKEY_LOCAL_MACHINE, 'SOFTWARE\AutoIt v3\AutoIt', $KEY_QUERY_VALUE) If @error Then _DebugReport("! RegOpenKey @error = " & @error & @CRLF & @TAB & _WinAPI_GetErrorMessage(@extended) & @CRLF) Exit EndIf Local $tFT = _WinAPI_RegQueryLastWriteTime($hKey) $tFT = _Date_Time_FileTimeToLocalFileTime($tFT) Local $tST = _Date_Time_FileTimeToSystemTime($tFT) _WinAPI_RegCloseKey($hKey) _DebugReport('- Last modified at: ' & _WinAPI_GetDateFormat(0, $tST) & ' ' & _WinAPI_GetTimeFormat(0, $tST) & @CRLF) EndFunc ;==>Example