Option Explicit #If Win64 Then Public Declare PtrSafe Function SystemParametersInfo Lib "USER32" Alias "SystemParametersInfoW" _ (ByVal uiAction As Long, ByVal uiParam As Long, ByRef pvParam As Long, ByVal fWinIni As Long) As Long #Else Public Declare Function SystemParametersInfo Lib "USER32" Alias "SystemParametersInfoW" _ (ByVal uiAction As Long, ByVal uiParam As Long, ByRef pvParam As Long, ByVal fWinIni As Long) As Long #End If Public Const SPI_GETFOREGROUNDLOCKTIMEOUT As Long = &H2000& Public Const SPI_SETFOREGROUNDLOCKTIMEOUT As Long = &H2001& Public Sub Main() Dim oldValue As Long oldValue = 1234 'dummy value Call SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, oldValue, 0) Debug.Print Hex(oldValue) '☆0 'Call SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, ByVal 20001, 1) '★1 'Call SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, ByVal &H13579, 0) '★2 End Sub