Jump to content

maximize 2 windows when the are not maximized


Recommended Posts

Hello y'all,

It's been a while since i coded in autoit. I am looking for a way to maximize 2 windows (on 2 screens) when they are not maximized.

So:

[begin loop]

If Internet Explorer is not maximized -> then maximize it

If Windows mediaplayer is not maximized -> then maximize it

sleep 60 seconds

[goto beginning of loop]

Is this possible without having to know the title of the windows mentioned above? (regardless of what website/video-clip is opened)

Both windows are on a different monitor (and have been maximized there but occasionaly get "smaller" by a windows update notification which pops up from time to time)

?

Link to comment
Share on other sites

What's wrong here?

******************************

While 1
   WinSetState( "WebUntis - Windows Internet Explorer", "", @SW_MAXIMIZE)
   WinSetState( "Windows MediaPlayer", "", @SW_MAXIMIZE)
   sleep(10000)
Wend

*****************************

This should just maximize the 2 mentioned windows every 10 seconds (regardless of there State)

?

Edited by pbecks1963
Link to comment
Share on other sites

only thing i can think of would be to verify the name of the windows, run the commands, one window at a time, in Scite and check the exit code, if exit code 0 then its not finding the window.

maybe try Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase , to get it to find the window.

If @error Then
    MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!")
EndIf

"Yeah yeah yeah patience, how long will that take?"  -Ed Gruberman

REAL search results  |  SciTE4AutoIt3 Editor Full Version

Link to comment
Share on other sites

i was thinking more about it, i dont know how AutoIt handles dual monitors, you may have to specify which screen for each program window, 

If @error Then
    MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!")
EndIf

"Yeah yeah yeah patience, how long will that take?"  -Ed Gruberman

REAL search results  |  SciTE4AutoIt3 Editor Full Version

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

×
×
  • Create New...