Jump to content

Returning to Previous Windows State


 Share

Recommended Posts

I wish my script to do the following: when new mail is pending, maximize Pegasus and click to download it, then return to the window I was viewing before. This works AOK except when the Desktop is on the screen. Code follows:

CODE
$t = WinGetText("Pegasus Mail")

$mailWaiting = StringInStr($t,"waiting on pop.gmail.com")

if $mailWaiting Then

$ar = MouseGetPos()

$winTit = WinGetTitle("")

WinActivate("Pegasus Mail")

WinWaitActive("Pegasus Mail")

MouseClick("left",421,50) ; download

WinSetState("Pegasus Mail","",@sw_minimize)

if $winTit<>"" Then WinWaitActive($winTit) ; if no window was active

MouseMove($ar[0],$ar[1])

if $winTit<>"" is intended to detect when no windows are maximized, but the script sometimes pauses on this line.

Is there a better way?

...chris

Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

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