Quote:
Originally Posted by Hood
just change the values in these lines:
WinMove,,, 650, 0
to what you want. The first is the X co-ordinate. The second is Y. So you can see that the first hotkey moves it to 0, 0 (the top-left of yourscreen) for example.
just try firing up a few tables, changing around the values, reload the script and see where tables move to when you hit the hotkeys
Here's something that might be easier. Instead of using constants for your coordinates and having to "fiddle around" with them until you get it where you want it, use the window size and screen size to figure out where you want to put them.
Code snippet:
Code:
SysGet, WorkArea, MonitorWorkArea
PgUP::
win:=WinExist("a") ; // get handle of active window
WinGetPos, x, y, w, h ; // get position (use Last Found Window from now on)
xStart%win%:=x, yStart%win%:=y ; // save position
WinMove,,, WorkAreaRight-w, WorkAreaTop
return
Home::
win:=WinExist("a")
WinMove,,, xStart%win%, yStart%win% ; // move back to original position
return
This code will find the size of your screen and whatever window is active (presumably, the table you're wanting to watch), then it will move that window to the upper right hand corner of your screen when you press PGUP. It will also remember where it was, so that when you press HOME, it will move back to where it came from.
If you think you might have, say, 2 windows at once that you want to watch, here's another snippet:
Code:
PgDN::
win:=WinExist("a") ; // get handle of active window
WinGetPos, x, y, w, h ; // get position (use Last Found Window from now on)
xStart%win%:=x, yStart%win%:=y ; // save position
WinMove,,, WorkAreaRight-w, WorkAreaBottom-h
return
This will move the active window to the right hand bottom of the screen, making sure to present itself above the task bar (if you have one at the bottom). You can copy and paste this into the above code, save it all to an AHK file, and try it out.
This code should work on any monitor at any resolution with no fiddling required. If you're ambitious, you might even want to enlarge the window when it moves to a corner and restore it to its former size when it moves back.
It's not hard to do this kind of thing, but you have to spend some time in the AHK documentation. I splashed around in it for nearly a whole day last week when I decided to learn AHK. It's a pretty impressive piece of work, but the math operations are excruciatingly slow. Most of what you'd want to do in AHK doesn't involve much math, though, so that's not a big deal.