Jump to content

Coordinates of a button


Recommended Posts

This script created by Varian is getting an error saying Obfuscator support has been discontinued and replaced by Au3Stripper.

He said:

To help you with the coordinates, use this script and browse over the button or area that you wish to be clicked. Exit the script by pressing the Escape key. The information displayed on the exiting message box will be copied to the clipboard for you to paste into a text editor so that you can use it. Just make sure that you use the correct MouseCoord option (window/client). you should also make sure that the window size remains constant...this can be handled using the WinMove() function.

Has anyone converted it to Au3Stripper or can you convert it?

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=\\TEST-PC\D$\Icons\Intellipoint-010.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Created by Varian L.Styles
#AutoIt3Wrapper_Run_AU3Check=n
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/striponly
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
Opt('PixelCoordMode', 2)
Opt('MouseCoordMode', 2)
Opt('TrayIconDebug', 1)
Opt('TrayAutoPause', 0)

#include <Misc.au3>
_Singleton(@ScriptName, 0)
ProcessSetPriority(@AutoItPID, 0)
Global $wPos, $mPos, $mClientPos, $mWindowPos, $Text, $wTitle, $Color

HotKeySet('{ESC}', '_Quit')

While 1
    Mouse_Coords()
    ;Sleep(10)
WEnd

Func _Quit()
    ToolTip('')
    $Text &= 'Mouse Position/Desktop: ' & $$mPos[0] & ',' & $$mPos[1] & @CRLF
    $Text &= 'Mouse Position/Window: ' & $mWindowPos[0] & ',' & $mWindowPos[1] & @CRLF
    $Text &= 'Mouse Position/Client: ' & $mClientPos[0] & ',' & $mClientPos[1] & @CRLF
    $wPos = WinGetPos('[ACTIVE]', '')
    $wTitle = StringLeft(WinGetTitle('[ACTIVE]', ''), 15)
    $Text &= '"' & $wTitle & '" Top-Left Coords: ' & $wPos[0] & ',' & $wPos[1] & @CRLF
    $Text &= '"' & $wTitle & '" Window Size: ' & $wPos[2] & ',' & $wPos[3] & @CRLF
    $Text &= 'Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6)
    ClipPut($Text)
    MsgBox(0, 'Mouse Position Results', $Text)
    Exit
EndFunc   ;==>_Quit

Func Mouse_Coords()
    Local $String
    Opt('MouseCoordMode', 1)
    $mPos = MouseGetPos()
    Opt('MouseCoordMode', 0)
    $mWindowPos = MouseGetPos()
    Opt('MouseCoordMode', 2)
    $mClientPos = MouseGetPos()
    $Color = 'Hex Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6)
    $String &= 'Window Title: ' & StringLeft(WinGetTiTle('[ACTIVE]'), 25) & @LF
    $String &= 'Desktop X: ' & $mPos[0] & ' Y: ' & $mPos[1] & @LF
    $String &= 'Window X: ' & $mWindowPos[0] & ' Y: ' & $mWindowPos[1] & @LF
    $String &= 'Client X: ' & $mClientPos[0] & ' Y: ' & $mClientPos[1] & @LF
    ToolTip($String & $Color)
EndFunc   ;==>Mouse_Coords

Thanks,

Docfxit

Link to comment
Share on other sites

This works without the Obfuscator, and, correcting the syntax from"$$" to "$", twice.

Pressing "F1" while the cursor is over "#Au3Stripper_Parameters=" in SciTE will explain the parameters used.

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=\\TEST-PC\D$\Icons\Intellipoint-010.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Created by Varian L.Styles
#AutoIt3Wrapper_Run_AU3Check=n
;#AutoIt3Wrapper_Run_Obfuscator=y
;#Obfuscator_Parameters=/pe/sf/mo/rm
#AutoIt3Wrapper_Run_Au3Stripper=y  ; Default is n
#Au3Stripper_Parameters=/pe/sf/mo/rm
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Misc.au3>

Opt('PixelCoordMode', 2)
Opt('MouseCoordMode', 2)
Opt('TrayIconDebug', 1)
Opt('TrayAutoPause', 0)

_Singleton(@ScriptName, 0)
ProcessSetPriority(@AutoItPID, 0)
Global $wPos, $mPos, $mClientPos, $mWindowPos, $Text, $wTitle, $Color

HotKeySet('{ESC}', '_Quit')

While 1
    Mouse_Coords()
    ;Sleep(10)
