AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Resolved] Active window

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
DranDane



Joined: 26 Jun 2007
Posts: 54

PostPosted: Wed Mar 05, 2008 10:04 pm    Post subject: [Resolved] Active window Reply with quote

Hi,

Could you explain me how I can catch the active/focused window in a ahk code ?

I guess it's with the WinGet function but how ?

Thank you,

Dran


Last edited by DranDane on Thu Mar 06, 2008 1:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 710
Location: Florida

PostPosted: Wed Mar 05, 2008 10:30 pm    Post subject: Reply with quote

Code:
WinGetActiveTitle, Title
;Or (See SKAN's post below)
;WinGetTitle, Title, A
MsgBox, Your active window is %Title%

_________________
[Join IRC!]


Last edited by Rhys on Wed Mar 05, 2008 10:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5790

PostPosted: Wed Mar 05, 2008 10:32 pm    Post subject: Reply with quote

In every win command available, the Title parameter can be A.
The A denotes the Active window.

For example to minimize the Active window the command is

Code:
WinMinimize, A


Smile
Back to top
View user's profile Send private message
DranDane



Joined: 26 Jun 2007
Posts: 54

PostPosted: Thu Mar 06, 2008 1:39 pm    Post subject: Reply with quote

So, if I need to move and resize a windows I don't need to get the windows id before. I can use Move and Resize with the A parameter.

Thank you,
Back to top
View user's profile Send private message
Kellianjaxon



Joined: 05 Jan 2008
Posts: 39

PostPosted: Thu Mar 06, 2008 3:34 pm    Post subject: Reply with quote

You can find that out in the help file by reading the Wintitle parameter explanation for each windowing command. Just look for the line
Autohotkey help wrote:
If this is the letter A and the next 3 parameters are omitted, the active window will be used.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group