Jump to content

Recommended Posts

Posted

Hi,

I am experimenting with the automation of Altair HyperWorks - HyperView.

I used the Au3Info_x64.exe tool to obtain information on a button like control within the application ClassnameNN TkChild130 as a test. I have left the application window open on my desktop.

I then run the following code (this is the entire au3 file):

Opt('MustDeclareVars', 1)
Local $hWnd = WinWaitActive("Untitled - HyperWorks v14.0")
ControlClick ( $hWnd, "", "TkChild130")

I then click on the Altair application (forcing it to become active and tripping the WinWaitActive). As soon as I click the title bar of the application (there are no associated events with this action) I see the control I previously identified as TkChild130 produce a mouse click animation, but the menu system change associated with clicking that control does not happen.

So I know the window handle is correct, and I know the control is the correct ID, but the click event seems to be only partially recognised. I have tried repeating the last line to send 2 consecutive clicks, but there is no change. I can immediately click the control and it provides the menu system update I was expecting.

Is there an issue with interacting with Tk controls? 

I am using this on Win 7 Enterprise, I am not a privileged user (and cannot be).

Thank you in advance.

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Posted

Additional Information:

I see the mouse-click animation is no different to the mouse-over animation... perhaps only the latter is occurring.

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Posted

Apologies for the gentle bump of this. Perhaps I could add to this by asking if anyone has successfully used AutoIt to interact with Tk based controls? i.e. should I give up or invest a little more effort?

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Posted

Can you provide a little more information? I'm fairly sure I have already correctly identified the component. I don't wish to use image based selection or click coordinates (although I accept they may be an answer). Are you suggesting I need to use IUIAutomation?

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Posted

I tried with simplespy and got the following:

  Reveal hidden contents

Which did not seem to work (notice how the instance of the TkChild is not identified). I tried to run the 'Standard code maintainable' but it failed to parse the line:

_UIA_setVar("oP1","Title:=Untitled - HyperWorks v14.0;controltype:=UIA_WindowControlTypeId;class:=TkTopLevel")

SciTE gives: error: Statement cannot be just an expression. (illegal character)

I did not pursue this further.

A quick search showed me some other unresolved posts regarding working with TkChild widgets... perhaps it is not going to work with AutoIt. After my initial posts I noticed a few things:

1) I was wrong, the button click animation is subtly different to the mouseover animation. ControlClick() is causing a mouse over event.

2) If I MouseClick() at the location (returned by Au3Info_x64.exe) it does work, click animation played and menu updates.

3) If I use ControlGetPos(), it returns some values (correct size), but not correct position (the error is not a scalar of control size), so I can't use ControlGetPos() to drive MouseClick(), which I'm sort of glad about as it seems so ugly. 

Any thoughts?

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Posted (edited)

Is the proper rectangle highlighted?

If not try inspect.exe or ranorex spy,

If still issues try trial version of testcomplete from smartbear.

Try orca screenreader

Read http://ocemp.sourceforge.net/papidown.html

But seems atk and spi interfaces which are hard to reach when using windows. Tools fot tkwidgets you probably have to write in python

Edited by junkew
  • 3 years later...
Posted

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@mLipok I never had any success with it, I did manage to highlight the correct widget, but did not have any success activating it from AutoIt: I think I got as far as being able to trip the widget mouseover event, but that was it. 

In the end it wasn't worth it for the time I was spending on it. I didn't reply because of the final line of "But seems atk and spi interfaces which are hard to reach when using windows. Tools fot tkwidgets you probably have to write in python", pretty much summed up where I got to.

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Posted

Sorry, this was from 3 years ago, I've long moved on from that.

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

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