Jump to content

Script Doesn't stay open long enough to use!


Recommended Posts

Bucky, with that example you never leave your loop..

While ProcessExists('iexplore.exe')
    ProcessClose('iexplore.exe')
WEnd
Is more like it I think :D

Edit:

Or the example I gave with the Do/Until

Eh, I see. Thanks, that will help me later on. Plus, yours looks prettier.
Link to comment
Share on other sites

Hey @SmOke_N,

Your using sleep(1000)? From time to time I have found (visual experience, hunch - can't document it) that GuiGetMsg() will loose messages in the message pump with such a high sleep time. 250 is my maximum.

Have you, or anyone else, experienced something like that?

I don't now of it will affect HotKeySet calls since I have not used it much.

Link to comment
Share on other sites

Try this:

HotKeySet("z","_TerminateExplorer");HotKeySet sets Z for termnate key
HotKeySet("!z","_ExitAutoIt");Alt+Z exits script
While 1
    Sleep(300)
WEnd;waiting for hotkey
Func _TerminateExplorer();terminate Explorer func
    $explorerPID=ProcessExists("iexplore.exe")
    If $explorerPID = 0 Then
        TrayTip("Internet Explorer close","No Internet Explorer window active",20,3)
    Else
        ProcessClose($explorerPID)
    EndIf
EndFunc
Func _ExitAutoIt()
    Exit
EndFunc

I can do signature me.

Link to comment
Share on other sites

  • Moderators

Hey @SmOke_N,

Your using sleep(1000)? From time to time I have found (visual experience, hunch - can't document it) that GuiGetMsg() will loose messages in the message pump with such a high sleep time. 250 is my maximum.

Have you, or anyone else, experienced something like that?

I don't now of it will affect HotKeySet calls since I have not used it much.

There is no GUI Uten :D ... But you are correct in your observations :D

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

There is no GUI Uten :D ... But you are correct in your observations :P

Yes I know there is no GUI in this case and many of the "small sample" cases.

But from what I see regarding GUI samples "bad habits" :"> tend to follow us around.

That's why I was pointing it out and wondering. Nice to know it's not just my imagination that you can loose messages with a to high sleep setting :D

Appreciate the clarification, thanks @SmOke_N.

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