Jump to content

Recommended Posts

Posted

Hi,

Im rather new to AutoIt and am not sure if it has the capability to do what I want. What Im trying to do is wait for a certain window to come up, maximize it and set it as active so that I may use Send() to give commands. There are 2 problems here that Im facing:

1) The full name of the window title is unknown except that it ends with a certain string (thus Im attempting to use WinWaitActive but cant seem to use wildcards or regular expressions).

2) The window might possibly be minimized.

Any ideas?

Thanks!

Posted

Lookup:

WinTitleMatchMode

WinGetState

WinSetState

@SW_MAXIMIZE

WinActivate

WinActive

:whistle:

--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Posted (edited)

Opt("WinTitleMatchMode", 2) ; use any part of the window name
$wintitle = "use any part of the window title here"
$wintext = "use any part of the window text here if needed"
winwait($wintitle, $wintext)
sleep(50)
WinSetState($wintitle, $wintext, @SW_MAXIMIZE)
sleep(200)
WinActivate($wintitle, $wintext)
sleep(50)
send("what ever key you like")

Edited by vollyman
Posted

Thanks.

Although running WinSetState without $wintext gives an error, but setting $wintext to "" seems to solve it (and i dont need to search for text anyway).

Thanks alot guys

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