HotKeySet("^``", "toggle_media_controls") ; Ctrl + `
While 1
Sleep(100)
WEnd
If Not ProcessExists("wmplayer.exe") And RegRead("HKCU\Software\Microsoft\MediaPlayer\Preferences", "HoverTransportsEnabled") = 1 Then
; Disable autohide controls
RegWrite("HKCU\Software\Microsoft\MediaPlayer\Preferences", "HoverTransportsEnabled", "REG_DWORD", "0")
EndIf
Func toggle_media_controls()
Local $sVar = RegRead("HKCU\Software\Microsoft\MediaPlayer\Preferences", "HoverTransportsEnabled")
If ProcessExists("wmplayer.exe") Then
If $sVar = 0 Then
; Enable autohide controls
RegWrite("HKCU\Software\Microsoft\MediaPlayer\Preferences", "HoverTransportsEnabled", "REG_DWORD", "1")
Else
; Disable autohide controls
RegWrite("HKCU\Software\Microsoft\MediaPlayer\Preferences", "HoverTransportsEnabled", "REG_DWORD", "0")
EndIf
EndIf
EndFuncHow do I amend this code so that without pressing a hotkey, after Windows Media Player is not running, the regkey above is set to 0? My function and hotkey all work without issue