Sign in to follow this  
Followers 0
traltixx

using WinWaitActive within a string; maximize a minimized window

5 posts in this topic

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!

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

#3 ·  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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Also I noticed that AutoIt does not work when a windows machine is locked.

Is this intended or hard to get around?

Thanks again!

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  
Followers 0