Sign in to follow this  
Followers 0
c.haslam

Returning to Previous Windows State

3 posts in this topic

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


...chris

Share this post


Link to post
Share on other sites



Why don't you use ControlClick or ControlSend? Then your application can stay minimized.

Share this post


Link to post
Share on other sites

Why don't you use ControlClick or ControlSend? Then your application can stay minimized.

Many thanks. ControlClick works fine.

...chris


...chris

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