AutoHotkey Community

It is currently May 24th, 2012, 2:25 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: January 13th, 2007, 3:18 pm 
How do I open last opened window?

Please don't say alt-tab.

Alt tab opens a window of the last-opened *application*.

It is not necessarily the last window which was open,
it could be *any* window owned by that application.

So: how do I give the input focus to the last window
that had it, (and bring it to the top)?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 4:32 am 
Offline

Joined: June 27th, 2006, 2:38 pm
Posts: 385
Location: Canada
Alt Esc?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 1:51 pm 
Conquer wrote:
Alt Esc?


No. That opens all the windows in a huge cycle.

What I'm after is the ability to open the last window which had the input focus.

Obviously, that's what alt-tab ought to do - but it's badly busted.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 5:03 pm 
Offline

Joined: June 27th, 2006, 2:38 pm
Posts: 385
Location: Canada
Sounds like an interesting problem, though I must say I have no clue how to do this. Wait for one of those pros to help, or I guess searching the forum with the search tool is an option..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 5:21 pm 
Offline

Joined: December 11th, 2006, 4:11 pm
Posts: 242
Location: Orlando, FL
This seems to work:

Code:
Loop
   {
   WinGetTitle, Title, A
   WinWaitNotActive, %Title%
   LastWindow := Title
   }
RETURN
F5::WinActivate, %LastWindow%

Hope this helps :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 8:30 pm 
Offline

Joined: January 1st, 2007, 10:32 am
Posts: 17
Jaytech wrote:
This seems to work:

Code:
Loop
   {
   WinGetTitle, Title, A
   WinWaitNotActive, %Title%
   LastWindow := Title
   }
RETURN
F5::WinActivate, %LastWindow%

Hope this helps :)


Good one, Jaytech - thanks!

_________________
--
__________
|im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2007, 8:57 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
This version works with windows having the same title (using the ID instead).
Code:
Loop {
  WinGet, ActiveId, ID, A
  WinWaitNotActive, ahk_id %ActiveId%
  LastActiveId := ActiveId
}
Return

F5::WinActivate, ahk_id %LastActiveId%

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, engunneer, tomoe_uehara and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group