Jump to content

Can I communicate with these controls?


Recommended Posts

Heyas,

I am trying to insert data into an external application but I can't get the following script to work no matter combination of class references and title references I make to the specified window, see the attachments.The picture with the highlight is what I am trying to insert text into.

Any assistance is welcome.

Thank you.

Script.au3

 

Picture.PNG

Edited by ausssieautomate
Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)
Link to comment
Share on other sites

Hi  Jdelaney,



Not sure what you mean but I tried entering in the handles of the textboxes directly   ControlSetText($hWnd, "", "0x00210194", "sdfdsa"), unfortunately that doesn't work either.



Thank you.

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)
Link to comment
Share on other sites

I have had better luck using the Advanced Mode Name (Class Identifier) given with things like this. (NAME u.Qute No.)

If you have tried this and failed it might just be a syntax issue.

Edit: Maybe an obvious point, but for sanity's sake you could try ControlSend

 

Edited by l3ill
Link to comment
Share on other sites

First things first.

  • Does the WinActivate work? (If you background the window, then run the script, does it make it active?)
  • Is the ClassNameNN always the same or does it change every time you start the program, if the latter, is there a part that is always the same? (That is where the regex matching may come in handy, see below)
  • Is the What does the ControlGetText return? 

About regex: you can use REGEXPCLASS instead of CLASS or CLASSNN to specify a regular expression which the classname of the targeted control has to match, instead of a literal match. If you don't know what a regular expression is, check the wiki or google for a myriad of tutorials/explanations etc.Very useful if you need to define a pattern of text to look for that is more complicated than just a direct substring.

On a personal note: Brisbane! Going there in two weeks for a pedal steel guitar "festival" (quotes because the organizer may be exaggerating) :) I'll be there for a weekend.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Hi SadBunny,

Your advice has helped me do some further analysis yes the classname in question changes between 2 values:

WindowsForms10.Window.8.app.0.2bf8098_r34_ad1

WindowsForms10.Window.8.app.0.2bf8098_r36_ad1

Bearing this in mind the following line should work but it doesn't any ideas :(:

ControlSend($hWnd, "[REGEXPCLASS:WindowsForms10\.Window\.8\.app\.0\.2bf8098_r3[64]_ad125]", "testing")

Also Winactivate works, so no issues there.

Thank you.

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)
Link to comment
Share on other sites

Hi I3Bill,

Thanks for the update no Advanced Mode Name (Class Identifier) didn't work either :(.

My last hope is the regex route. 

ControlSend($hWnd, "[REGEXPCLASS:WindowsForms10\.Window\.8\.app\.0\.2bf8098_r3[64]_ad125]", "testing").

Two possible values from the selected field:

WindowsForms10.Window.8.app.0.2bf8098_r34_ad1

WindowsForms10.Window.8.app.0.2bf8098_r36_ad1

Can someone review my ControlSend command, should this work or is something missing?

Thank you. 

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)
Link to comment
Share on other sites

1) I know I asked it before, but what does the ControlGetText return? (Or rather: can you get it to return the text in that control?)

2) Your regex looks fine, but it describes the legacy CLASSNN string, which is the CLASS + INSTANCE. I'm not sure but I don't think it works that way (didn't test it). I think you have to use the REGEXPCLASS to define the actual classname (apparently ending in ad1), and then the INSTANCE to specify the actual instance (though I believe that's optional if there's only one instance of that class).

Roses are FF0000, violets are 0000FF... All my base are belong to you.

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