jimmyjmmy Posted April 21, 2007 Posted April 21, 2007 Hi, I want to drag the window to a certain position such as top right, what method should I do. I can think of a function that can do the above, MouseClickDrag , but I worry that for whatever the reason, if the window changed position then my mouse may start the drag at the wrong position. Thanks
jimmyjmmy Posted April 21, 2007 Author Posted April 21, 2007 WinMove() will do it. Thanks MHz,Assuming I want to move the active window to the top right hand corner, to know the exact x and y position, I need to move my pointer to get the x and y corordinates. The y coordinate will always be zero but the x coordinate varies and it depends on the width of the active window.Are there any other methods which will allow me to put, very accurately, the active window to the top right hand corner of the screen, without me having to input the x and y coordinates.Again I noted that the x coordinate is referring to the top left corner of the active window. Are there any command for me to allign the top right corner of the active window to the top right corner of the screen?Thanks
Helge Posted April 21, 2007 Posted April 21, 2007 Hmm... @DesktopWidht - $width ? Opt("WinTitleMatchMode", 4); classname=... Run("calc.exe") WinWait("classname=SciCalc") $pos = WinGetPos("classname=SciCalc") If @error Then Exit WinMove("classname=SciCalc", "", @DesktopWidth - $pos[3], 0)
jimmyjmmy Posted April 21, 2007 Author Posted April 21, 2007 ok, regarding my above post, this is what I got to put the active window at the top right hand corner of desktop. $desktopSize = WinGetClientSize ( "Program Manager") WinMove("GOTCHA!","",$desktopSize[0] - 389,0,389,410)
jimmyjmmy Posted April 21, 2007 Author Posted April 21, 2007 ...............WinMove("classname=SciCalc", "", @DesktopWidth - $pos[3], 0)[/Good idea! Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now