Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Help with _IsPressed only active when in a certain field box

$
0
0
I am trying to work between two separate applications where if a control box in application 1 is selected, via the {END} button, it will send the contents over to application 2. The contents it is capturing is a phone number.

My problem though is with my winactive call outs. If I am not on the phone number box and am within a different box within the application and click {END}, it will copy the phone number text and send it over. I only want the {END} key to work when the cursor is in the "EDIT1" box, otherwise function as normal. Here is the window information along with my current piece of code. Could someone please help me on this? I believe my issue is with the active windows but am just drawing blanks.

>>>> Window <<<<
Title: Call Logging - [Work Group - 1 of 1]
Class: BENDATAWINHEAT
Position: 129, 0
Size: 850, 979
Style: 0x14CF8000
ExStyle: 0x00000100
Handle: 0x00500800

>>>> Control <<<<
Class: Edit
Instance: 1
ClassnameNN: Edit1
Name:
Advanced (Class): [CLASS:Edit; INSTANCE:1]
ID: 500
Text:
Handle: 0x000B1312

[ autoit ]      
#include Opt("WinTitleMatchMode", 2) Opt("SendAttachMode",1) Local $hDLL = DllOpen('user32.dll') While 1 If _IsPressed('23', $hDLL) Then WinWait ("[TITLE:Call Logging; CLASS:BENDATAWINHEAT]", "", 5) Sleep(500) local $click = ControlGetText("[CLASS:BENDATAWINHEAT]", "", "Edit1") Sleep(500) MsgBox(0, "ControlGetText", "The control text is: " & $click) ;WinActivate("[TITLE:Communicator; CLASS:WindowsForms10.window.8.app.0.3ce0bb8]") <<<<< This is the second application that will replace the msg box once I figure out the first part ;Send($click)<<<< EndIf WEnd DllClose($hDLL)

Viewing all articles
Browse latest Browse all 12506

Trending Articles