Jump to content
Sign in to follow this  
surferdog

unable to send keystroke to popup window

Recommended Posts

surferdog

Good afternoon. I am attempting to configure a piece of software and need to interact with a popup window but am unable to with my limited knowledge of autoit. I have the software install scripted but am having this issue when trying to simply send a "yes" to an error or popup window. I open a treeview in the installed software with the following code:

#include <GuiTreeView.au3>

Run("C:\IngresII\ingres\bin\vdba.exe")
WinWaitActive('Ingres Visual DBA [II]','List of Virtual Nodes')
ControlTreeView("Ingres Visual DBA [II]", "", "[CLASS:SysTreeView32; INSTANCE:1]", "Expand", "Nodes")

This works as expected and a popup occurs which is also expected to continue the config however I am unable to send a keystroke to this popup window through autoit but can send a manual keyboard keystroke to it. I am able to get info from the Window tool on this popup but am at a crossroads on how to interact with it and everything i've tried has failed to get a focus on the window. Neither a send or controlsend work and WinWaitActive and WinActivate have no effect on the window. I'm not sure if anyone is able to assist but thanks in advance anyways. Have a great weekend.

Here's the Window Info:

>>>> Window <<<<

Title: Error

Class: #32770

Position: 155, 228

Size: 503, 133

Style: 0x94C801C5

ExStyle: 0x00010101

Handle: 0x002601BE

>>>> Control <<<<

Class: Button

Instance: 1

ClassnameNN: Button1

Advanced (Class): [CLASS:Button; INSTANCE:1]

ID: 6

Text: &Yes

Position: 170, 67

Size: 75, 23

ControlClick Coords: 44, 17

Style: 0x50030001

ExStyle: 0x00000004

Handle: 0x001E01B2

>>>> Mouse <<<<

Position: 372, 341

Cursor ID: 2

Color: 0xECE9D8

>>>> StatusBar <<<<

>>>> Visible Text <<<<

&Yes

&No

Your Ingres Installation must be started before trying to get the list of nodes or connect.

Do you want to start it now ?

(If not, you only will be able to load an environment)

>>>> Hidden Text <<<<

post-47340-1238787485_thumb.gif

Edited by surferdog

Share this post


Link to post
Share on other sites
Authenticity

What about:

$sText = 'Your Ingres Installation must be started before trying to get ' & _
        'the list of nodes or connect.' & @CRLF & 'Do you want to start it now ?' & _
        @CRLF & '(If not, you only will be able to load an environment)'

WinWaitActive('Error', $sText)
$hWnd = WinGetHandle('Error', $sText)
ControlClick($hWnd, '', '[CLASS:Button; INSTANCE:1]')

Share this post


Link to post
Share on other sites
surferdog

Thanks Authenticity but same result. I appreciate the effort.

Share this post


Link to post
Share on other sites
surferdog

Thanks Jos...no go. Here's a dumb question but could there be an issue with the popup being titled "Error"?

Share this post


Link to post
Share on other sites
Authenticity

Don't think so. I think it's what Jos is pointing on, probably because the MessageBox API is called with the the first parameter set to the window's handle (it's now a child of it in other words) the Win* functions can see him by default. That can be examined using WinSpy to see the windows hierarchic of the process.

Share this post


Link to post
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
Sign in to follow this  

×