I want to trap a tray notification from Bluestacks/WhatsApp. Here is my code OnAutoItExitRegister("_Exit") Func _Exit() If IsDeclared("@exitCode") Then MsgBox(262144, Default, "Exit", 3) Exit EndFunc ;==>_Exit If Not HotKeySet("{ESC}", "_Exit") Then Exit MsgBox(16 + 262144, Default, "Script cancelled due to HotKey ESC already defined. ", 5) MsgBox(262144, Default, "Start", 1) While Sleep(1000) Beep(500, 100) ; next line has