Jump to content

Initial position of mouse


Recommended Posts

Okay, not looking for code per se, but I need to know how to do a couple things. You see the machine I code on uses resolution 1600x1200, and the machine(s) where the exe's run have various resolutions. I didn't take that into account on my MouseClickDrag statements... The coordinates are hardcoded. So.. here's what I want to know:

1) How do I determine the location of my window relative to the desktop - I'm sure there's a function for that, but I didn't find it.

In this case, my window is another application that I call from RanWait statement, not the autoit script itself.

2) Is there a way to just move the mouse to the title bar of current active window without finding out 1)?

that's really all I need to know as the scripts work fine... it's just that on other PCs, the mouse is just moving, but never clicking the right areas to drag, so I can't see the 8 instances of the program I'm working with.

thanks,

Jack

Edited by laidback01
Link to comment
Share on other sites

Okay, not looking for code per se, but I need to know how to do a couple things. You see the machine I code on uses resolution 1600x1200, and the machine(s) where the exe's run have various resolutions. I didn't take that into account on my MouseClickDrag statements... The coordinates are hardcoded. So.. here's what I want to know:

1) How do I determine the location of my window relative to the desktop - I'm sure there's a function for that, but I didn't find it.

In this case, my window is another application that I call from RanWait statement, not the autoit script itself.

2) Is there a way to just move the mouse to the title bar of current active window without finding out 1)?

that's really all I need to know as the scripts work fine... it's just that on other PCs, the mouse is just moving, but never clicking the right areas to drag, so I can't see the 8 instances of the program I'm working with.

thanks,

Jack

1.

@DesktopWidth

@DesktopHeight

2. WinGetPos() and then move the mouse as necessary...

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

My solution ended up as this:

for $i = 0 to 7
    Run($application)
    WinWaitActive("Meditech Health Care Information System")
    $handle[$i][0] = WinGetHandle("Meditech Health Care Information System")
    if Mod(10+$i,2) = 0 then
        WinMove($handle[$i][0],"",$i*100,0)
    Else
        WinMove($handle[$i][0],"",-100+$i*100,300)
    EndIf
Next

thanks for you help!

Edited by laidback01
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...