Jump to content

WinExists with timeout


Recommended Posts

Hello!

I read around a bit (not much, helpfile and a quick google search and forum search here), sorry if this has been asked before.

I have a code snippet I wrote:

$Wait = WinExists($TopUpName & ".pdf - Adobe Reader", "", 5)
    If $Wait = 0 Then
       Return
       MsgBox(0, "Title", "Nem találtam")
    Else
       WinClose($TopUpName & ".pdf - Adobe Reader", "")
       MsgBox(0, "Title", "Megtaláltam, szar vagyok és nem zárom be")
    EndIf

Before I used winwaitactive, but I realized that somehow the pdf wasn't neceserry active after it has been opened, so I changed it to WinExists. I saw that there are only 2 parameters for winexists, but when I tried to run it just for the hell of it, It run down without an error. (MsgBox are there just for me too see whats happening)

My question is, whats happening? Does Autoit just skip the last parameter? Is this works as a timeout ? (I doubt that), is there a way to give time out for WinExists? (I'm sure there is) How? :)

Thank you for your time!

Edit:Quick edit for a grammar mistake

Edited by SorryButImaNewbie
Link to comment
Share on other sites

OK, I see, and am unsure of the answer, unless it's been discussed before only a code dev would know that.

I too would have expected it to give a "wrong number of parameters" error.

There are a few possible answers, but they'd all be guesses from someone who does not have access to the AutoIt3 source code.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I got the same results as J1.

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

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