How to wait until window with given title is activated?

How to wait until window with given title is activated?

I want my program wait until window with given title is activated. I need it because I have program that runs notepad and then sends some keystokes, but before keystokes can reach to notepad's window, my program needs to wait until window is active.

Thanks, Rain
closed account (S6k9GNh0)
I would wait until the process has started. There are multiple ways to find a process that has just started. I suggest you make an implementation and then make an event that calls your function.
the easiest is use findwindow(classname, caption)
if the windows has an entry on the desktop this function will give you the handle of that window.
even if you dont have any class name for that window you can use NULL for class name and only the windows caption/title will give you tha handle but in that case the first window found with that title will be returned.
Topic archived. No new replies allowed.