Jump to content

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


 Share

Recommended Posts

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?

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

  • Moderators

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

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.

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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
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...