Explicitly Focus next window after minimize

Get help with using AutoHotkey and its commands and hotkeys
techmon
Posts: 14
Joined: 16 May 2017, 13:30

Explicitly Focus next window after minimize

21 May 2018, 10:25

I use an autohotkey script (.ahk) here for some basic keyboard shortcuts, such as:
to open specific programs, to type text that is used frequently (canned text), to minimize
windows, etc.

Thank you to those behind AutoHotKey! Very powerful / time-saving! :) God bless you!

There are a few scenarios that I am not sure what the correct code would be so I am looking for a little bit of help.

A specific example would be, I use the following to minimize the current active window:

Code: Select all

^down::
WinGet, windows, List
WinMinimize, A
Return
always use code tags!

This works good, however I want the next window to actually focus. Right now, the next window comes into view but does not necessarily explicitly focus.

Can you help?

Thanks,
Shawn
User avatar
TLM
Posts: 1583
Joined: 01 Oct 2013, 07:52
GitHub: TLMcode
Contact:

Re: Explicitly Focus next window after minimize

21 May 2018, 10:39

try

Code: Select all

WinGetTitle, WinTitle, A
WinMinimize, % WinTitle
WinWaitNotActive, % WinTitle
WinActivate, A
techmon
Posts: 14
Joined: 16 May 2017, 13:30

Re: Explicitly Focus next window after minimize

24 May 2018, 15:06

Thanks so much for your help, TLM!

That seemed to do the trick.
User avatar
TLM
Posts: 1583
Joined: 01 Oct 2013, 07:52
GitHub: TLMcode
Contact:

Re: Explicitly Focus next window after minimize

24 May 2018, 15:16

No probs, glad it worked out for you :thumbup:
Feel free to ask if you have any further questions..
techmon
Posts: 14
Joined: 16 May 2017, 13:30

Re: Explicitly Focus next window after minimize

13 Jun 2019, 08:00

For some reason, this does not seem to be working anymore. (that it does not explicitly focus the next window after minimize)

Does anyone have any ideas?

I'm using Windows 2012 R2 which is based off Windows 8.1 kernel.

Thanks,
Shawn
techmon
Posts: 14
Joined: 16 May 2017, 13:30

Re: Explicitly Focus next window after minimize

14 Sep 2020, 13:20

Would anybody have any ideas on the above question?

Thanks much,
Shawn

Return to “Ask For Help”

Who is online

Users browsing this forum: AHKStudent, DanRim, Google [Bot], mikeyww and 46 guests