WEnd

Func _Quit()
    ToolTip('')
    $Text &= 'Mouse Position/Desktop: ' & $mPos[0] & ',' & $mPos[1] & @CRLF
    $Text &= 'Mouse Position/Window: ' & $mWindowPos[0] & ',' & $mWindowPos[1] & @CRLF
    $Text &= 'Mouse Position/Client: ' & $mClientPos[0] & ',' & $mClientPos[1] & @CRLF
    $wPos = WinGetPos('[ACTIVE]', '')
    $wTitle = StringLeft(WinGetTitle('[ACTIVE]', ''), 15)
    $Text &= '"' & $wTitle & '" Top-Left Coords: ' & $wPos[0] & ',' & $wPos[1] & @CRLF
    $Text &= '"' & $wTitle & '" Window Size: ' & $wPos[2] & ',' & $wPos[3] & @CRLF
    $Text &= 'Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6)
    ClipPut($Text)
    MsgBox(0, 'Mouse Position Results', $Text)
    Exit
EndFunc   ;==>_Quit

Func Mouse_Coords()
    Local $String
    Opt('MouseCoordMode', 1)
    $mPos = MouseGetPos()
    Opt('MouseCoordMode', 0)
    $mWindowPos = MouseGetPos()
    Opt('MouseCoordMode', 2)
    $mClientPos = MouseGetPos()
    $Color = 'Hex Color: ' & Hex(PixelGetColor($mClientPos[0], $mClientPos[1]), 6)
    $String &= 'Window Title: ' & StringLeft(WinGetTiTle('[ACTIVE]'), 25) & @LF
    $String &= 'Desktop X: ' & $mPos[0] & ' Y: ' & $mPos[1] & @LF
    $String &= 'Window X: ' & $mWindowPos[0] & ' Y: ' & $mWindowPos[1] & @LF
    $String &= 'Client X: ' & $mClientPos[0] & ' Y: ' & $mClientPos[1] & @LF
    ToolTip($String & $Color)
EndFunc   ;==>Mouse_Coords

 

Link to comment
Share on other sites

junkew

 

I wanted to get it running.  I also tried for hours to get au3_uiautomation-master to work.  I couldn't figure it out for the life of me.

I downloaded it.  I tried to run spy.au3.  The browse tool does come up. After I drag it to the button and let go of the mouse nothing happens.

Thanks,

Docfxit

Link to comment
Share on other sites

Thanks for the reply...

I'm getting an error with Inspect.exe.  I'm guessing it is looking for a 64bit ver.  I am running a 32bit ver of Win7.

Where can I download the 32bit version?

Thank you,

Docfxit

Link to comment
Share on other sites

10 hours ago, junkew said:

Thanks for the link to the search for Simplespy.  I haven't been successful in finding simplespy.au3 .  I did find the page:

It does say on post #1 " Simple spy demo (see simplespy.au3 or use latest ZIP  attachment for latest version) "

I can't find the ZIP file.  Is the zip file called simplespy or is it called something else.

When I select " Quickstart - Getting started quickly "

It takes me to post #3.  It says " Start simplespy.au3"  It doesn't say where to download it.

I have been searching for simplespy.au3 for days. 

While it is really great to learn how to search for something relating to AutoIt, I just can't find the download.

I also can't find the download for Inspect.exe 32bit.  Does it exist some where?  Or is there only a 64bit version?

Please provide me a link directly to the download so I can figure out why I am having a hard time locating it.

Thank you,

Docfxit

Edited by Docfxit
Link to comment
Share on other sites

What is the name of the zip file?

I have read your link on FAQ 31.  I can't find the zip file that has simplespy.au3

On that page I have searched all links with zip in it.  Which file is the one with Simplespy.au3?

Thanks,

Docfxit

Link to comment
Share on other sites

I found in order to run simplespy.au3 you must have UIAwrappers.au3 and CUIAutomation2.au3 in the same folder as simplespy.au3.

I found those located in the au3_uiautomation-master folder. 

When I run it, I get: Error Unknown function name: $uia_classnamepropertyid.

Does anyone know where I can find that function?

Thank you,

Docfxit

Link to comment
Share on other sites

you have to use both zips as is in post #1 as previously given attached to the bottom of post #1 just like any attachments are at the end of a post. 

They contain the library and the examples as 1 package that belongs to each other otherwise you can get strange behaviour.

 

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

×
×
  • Create New...