or download this
WaitWindowLike($parent,$wndtitle,$wndclass,$wndid,$depth,$wait)
Function which allows one to wait for a window to appear vs. using har
+d waits (e.g. sleep 2).
...
depth - How deep should we search before we stop
wait - How many seconds should we wait before giving up