@pixelsearch & @Tick #include <GuiMenu.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Example() MsgBox(0, "", 'the end') Func Example() WinWait("[CLASS:Notepad]", "", 10) If Not WinExists("[CLASS:Notepad]") Then Return Local $hWnd = WinGetHandle("[CLASS:Notepad]") ControlFocus($hWnd, "", "Edit1") Send("{APPSKEY}") Local $0_PopUPhwnd = WinGetHandle("[CLASS