What is the best way (with a view to optimization and using system resources) to make waiting in my application when window of another app will be shown?
For example:
How to accomplish item 2? I know only one possible way: just check if handle exists in loop using FindWindow
. But I hope there is a more smart solution exists.
If you launched the process (with CreateProcess
) use WaitForInputIdle
and then start the FindWindow
loop. Adding a Sleep(20)
or something to the loop will ensure your resource usage is minimal.