 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Dolman
Joined: 18 May 2008 Posts: 2
|
Posted: Sun May 18, 2008 4:57 pm Post subject: [Solved] Moving and setting dimensions for windows |
|
|
Hey guys, this is such and easy problem, but I can't seem to get it to work by just looking at the help file.
My end goal is to have a script that when I open it, it will run two seperate programs, and position and size them so that both are visible on the screen.
To get started, I'm just toying around with paint and keeping it simple.
| Code: | Run, mspaint.exe
Winwait, paint
winrestore, paint
WinMove, 10, 10 |
This does open and restore paint, but it doesn't move it 10/10 away from the top left corner of the screen. Why?
Thanks!
Jared
Last edited by Dolman on Sun May 18, 2008 9:41 pm; edited 1 time in total |
|
| Back to top |
|
 |
interiot
Joined: 06 Nov 2005 Posts: 64
|
Posted: Sun May 18, 2008 7:28 pm Post subject: |
|
|
This tells you what's happening. (or, more accurately, it doesn't tell you anything, which is most informative)
| Code: | Run, mspaint.exe
Winwait, paint
; tell us which window it found
WinGetClass, class
MsgBox, found window %class% |
Your script is stopping forever at the WinWait line, because it never matches a window. By default, when you search for windows by title, the string you use must match the beginning of the title. So, changing it to this makes it work most of the time:
| Code: | | WinWait, untitled - Paint |
If you want to be super-meticulous though, this will always work:
| Code: | Run, mspaint.exe, , pid
WinWait, ahk_pid %pid% ahk_class MSPaintApp |
|
|
| Back to top |
|
 |
Dolman
Joined: 18 May 2008 Posts: 2
|
Posted: Sun May 18, 2008 9:41 pm Post subject: |
|
|
Great! Your advice worked-- I had to tinker with some things to get my apps to work, but in the end everything is working perfect!
| Code: | Run, C:\Music\Powertab\PTEditor.exe
WinWait, Untitled - Power Tab Editor 1.7
winrestore, Untitled - Power Tab Editor 1.7
Winactivate, Untitled - Power Tab Editor 1.7
WinMove, A,, -1, 190, 1285, 838
Run, C:\Program Files\Transcribe!\Transcribe.exe
WinWait, Transcribe!
winrestore, Transcribe!
Winactivate, Transcribe!
WinMove, A,, -2, 0, 1285, 190 |
Thanks for your help! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|