Jump to content

Newbie Question: Using ClassNameNN


Wardio
 Share

Recommended Posts

Hello, probably sounds like a silly question, but want to use the ClassNameNN as the determinant of what object to click on (the ControlID changes each run and it doesn't have a text name), but i don't seem to be able to use it, just does nothing.

Also would like to use the ControlSend (which i believe you're mean't to use when not using a gui?) but that doesn't seem to work, though i think that's because of the above problem :whistle:

Any help much appreciated!!

Cheers,

Tom

Link to comment
Share on other sites

  • Moderators

Kind of hard to help when you've provided no information. ie... Name of the application your trying to interact with and or any code you are using to interact with it.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Ok, i didn't think that was really important surely? Anyways... here's a snippet of code that i want to use the ClassNameNN for, the app is a proprietary company application, don't have source for hence using autoIt!

WinWait( WinGetHandle( $mainappname ) )


ControlSend($mainappname,"","","!w")
ControlSend($mainappname,"","WindowsForms10.MDICLIENT.app31","{DOWN}")
ControlSend($mainappname,"","WindowsForms10.MDICLIENT.app31","{DOWN}")
ControlSend($mainappname,"","WindowsForms10.MDICLIENT.app31","{ENTER}")
;Send("!w") //code to change to use ClassNameNN
;Send("{DOWN}")
;Send("{DOWN}")
;Send("{ENTER}")

Kind of hard to help when you've provided no information. ie... Name of the application your trying to interact with and or any code you are using to interact with it.

Edited by Wardio
Link to comment
Share on other sites

  • Moderators

Ok, i didn't think that was really important surely?

:whistle: So you're saying that you think you've provided enough information originally to provide you with a good reason on why your mysterious app wasn't accepting control commands?

Anyways... here's a snippet of code that i want to use the ClassNameNN for, the app is a proprietary company application, don't have source for hence using autoIt!

WinWait( WinGetHandle( $mainappname ) )
ControlSend($mainappname,"","","!w")
ControlSend($mainappname,"","WindowsForms10.MDICLIENT.app31","{DOWN}")
ControlSend($mainappname,"","WindowsForms10.MDICLIENT.app31","{DOWN}")
ControlSend($mainappname,"","WindowsForms10.MDICLIENT.app31","{ENTER}")
;Send("!w") //code to change to use ClassNameNN
;Send("{DOWN}")
;Send("{DOWN}")
;Send("{ENTER}")
I wasn't asking for the apps source ;), I was asking for what you've semi provided.

It's hard to help if we don't know what to try and make it work on ourselves. No application to test why your running into the situation, no workable code (we don't even know what $mainappname is or if you are using it correctly.)

The only thing I can say with what you've provided is... try ControlFocus() before you use ControlSend(), maybe even a sleep.

You also may want to look at the help file and know that:

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

So the $mainappname is a variable with the apps title name, which i use earlier to activate the pane on the window computer. Is set as:

$mainappname = "JUICE"

Which is the name of the app i'm automating.

I'm pretty sure the control should be able to be automated, is a dotNet app and the code snippet i'm trying this approach on is a toolbar, which i'm pretty sure is standard.

I'll try putting some sleeps in and use ControlFocus(), was just really making sure that this is the correct way of using the ClassNameNN name of the control to send a command to, if i am then bonus :whistle:

Basically am trying to change this over so that hopefully i dont need a remote window open on the server i run this on, so that it's truely automating (i've done another post with the problems i'm having there!).

Cheers,

tom

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