Jump to content

Getting X & Y position of a separate program


Go to solution Solved by mLipok,

Recommended Posts

Posted (edited)

I've done some search but I've come across nothing. To put it simply of what I am trying to accomplish is that I need to get where the window is so I can set the mouse to a specific location. I already know how to move the mouse but I have no idea how to get the x and y position of a separate window.

 

Several more things

 

1. How would I bring that window (using the process name I would guess) to the front?

 

2. How would I do something along the line of a settings file?

 

3. Is emulating a mouse actually moving as simple as checking if the current mouse x and y is less than or greater than the destination then just adding/subtracting a specific amount to give it the illusion of it moving?

 

here is my function I use to move the mouse, let me know if there is a way to automatically emulate movement. Thank you for your time :)

Func moveMouseTo($toX, $toY)
    Local $pos = MouseGetPos()
    MouseMove($pos[0] + $iX, $pos[1] + $iY, 0)
EndFunc   ;==>moveMouseTo
EDIT:

Nvrm about the 3rd one, I found the MouseMove function through a little bit of searching

Edited by ThatBenderGuy
Posted (edited)
  On 11/16/2013 at 7:55 PM, ThatBenderGuy said:

2. How would I do something along the line of a settings file?

 

do you mean INI file ?

Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

  On 11/16/2013 at 8:21 PM, mlipok said:

do you mean INI file ?

It can be an ini or a txt it doesn't matter. The general setup of the settings file would be

setting1=value

setting2=another value

etc...

Just something so a user doesn't have to click a check box or similar when the script is ran.

  • Solution
Posted (edited)

check for INI.... in HelpFile

http://www.autoitscript.com/autoit3/docs/functions.htm

Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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
  • Recently Browsing   0 members

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