Sign in to follow this  
Followers 0
c.haslam

Running one function while an application is minimized and another when it is maximized

6 posts in this topic

I wish to control Pegasus email client as follows:

  • When Pegasus is maximized, do nothing
  • The moment Pegasus is minimized, count email messages, and thereafter count them every 10 seconds, telling the user if any new ones (which have not been filtered out by Pegasus) have arrived
Also when Pegasus is minimized, check for the text "messages waiting to be downloaded". When there are, get Pegasus to download them.

I have a script doing this now, using the default mode (calling sleep()). Is there a better way? Perhaps using the OnEvent Mode?


...chris

Share this post


Link to post
Share on other sites



Is this what your script now is doing?

While 1
    While BitAnd(WinGetState('Pegasus whatever'), 16)
        ;Do Your email thing
        Sleep(10000);Wait 10 Seconds
    WEnd
    Sleep(10)
WEnd

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Is this what your script now is doing?

While 1
    While BitAnd(WinGetState('Pegasus whatever'), 16)
        ;Do Your email thing
        Sleep(10000);Wait 10 Seconds
    WEnd
    Sleep(10)
WEnd
Yes

...chris

Share this post


Link to post
Share on other sites

Yes


...chris

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The only suggestion I would have is AdlibEnable() then.

(Unless you know how to hook the windows with a DLL).

And when you bump, don't quote yourself, looks silly.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

The only suggestion I would have is AdlibEnable() then.

(Unless you know how to hook the windows with a DLL).

And when you bump, don't quote yourself, looks silly.

Thanks

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