>Yes. But since you already have the handle to the window you can add another check whether the handle still valid or not. If not then you can leave the loop in WFSO
>
>Btw, did I misunderstand for the question on WScript ? Did you mean that WScript is just a wrapper to API ? If that's what you mean then yes you're right. It also using CreateProcess.
That's my main problem. Not at all times you can get 'correct' window handle (what happened to me is that some apps put a toplevel window on start - maybe a splash one- then it goes away after some time and real app window comes up). If I could it's simple to wait checking IsWindow(hwnd).
Cetin