I wrote an application to launch a bunch of instances to application 'X' (through a shell command). The program is responsible for repositioning the windows once I have retrieved their hwnds. My question is, what is the best way to wait for the application to actually create the window. Right now I'm just waiting until I can find it using EnumWindows. Obviously, I can run into some problems here, especially since sometimes the title is identical across multiple instances.
-I can probably associate them with the pid that is launched.
-Is there a callback that I can get a notification when a new window is created?
Let me know if you have any thoughts.