Jump to content

Cannot carry out commands on pop-up


jwp973
 Share

Recommended Posts

Hi all,

I am relativley new to programming, but i discovered AutoIt a couple of months ago and i must say i am really impressed with its functionality and ease of use, i have been using it more and more! Everything has been going relativley smoothly until just recently....

I have a pop-up window in a CAD program that I am using and I cannot for the life of me manage to carry out ANY AutoIt commands on it. The window is called “[Analysis Information]”, and it has a listbox within it displaying some results which i want to access. However it seems as if AutoIt does not acknowledge its existence at all. However when I run the winlist() function:

#include<array.au3>

$aWins = WinList()

_ArrayDisplay($aWins)

It is listed as entry #45 as an active window and also gives the window’s handle. But any attempts to carry out simple commands of any kind (winmove, winkill, winactive etc) on this window simply does not work, even if I try carrying them out by specifying the handle.

This seems very frustrating as I have been able to carry out similar tasks with AutoIt, but now im having this problem for the first time. And the window does not seem to be a 'non-standard' windows window (i.e the window information tool can return information of buttons/lists etc but i cannot carry out any commands on them)

Has anyone had similar problems to this? Can anyone offer some advice?

Thanks for your time

Joe

Edited by jwp973
Link to comment
Share on other sites

I found a solution to my own problem here, was just playing around with the window commands and got them to work by deleting the last term from the "name" section

i.e

WinKill("[Analysis Information]") ;did NOT work

WinKill("[Analysis Information") ; DID work

what makes it all the more bizzare is the fact that [Analysis Information] is the given name in the window info tool.

strange result but oh well at least it works

Link to comment
Share on other sites

I found a solution to my own problem here, was just playing around with the window commands and got them to work by deleting the last term from the "name" section

i.e

WinKill("[Analysis Information]") ;did NOT work

WinKill("[Analysis Information") ; DID work

what makes it all the more bizzare is the fact that [Analysis Information] is the given name in the window info tool.

strange result but oh well at least it works

Interesting result. Perhaps having square brackets around both ends of the title makes it look like an advanced window specification to AutoIt. For example: "[CLASS:AutoIt GUI; TITLE:Analysis Information]"

It's pretty easy to replicate your symptoms:

Global $hGUI, $hTest

$hGUI = GUICreate("[Test Me]", 200, 200)
ConsoleWrite("$hGUI = " & $hGUI & @LF)
GUISetState()
Sleep(1000)

$hTest = WinGetHandle("[Test Me]")
ConsoleWrite("First try:  $hTest = " & $hTest & @LF)
WinKill("[Test Me]")
Sleep(1000)

$hTest = WinGetHandle("[Test Me")
ConsoleWrite("Second try:  $hTest = " & $hTest & @LF)
WinKill("[Test Me")
Sleep(2000)

The AutoIt interpreter applies something like a RegExp to the $sWinTitle parameter to determines if it has a simple string or an advanced window specification. Maybe it needs some tweaking to make it more descriminating.

:D

Edit: I am informed the internals do not use a regular expressions for this particular function, though you can invoke a RegExp by using the keywords REGEXPTITLE or REGEXPCLASS in and advanced spec. See "Window Titles and Text (Advanced)" in the help file.

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...