Jump to content

Autoit when the window has no name


Recommended Posts


I think you need to set the script to run in Mode 4. From the AutoIt help file:

In this mode special sequences are used in the title parameter so that window classnames and handles can be used.

I know I have done it, but I'll be danged if I can find an example for you, sorry. :no: Search "Window Titles and Text" in help and read the section regarding Advanced Mode. Maybe others can come up with a script example?

Link to comment
Share on other sites

this is prolly pretty crappy coding but it got the job done

Run ("Setup.exe")
Sleep (50000)
WinWait ( "" , "Introduction"  )
Sleep (10000)
ProcessClose ( "setup.exe" )
ProcessClose ( "setup.exe" )

i know nothing about autoit so this was even a strech for me.

Link to comment
Share on other sites

Yeah, the problem with sleep is that it's always too long on a fast machine and never long enough on a slow machine. :lol:

Which program are you working with? I'd be happy to take a look if I can help.

I still use the "old" version of AutoIt for about half of my scripts, as Au3 appears so convoluted to a non-coder like me. Au3 does have its moments, however, like its ability to completely hide batch files, e.g.:

Run( @ScriptDir & "\cleanup.cmd", "", @SW_HIDE)

and eject the CD after the install:

$driveArray = StringSplit("DEFGHIJKLMNOPQRSTUVWXYZ", "")
For $i = 1 To 23
$opened = CDTray($driveArray[$i] & ":", "open")
If $opened Then ExitLoop
Next
If NOT $opened Then
Shutdown(6)
EndIf

I suspect Au3 aficionados are going to scream, but those are the only two features that I prize, together with the cleaner looking message boxes, e.g.:

SplashTextOn("", "" & @CRLF & "Installing Microsoft Money 2005 Premium..."  & @CRLF & ""   & @CRLF & "Please wait..."  & @CRLF & "", 275, 90, -1, -1, 1, "Arial", 12, 12)
Sleep(4000)
SplashOff()

Those three, and a few others, have a place in my AutoIt snippet library.

Link to comment
Share on other sites

and eject the CD after the install:
$driveArray = StringSplit("DEFGHIJKLMNOPQRSTUVWXYZ", "")
For $i = 1 To 23
$opened = CDTray($driveArray[$i] & ":", "open")
If $opened Then ExitLoop
Next
If NOT $opened Then
Shutdown(6)
EndIf

I suspect Au3 aficionados are going to scream, but those are the only two features that I prize, together with the cleaner looking message boxes

Those three, and a few others, have a place in my AutoIt snippet library.

Eject CD with just the necessary code.

$driveArray = DriveGetDrive('CDROM')
If Not CDTray($driveArray[1], 'open') Then Shutdown(6)

Au3 aficionados benefit from learning more. B)

Link to comment
Share on other sites

  • 3 weeks later...

I think your talking about this for a window without a Title:

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title:

Class: #XXXX

Size

>>>>>>>>>>>>>>>>>>>

Start of Example:

AutoItSetOption("WinTitleMatchMode", 4)

; Get the handle window for a

$handle = WinGetHandle("classname=#XXXX")

; Send some text directly to this window's edit control

ControlClick($handle, "", "Button3")

End of example;

Hope that helps :).

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...