| View previous topic :: View next topic |
| Author |
Message |
DranDane
Joined: 26 Jun 2007 Posts: 54
|
Posted: Wed Mar 05, 2008 10:04 pm Post subject: [Resolved] Active window |
|
|
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 |
|
 |
Rhys
Joined: 17 Apr 2007 Posts: 710 Location: Florida
|
Posted: Wed Mar 05, 2008 10:30 pm Post subject: |
|
|
| 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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5790
|
Posted: Wed Mar 05, 2008 10:32 pm Post subject: |
|
|
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
 |
|
| Back to top |
|
 |
DranDane
Joined: 26 Jun 2007 Posts: 54
|
Posted: Thu Mar 06, 2008 1:39 pm Post subject: |
|
|
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 |
|
 |
Kellianjaxon
Joined: 05 Jan 2008 Posts: 39
|
Posted: Thu Mar 06, 2008 3:34 pm Post subject: |
|
|
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 |
|
 |
|