I'm currently writting a program to launch a few windows and tile and size them in particular parts of the window. This program seem to work with 99% of the apps that I tested it on but there is one app, the one I need that is causing me problems. It's called FalconView. Below is the code clip:
hw& = GetDesktopWindow
STATUS = ShellExecute(hw&, "Open", APP_ASSOC,
IS_RUNNING = vbFalse
THE_TIME = DateAdd("s", 30, Time)
Do While IS_RUNNING = vbFalse
hw& = FindWindow(vbNullString, APP_TEXT)
If hw& > 0 Then IS_RUNNING = vbTrue
If THE_TIME < Time Then IS_RUNNING = vbTrue
Here is the problem...the program starts by the association, but it seems to stall during the timeout. The timeout completes and does not find the window. After the timeout times out then the app finishes launching. I don't know why the app is stalling in mid launch. The timeout is needed so that the app can launch and then window handle can be found.
The question is why is why is the app stalling and how can I get around it or fix it?