I just want my script to select the right Window to input key storkes. To do this I think I use WinActivate. I ran the example from their site but found some strange results in Windows 10
IfWinExist, Untitled - Notepad
WinActivate ; use the window found above
else
WinActivate, Calculator;
- If Notepad is minimized, it gets the focus
- If Notepad is open but is not have the focus (i.e. another window is on top of it), Notepad gets the focus
- If Notepad is not open and the calculator is minimized, for some strange reason it doesn't get the focus.
- If Notepad is not open and the calculator is open but not have the focus, it gets the focus.
What is causing the inconsistency?