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 

New Window Placement Upon Open

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
dollarcoin
Guest





PostPosted: Sun Aug 23, 2009 10:54 pm    Post subject: New Window Placement Upon Open Reply with quote

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

PostPosted: Sun Aug 23, 2009 11:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 3254
Location: Simi Valley, CA

PostPosted: Mon Aug 24, 2009 2:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
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