Jump to content

Control/Focus issue with a window of class #32770


aPete
 Share

Recommended Posts

I'm trying to update a script that was written ~5 years ago by someone else to automate a software installation in order to make it work with Win10.  The problem I'm having is that the software in question pops up a window of class #32770 in order to allow the user to input registration information, and nothing I've tried so far has worked.  I'm able to user ControlGetText to read from it, but ControlFocus returns 0 (failure) whenever I try to use it, and ControlSend and ControlSetText both result in nothing happening.  Pointing ControlClick at the various controls in the window always results in Edit1 appearing to have focus, no matter which control it's actually targeted at.  Plain old Send doesn't do anything, even when one of the Edit controls appears to have focus.

Googling pulled a few discussions around #32770 windows, but none of them were direct matches for my situation, and none of the solutions proposed in those discussions worked for me.

The actual script is more complex, but the bare bones of the problem are that the following snippet doesn't work:

WinActivate($windowHandle)

ControlFocus($windowHandle, "", "Edit1")

ControlSend($windowHandle, "", "Edit1", $textThatNeedsToBeEnteredInEdit1)

substituting ControlSetText for the ControlSend doesn't help, nor does using Send, and as mentioned above, ControlFocus returns 0, so it's failing.  Oddly, if put a ControlGetText line in the script, manually type something into one of the fields, and then run the section of the script I'm trying to debug, I'm able to capture text from the field, so obviously I've got the right window handle and the right control names/IDs.  Anybody have any idea on why the methods to actually interact with the window's controls won't work but the method to read from them will?

The only things that stick out to me as potentially weird about the situation are that I'm writing and compiling the script on a Win7 machine and running it on a Win10 machine, and that the window in question is (I think) a child of one of the previous windows in the script.  Could those things be a part of the problem, and if so, is there a reasonable workaround?

Thanks for any help anyone can provide.

Link to comment
Share on other sites

Weird but maybe start 2 instances of simplespy at same time then one instance of simplespy will not get paused when you hover the simple spy tray icon..

I can spy all icons in systray and submenus and highlight them.

See also this one

 

Edited by junkew
Link to comment
Share on other sites

For the original install of the program - is there any way within the software to automate installation? Some parameter or perhaps setting up a TRANFORM file or an "answer" file? This would be better than automating a button click in AutoIt. If you go to IT Ninja you can find out about installation parameters for a lot of different software.

Who lied and told you life would EVER be fair?

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