ich würde das so machen:
Spoiler anzeigen
[autoit]
#include <GUIConstants.au3>
HotKeySet("!p", "_Pause")
Global $trigger = False
#region - GUI Create
GUICreate('')
$label = GUICtrlCreateLabel('',10,10,200,20)
GUISetState()
#endregion
#region - GUI SelectLoop
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
#endregion
Func _Pause()
$trigger = False
HotKeySet("!p", "_EndPause")
GUICtrlSetData($label, 'Script pausiert')
While 1
$msg = GuiGetMsg()
If $trigger = True Then ExitLoop
WEnd
GUICtrlSetData($label, '')
EndFunc
Func _EndPause()
$trigger = True
EndFunc