Jump to content

Recommended Posts

Posted

I am able to use MouseClick to select a TextBox on another application, however I need its ID number to enter a string directly on it (it doesn't have any Title therefore I can't use ControlFocus on it) !

Anyone know any method to find it? Thanks to any help  :sweating:

Posted (edited)

Hi Danp2,

I have verified a lots functions about GUI controls but I have been  in vain  (ie: http://www.autoitscript.com/autoit3/docs/functions/), as I mentionned before those functions required Title or handle which I don't have it 

*) I only can file its related values by using _EnumList function (ID & class), but since it doesn't have the title & the class name having the same with other items (Child windows) therfore I can't get which ID is right (only identifying it by viewing directly to it)

Edited by Curious52
Posted

After clicking the control ("TextBox") in your script, try using:-

ControlSend("", "", "", "The string to be sent")
 

Here is an example script which works.

; Run script then:-
; Select (click on) the "TexBox" you wish to send a string to.
; Press "Alt" key and "c" key together to send the string "Sent Text" to the selected "TexBox".
; Press the Esc key to quit.
HotKeySet("{ESC}", "Terminate") ; Esc
HotKeySet("!s", "_Send") ; Alt+ s

Local $a

While 1
    Sleep(100)
WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

Func _Send()
    ControlSend("", "", "", "Sent Text")
    ;...........^ The first "" will select the title of the currently active window on which the control can be found.
    ; The third "" will select the id of the currently active, or selected, control - the "TexBox".
EndFunc   ;==>_Send
Posted

I believe this >

; Press "Alt" key and "c" key together to send the string "Sent Text" to the selected "TexBox".

should read >

; Press "Alt" key and "s" key together to send the string "Sent Text" to the selected "TexBox".

REB

MEASURE TWICE - CUT ONCE

Posted

Try something like this:

#include <WinAPI.au3>
Run("notepad.exe")
WinWait("[CLASS:Notepad]")
Local $sControl = ControlGetFocus("[ACTIVE]")
;~ MsgBox(0, "ControlGetFocus Example", "The control that has focus is: " & $sControl)
$hControl = ControlGetHandle("[ACTIVE]","",$sControl)
$iControl = _WinAPI_GetDlgCtrlID($hControl)
ConsoleWrite($iControl & @CRLF)
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

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...