| View previous topic :: View next topic |
| Author |
Message |
dollarcoin Guest
|
Posted: Sun Aug 23, 2009 10:54 pm Post subject: New Window Placement Upon Open |
|
|
I want to create a simple AHK script that automatically moves new windows to a certain screen location.
Specifically, any time I open a new window with a given char string in the title (or even any new window for that matter), I want it to appear at a certain screen coord while the script is running.
Help! |
|
| Back to top |
|
 |
Uminnsky
Joined: 12 Aug 2009 Posts: 26
|
Posted: Sun Aug 23, 2009 11:12 pm Post subject: |
|
|
Check out WinMove
| Code: | Run, calc.exe
WinWait, Calculator
WinMove, 0, 0 ; Move the window found by WinWait to the upper-left corner of the screen. |
|
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 3254 Location: Simi Valley, CA
|
Posted: Mon Aug 24, 2009 2:25 am Post subject: |
|
|
| Code: | Loop ; this will move any newly active windows with the word "Torrent" in their titles to the top of the screen
{
SetTitleMatchMode, 2 ; allows window titles to match if the string appears anywhere in the title
WinWaitActive, Torrent
Sleep 20
WinMove, % A_ScreenWidth // 2, 0
WinWaitNotActive
} |
_________________ Ternary (a ? b : c) guide TSV Table Manipulation Library
Post code inside [code][/code] tags! |
|
| Back to top |
|
 |
|