Jump to content

Can't read text from window


EddieL
 Share

Recommended Posts

Hi All

I am totally new to AutoIt, trying it for the first time after watching twenty tutorial videos. I need to capture an incoming telephone number on Zoiper Biz so that it can be used by an Ms Access database to retrieve the customer details. However, I cannot make AutoIt read from the window.  I have attached a photo of the window when a call comes in, but I am trying various ways of capturing the text, but all result in an empty variable.

My code is:

$PhoneDetails = ControlGetText("Incoming Call", "", 200454)
$ExtraDetails = ControlGetText("Incoming Call", "", "CLASS:TSecuraxGroupBox.UnicodeClass; INSTANCE:1")
$TelNo = StringLeft($PhoneDetails, 11)
ConsoleWrite("Phone Details: " & $PhoneDetails & @CRLF)
ConsoleWrite("Phone Number: " & $TelNo & @CRLF)
ConsoleWrite("Phone Number: " & $ExtraDetails & @CRLF)
$TryAnotherWay = WinGetText("Incoming Call"ConsoleWrite("Another Way: " & $TryAnotherWay & @CRLF)

 

1896820169_IncomingCall.jpg.291bdbd865275f074377e1ac96b7a495.jpg

 

1987211700_InfoWindow.jpg.732b071eef65383485c14763b5db0d5c.jpg

It lists the text as:

Ignore

Reject

Accept

Caller

I would be very grateful if anyone could help me please.

 

 

Link to comment
Share on other sites

Hi BugFix

Thank you very much for trying to help me.

Can I ask how you can tell there is a label Edit that holds the caller number? I am not arguing, just curious.

$PhoneDetails = ControlGetText("Incoming call", "", "Edit")
$TelNo = StringLeft($PhoneDetails, 11)
ConsoleWrite("Phone Details: " & $PhoneDetails & @CRLF)
ConsoleWrite("Phone Number: " & $TelNo & @CRLF)
$TryAnotherWay = WinGetText("Incoming call")
ConsoleWrite("Another Way: " & $TryAnotherWay & @CRLF)

gives

Phone Details: 
Phone Number: 
Another Way: 
Ignore
Reject
Accept
Caller

Any idea what else I am doing wrong please?

Link to comment
Share on other sites

Another strange thing is that I have used window info on the same control and it is now giving me a different response.

>>>> Window <<<<
Title:    Incoming call
Class:    TIncomingCallReactionF.UnicodeClass
Position:    935, 474
Size:    355, 99
Style:    0x96C00000
ExStyle:    0x00010101
Handle:    0x000E1270

>>>> Control <<<<
Class:    SysListView32
Instance:    1
ClassnameNN:    SysListView321
Name:    
Advanced (Class):    [CLASS:SysListView32; INSTANCE:1]
ID:    265622
Text:    Caller
Position:    0, 0
Size:    349, 38
ControlClick Coords:    94, 27
Style:    0x56000000
ExStyle:    0x00010000
Handle:    0x00040D96

>>>> Mouse <<<<
Position:    1032, 527
Cursor ID:    0
Color:    0x5199ED

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Ignore
Reject
Accept
Caller


>>>> Hidden Text <<<<

Link to comment
Share on other sites

On 11/9/2019 at 5:11 PM, EddieL said:

I need to capture an incoming telephone number on Zoiper Biz so that it can be used by an Ms Access database to retrieve the customer details.

Why don't you use the Zoiper COM API?  That is what it is for.

 

From the Zoiper site:

Quote

Zoiper COM API is designed for use with programming languages, capable to connect to OLE Automation servers. Its purpose is to provide control over Zoiper functions and events, so it could be embedded in other applications.

 

Link to comment
Share on other sites

Hi TheXman

I have tried using the Zoiper API. The link to the Zoiper API for this version of Zoiper is https://www.zoiper.com/downloads/documentation/Zoiper_API_Documentation.pdf.

I can dial a number from the database using the API and I can answer a call with the API, but the only mention it makes of the incoming caller id is in a line state change event.

I have tried to access OnLIneStateEvent but this is an event handler and I have no idea how to do that from vba. Every time I try to reference it I get "Object does not support this method or property".  I tried asking Zoiper but they said their support does not extend to development. 

Link to comment
Share on other sites

4 minutes ago, EddieL said:

I have no idea how to do that from vba.

What does VBA have to do with anything?  You are aware that this is an AutoIt forum, correct?

 

Your last post is made up a statements.  Do you have a question, more specifically, an AutoIt-related question?

 

Link to comment
Share on other sites

The question is in my original post. VBA comes into it as I am controlling  this whole process from a Microsoft Access database. AutoIt seemed a great way to read the incoming caller id as I cannot do it any other way that I know of.

Link to comment
Share on other sites

I agree that AutoIt may be a great way to get incoming call information, but only as it relates to using the Zoiper COM API.  Since I have no idea what your environment looks like, your proficiency with VBA or general coding abilities, and how you are driving this process using MS Access, it is hard to offer much advice.  Are you trying to use AutoItX in MS Access or or you launching an AutoIt script and somehow passing information back to your MS Access DB?  Given the terse snippet that you supplied, I'm unable to tell.

If you are just interested in some direction as to where to begin, if it were me, I would use an AutoIt script, that implements the Zopier COM API, and registers to receive the Zopier COM events using the AutoIt ObjEvent() function.  Which event I would be interested in depends on whether you want information on all incoming calls (OnZoiperCallIncoming) or only accepted calls (OnZoiperCallAccepted).  Both events pass a Call object.  That object includes a Phone property that has the phone number.  Of course you could do all of this using straight VBA code too.

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