Sign in to follow this  
Followers 0
laidback01

Initial position of mouse

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Looks more like WinMove is what I'm trying to do.. thanks for the reply though.

Share this post


Link to post
Share on other sites

Like this...

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


Opt("MouseCoordMode", 0)        ;1=absolute, 0=relative, 2=client


Run("notepad.exe")
WinWaitActive("")

MouseMove( 1,1)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0