Process Close Issues

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
FlexGuy
Posts: 1
Joined: 02 Dec 2021, 17:39

Process Close Issues

Post by FlexGuy » 02 Dec 2021, 17:55

My code was working perfect and the final thing I needed to add was to close Microsoft Edge at the end of the process.
Since I was unable to get Winclose to work properly, I found code (process ,close ,msedge) and placed it in my script.
Not only did it not work, the script now loses focus of the MS Edge window after launch and the remaining commands seem to affect everything on the desktop accept for the browser.
Tried to find info to retain focus and multiple re-boots but nothing seems to help.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#p::
Run http://webapps.mysite.com/SearchWiz.aspx
send {tab}{tab}{tab}
send 12/2/2021
send {tab}{tab}{tab}
sleep 3000
send {enter}
sleep 3000
send {tab}
send {enter}
sleep 5000
return
[Mod edit: [code][/code] tags added.]

User avatar
mikeyww
Posts: 26611
Joined: 09 Sep 2014, 18:38

Re: Process Close Issues

Post by mikeyww » 02 Dec 2021, 18:12

A process name ends with .exe.

Code: Select all

WinClose, ahk_exe msedge.exe
More examples

Post Reply

Return to “Ask for Help (v1)”