Jump to content

Get text from specified position


EssDee
 Share

Recommended Posts

Hi

Is it possible to get text from a specified position (area) on the screen? I don't want to copy the position and get it as a picture, I need the text to put it in a text-file.

/EssDee

ControlGetText might do the job.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Something like:

#include <WinAPI.au3>
$active = WinGetHandle ("[ACTIVE]")
$window = WinGetPos ($active)
$mouse = MouseGetPos ()
$tpoint = DllStructCreate("int X;int Y")
DllStructSetData ($tpoint, "X", $mouse[0])
DllStructSetData ($tpoint, "Y", $mouse[1])
_WinAPI_ScreenToClient ($active, $tpoint)
$x = DllStructGetData($tpoint, "x")
$y = DllStructGetData($tpoint, "Y")
_WinAPI_EnumWindowsInit()
_WinAPI_EnumWindowsChild($active, True)
For $i = 1 to $winapi_gaWinList[0][0]
    $ctrl = ControlGetPos ($active, "", $winapi_gaWinList[$i][0])
    If $ctrl[0] >= $x AND $ctrl[0] <= ($x + $ctrl[2]) Then
        If $ctrl[1] >= $y AND $ctrl[1] <= $y + $ctrl[3] Then
            MsgBox (0, "", "EUREKA!")
        EndIf
    EndIf
Next

EDIT: May, may not work. Just threw it together... :D

Edited by Bert
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...