Sign in to follow this  
Followers 0
AnuReddy

winwait

6 posts in this topic

hey hi

i want to use winwait on some time limit and not on title can i do that ?? i mean to say winwait("250") something like this, could anyone help me on this

Share this post


Link to post
Share on other sites



Hi,

you may use the timeout parameter:

WinWait ( "title" [, "text" [, timeout]] )

or just a simple sleep () meets your requirement.

;-))

Stefan

Share this post


Link to post
Share on other sites

means just timeout with winwait will also do??

Share this post


Link to post
Share on other sites

see basically i am downloading a file but i dont know how much time it will take, and once it downloads i have to open that file, this can happen only after the file is downloaded completely, so how do i manage that time difference ??

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hi,

depending how the download works:

1) If file size grows by time, just compare file size on source and target in a loop.

Do
    sleep (250)
Until FileGetSize ($target) >= FileGetSize ($source); you might use InetGetSize if you download from url

2) If you use another program for download, check with processexists in a loop if download is ready.

$pid = ProcessExists ("mydownload.exe") 
While $pid <> 0
    sleep (250)
    $pid = ProcessExists ("mydownload.exe")
WEnd

3) Try to open the file in read mode. If failure, wait.

$file = FileOpen ("myfile", 0)
While $file = - 1
    sleep (250)
    $file = FileOpen ("myfile", 0)
WEnd
FileClose ($file)

;-))

Stefan

Edited by 99ojo

Share this post


Link to post
Share on other sites

Hi,

depending how the download works:

1) If file size grows by time, just compare file size on source and target in a loop.

Do
    sleep (250)
Until FileGetSize ($target) >= FileGetSize ($source); you might use InetGetSize if you download from url

2) If you use another program for download, check with processexists in a loop if download is ready.

$pid = ProcessExists ("mydownload.exe") 
While $pid <> 0
    sleep (250)
    $pid = ProcessExists ("mydownload.exe")
WEnd

3) Try to open the file in read mode. If failure, wait.

$file = FileOpen ("myfile", 0)
While $file = - 1
    sleep (250)
    $file = FileOpen ("myfile", 0)
WEnd
FileClose ($file)

;-))

Stefan

hey thanks stefan :mellow::)

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