3
I remapped my NumLock key using AutoHotKey so that it would open the calculator instead, using the following script:
NUMLOCK::
IfWinExist Calculator
{
WinActivate Calculator
}
else
{
Run, % "calc"
WinWait Calculator
WinActivate
}
This ran great up through Windows 7 (albeit with a different "run" line due to app name changes). The IfWinExist
line checks to see if Calculator is already running. If it is, it activates it; if not, it launches it. This works to keep you from getting multiple copies of Calculator running in case you don't close it between uses.
With Windows 10 I have noticed that it only works intermittently. The first time I launch it following a reboot, everything works as normal. However, sometimes when closing the Calculator app, it saves it in the Background Processes, rather than truly exiting out.
When I activate the script, the IfWinExist
will find it as running and (apparently) activates it but with no visible effect since it's a background process. If I open Task Manager and kill the process, normal function returns (for a while).
Is there any way to either prevent Windows from leaving the Calculator as a Background Process, or to make AutoHotKey distinguish between Apps and Background Processes?
I've had similar problems with AutoHotKey in Windows 10. I made a basic script for my wife to toggle her touch screen on or off, and it works great at first, but after a few uses it becomes intermittent. Haven't had a chance to figure out why yet, but I never had this sort of problem with AutoHotKey in older versions of Windows. – freginold – 2017-08-09T15:08:52.597