It's not the solution for your issue, but you can use GUISetAccelerators instead of HotKeySet
#include <File.au3>
#include <GUIConstants.au3>
Global $sPicPath = "C:\Windows\Web\Wallpaper\Architecture"
Global $aPics = _FileListToArray($sPicPath, "*.jpg", 1, True)
If NOT IsArray($aPics) Then Exit MsgBox(16, "Error", "No picture found in " & $sPicPath)
Global $iCurrent = 1
GUICreate("Picture Viewer", 820, 700)
GUISetBkColor(0)
Global $ID_Pic = GUICtrlCreatePic($aPics[1], 10, 10, 800, 600)
Global $ID_Previous = GUICtrlCreateButton("Previous", 50, 620, 200, 30)
Global $ID_Next = GUICtrlCreateButton("Next", 570, 620, 200, 30)
GUICtrlSetFont($ID_Previous, 15, 700)
GUICtrlSetFont($ID_Next, 15, 700)
Local $aAccelKeys[2][2] = [["{LEFT}", $ID_Previous],["{RIGHT}", $ID_Next]]
GUISetAccelerators($aAccelKeys)
GUICtrlSetState($ID_Previous, $GUI_DISABLE)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $ID_Previous
If $iCurrent > 1 Then _Previous()
Case $ID_Next
If $iCurrent < UBound($aPics) - 1 Then _Next()
EndSwitch
Sleep(10)
WEnd
Func _Previous()
$iCurrent -= 1
If $iCurrent = 1 Then GUICtrlSetState($ID_Previous, $GUI_DISABLE)
GUICtrlSetState($ID_Next, $GUI_ENABLE)
GUICtrlSetImage($ID_Pic, $aPics[$iCurrent])
EndFunc
Func _Next()
$iCurrent += 1
If $iCurrent = UBound($aPics) - 1 Then GUICtrlSetState($ID_Next, $GUI_DISABLE)
GUICtrlSetState($ID_Previous, $GUI_ENABLE)
GUICtrlSetImage($ID_Pic, $aPics[$iCurrent])
EndFunc
Oups, edited...